diff --git a/crates/header-translator/Cargo.toml b/crates/header-translator/Cargo.toml new file mode 100644 index 000000000..e768f3e54 --- /dev/null +++ b/crates/header-translator/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "header-translator" +version = "0.1.0" +edition = "2021" +publish = false + +repository = "https://github.com/madsmtm/objc2" +license = "Zlib OR Apache-2.0 OR MIT" + +[dependencies] +clang = { version = "2.0", features = ["runtime", "clang_10_0"] } +toml = "0.5.9" +serde = { version = "1.0.144", features = ["derive"] } +apple-sdk = { version = "0.2.0", default-features = false } diff --git a/crates/header-translator/README.md b/crates/header-translator/README.md new file mode 100644 index 000000000..2bc84d6e5 --- /dev/null +++ b/crates/header-translator/README.md @@ -0,0 +1,11 @@ +# Objective-C header translator + +For use in making `icrate`. + +```console +cargo run --bin header-translator -- /Applications/Xcode.app/Contents/Developer +``` + +## SDKs + +We do not redistribute the relevant SDKs, to hopefully avoid a license violation. You can download the SDKs yourself (they're bundled in XCode) from [Apple's website](https://developer.apple.com/download/all/?q=xcode) (requires an Apple ID). diff --git a/crates/header-translator/framework-includes.h b/crates/header-translator/framework-includes.h new file mode 100644 index 000000000..eb29fad17 --- /dev/null +++ b/crates/header-translator/framework-includes.h @@ -0,0 +1,17 @@ +// Workaround for clang < 13, only used in NSBundle.h +#define NS_FORMAT_ARGUMENT(A) + +// Workaround for clang < 13 +#define _Nullable_result _Nullable + +#include + +#import + +#import + +#if TARGET_OS_OSX +#import +#endif + +#import diff --git a/crates/header-translator/src/availability.rs b/crates/header-translator/src/availability.rs new file mode 100644 index 000000000..d86af499b --- /dev/null +++ b/crates/header-translator/src/availability.rs @@ -0,0 +1,15 @@ +use clang::PlatformAvailability; + +#[derive(Debug, Clone)] +pub struct Availability { + #[allow(dead_code)] + inner: Vec, +} + +impl Availability { + pub fn parse(availability: Vec) -> Self { + Self { + inner: availability, + } + } +} diff --git a/crates/header-translator/src/config.rs b/crates/header-translator/src/config.rs new file mode 100644 index 000000000..d03ddfa2f --- /dev/null +++ b/crates/header-translator/src/config.rs @@ -0,0 +1,108 @@ +use std::collections::HashMap; +use std::fs; +use std::io::Result; +use std::path::Path; + +use serde::Deserialize; + +#[derive(Deserialize, Debug, Clone, PartialEq, Eq)] +#[serde(deny_unknown_fields)] +pub struct Config { + #[serde(rename = "class")] + #[serde(default)] + pub class_data: HashMap, + #[serde(rename = "protocol")] + #[serde(default)] + pub protocol_data: HashMap, + #[serde(rename = "struct")] + #[serde(default)] + pub struct_data: HashMap, + #[serde(rename = "enum")] + #[serde(default)] + pub enum_data: HashMap, + #[serde(rename = "fn")] + #[serde(default)] + pub fns: HashMap, + #[serde(rename = "static")] + #[serde(default)] + pub statics: HashMap, + #[serde(rename = "typedef")] + #[serde(default)] + pub typedef_data: HashMap, + #[serde(default)] + pub imports: Vec, +} + +#[derive(Deserialize, Debug, Default, Clone, PartialEq, Eq)] +#[serde(deny_unknown_fields)] +pub struct ClassData { + #[serde(default)] + pub skipped: bool, + #[serde(rename = "superclass-name")] + #[serde(default)] + pub new_superclass_name: Option, + #[serde(default)] + pub methods: HashMap, + #[serde(default)] + pub properties: HashMap, +} + +#[derive(Deserialize, Debug, Default, Clone, PartialEq, Eq)] +#[serde(deny_unknown_fields)] +pub struct StructData { + #[serde(default)] + pub skipped: bool, +} + +#[derive(Deserialize, Debug, Default, Clone, PartialEq, Eq)] +#[serde(deny_unknown_fields)] +pub struct EnumData { + #[serde(default)] + pub skipped: bool, + #[serde(rename = "use-value")] + #[serde(default)] + pub use_value: bool, + #[serde(default)] + pub constants: HashMap, +} + +#[derive(Deserialize, Debug, Clone, Copy, PartialEq, Eq)] +#[serde(deny_unknown_fields)] +pub struct MethodData { + #[serde(rename = "unsafe")] + #[serde(default = "unsafe_default")] + pub unsafe_: bool, + #[serde(default = "skipped_default")] + pub skipped: bool, + // TODO: mutating +} + +// TODO +pub type FnData = StructData; +pub type StaticData = StructData; +pub type TypedefData = StructData; + +fn unsafe_default() -> bool { + true +} + +fn skipped_default() -> bool { + false +} + +impl Default for MethodData { + fn default() -> Self { + Self { + unsafe_: unsafe_default(), + skipped: skipped_default(), + } + } +} + +impl Config { + pub fn from_file(file: &Path) -> Result { + let s = fs::read_to_string(file)?; + + Ok(toml::from_str(&s)?) + } +} diff --git a/crates/header-translator/src/expr.rs b/crates/header-translator/src/expr.rs new file mode 100644 index 000000000..f24be0e78 --- /dev/null +++ b/crates/header-translator/src/expr.rs @@ -0,0 +1,130 @@ +use std::fmt; +use std::fmt::Write; + +use clang::token::TokenKind; +use clang::{Entity, EntityKind, EntityVisitResult}; + +use crate::unexposed_macro::UnexposedMacro; + +#[derive(Clone, Debug, PartialEq)] +pub struct Expr { + s: String, +} + +impl Expr { + pub fn from_val((signed, unsigned): (i64, u64), is_signed: bool) -> Self { + let s = if is_signed { + format!("{}", signed) + } else { + format!("{}", unsigned) + }; + Expr { s } + } + + pub fn parse_enum_constant(entity: &Entity<'_>) -> Option { + let mut declaration_references = Vec::new(); + + entity.visit_children(|entity, _parent| { + if let EntityKind::DeclRefExpr = entity.get_kind() { + let name = entity.get_name().expect("expr decl ref name"); + declaration_references.push(name); + } + EntityVisitResult::Recurse + }); + + let mut res = None; + + entity.visit_children(|entity, _parent| { + match entity.get_kind() { + EntityKind::UnexposedAttr => { + if let Some(macro_) = UnexposedMacro::parse(&entity) { + panic!("parsed macro in expr: {macro_:?}, {entity:?}"); + } + } + _ => { + if res.is_none() { + res = Self::parse(&entity, &declaration_references); + } else { + panic!("found multiple expressions where one was expected"); + } + } + } + EntityVisitResult::Continue + }); + + res + } + + pub fn parse_var(entity: &Entity<'_>) -> Option { + Self::parse(entity, &[]) + } + + fn parse(entity: &Entity<'_>, declaration_references: &[String]) -> Option { + let range = entity.get_range().expect("expr range"); + let tokens = range.tokenize(); + + if tokens.is_empty() { + // TODO: Find a better way to parse macros + return None; + } + + let mut s = String::new(); + + for token in &tokens { + match (token.get_kind(), token.get_spelling()) { + (TokenKind::Identifier, ident) => { + if declaration_references.contains(&ident) { + // TODO: Handle these specially when we need to + } + write!(s, "{}", ident).unwrap(); + } + (TokenKind::Literal, lit) => { + let lit = lit + .trim_end_matches("UL") + .trim_end_matches("L") + .trim_end_matches("u") + .trim_end_matches("U"); + let lit = lit.replace("0X", "0x"); + write!(s, "{}", lit).unwrap(); + } + (TokenKind::Punctuation, punct) => { + match &*punct { + // These have the same semantics in C and Rust + "(" | ")" | "<<" | "-" | "+" | "|" | "&" | "^" => { + write!(s, "{}", punct).unwrap() + } + // Bitwise not + "~" => write!(s, "!").unwrap(), + punct => panic!("unknown expr punctuation {punct}"), + } + } + (kind, spelling) => panic!("unknown expr token {kind:?}/{spelling}"), + } + } + + // Trim casts + s = s + .trim_start_matches("(NSBoxType)") + .trim_start_matches("(NSBezelStyle)") + .trim_start_matches("(NSEventSubtype)") + .trim_start_matches("(NSWindowButton)") + .trim_start_matches("(NSExpressionType)") + .to_string(); + + // Trim unnecessary parentheses + if s.starts_with('(') + && s.ends_with(')') + && s.chars().filter(|&c| c == '(' || c == ')').count() == 2 + { + s = s.trim_start_matches("(").trim_end_matches(")").to_string(); + } + + Some(Self { s }) + } +} + +impl fmt::Display for Expr { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.s) + } +} diff --git a/crates/header-translator/src/lib.rs b/crates/header-translator/src/lib.rs new file mode 100644 index 000000000..c4cabf92b --- /dev/null +++ b/crates/header-translator/src/lib.rs @@ -0,0 +1,125 @@ +use std::collections::HashSet; +use std::fmt::{Display, Write}; +use std::path::Path; +use std::process::{Command, Stdio}; + +mod availability; +mod config; +mod expr; +mod method; +mod objc2_utils; +mod property; +mod rust_type; +mod stmt; +mod unexposed_macro; + +pub use self::config::Config; +pub use self::stmt::Stmt; + +#[derive(Debug)] +pub struct RustFile { + declared_types: HashSet, + stmts: Vec, +} + +const INITIAL_IMPORTS: &str = r#"//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*;"#; + +impl RustFile { + pub fn new() -> Self { + Self { + declared_types: HashSet::new(), + stmts: Vec::new(), + } + } + + pub fn add_stmt(&mut self, stmt: Stmt) { + match &stmt { + Stmt::ClassDecl { name, .. } => { + self.declared_types.insert(name.clone()); + } + Stmt::CategoryDecl { .. } => {} + Stmt::ProtocolDecl { name, .. } => { + self.declared_types.insert(name.clone()); + } + Stmt::StructDecl { name, .. } => { + self.declared_types.insert(name.clone()); + } + Stmt::EnumDecl { name, variants, .. } => { + if let Some(name) = name { + self.declared_types.insert(name.clone()); + } + for (name, _) in variants { + self.declared_types.insert(name.clone()); + } + } + Stmt::VarDecl { name, .. } => { + self.declared_types.insert(name.clone()); + } + Stmt::FnDecl { name, body, .. } => { + if body.is_none() { + self.declared_types.insert(name.clone()); + } else { + // TODO + } + } + Stmt::AliasDecl { name, .. } => { + self.declared_types.insert(name.clone()); + } + } + self.stmts.push(stmt); + } + + pub fn finish(self, config: &Config) -> (HashSet, String) { + let mut tokens = String::new(); + writeln!(tokens, "{}", INITIAL_IMPORTS).unwrap(); + + for import in &config.imports { + writeln!(tokens, "use crate::{import}::*;").unwrap(); + } + + writeln!(tokens, "").unwrap(); + + for stmt in self.stmts { + writeln!(tokens, "{}", stmt).unwrap(); + } + + (self.declared_types, tokens) + } +} + +pub fn run_cargo_fmt(package: &str) { + let status = Command::new("cargo") + .args(["fmt", "--package", package]) + .current_dir(Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap()) + .status() + .expect("failed running cargo fmt"); + + assert!( + status.success(), + "failed running cargo fmt with exit code {status}" + ); +} + +pub fn run_rustfmt(data: impl Display) -> Vec { + use std::io::Write; + + let mut child = Command::new("rustfmt") + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .spawn() + .expect("failed running rustfmt"); + + let mut stdin = child.stdin.take().expect("failed to open stdin"); + write!(stdin, "{}", data).expect("failed writing"); + drop(stdin); + + let output = child.wait_with_output().expect("failed formatting"); + + if !output.status.success() { + panic!("failed running rustfmt with exit code {}", output.status) + } + + output.stdout +} diff --git a/crates/header-translator/src/main.rs b/crates/header-translator/src/main.rs new file mode 100644 index 000000000..7f1c8f1fe --- /dev/null +++ b/crates/header-translator/src/main.rs @@ -0,0 +1,312 @@ +use std::collections::BTreeMap; +use std::fmt::{self, Write}; +use std::fs; +use std::io; +use std::path::{Path, PathBuf}; + +use apple_sdk::{AppleSdk, DeveloperDirectory, Platform, SdkPath, SimpleSdk}; +use clang::{Clang, Entity, EntityKind, EntityVisitResult, Index}; + +use header_translator::{run_cargo_fmt, run_rustfmt, Config, RustFile, Stmt}; + +const FORMAT_INCREMENTALLY: bool = false; + +fn main() { + let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); + let workspace_dir = manifest_dir.parent().unwrap(); + let crate_src = workspace_dir.join("icrate/src"); + + println!("status: loading configs..."); + let configs = load_configs(&crate_src); + println!("status: loaded {} configs", configs.len()); + + let clang = Clang::new().unwrap(); + let index = Index::new(&clang, true, true); + + let developer_dir = DeveloperDirectory::from(PathBuf::from( + std::env::args_os() + .skip(1) + .next() + .expect("must specify developer directory as first argument"), + )); + + let sdks = developer_dir + .platforms() + .expect("developer dir platforms") + .into_iter() + .filter_map(|platform| { + matches!(&*platform, Platform::MacOsX | Platform::IPhoneOs).then(|| { + let sdks: Vec<_> = platform + .find_sdks::() + .expect("platform sdks") + .into_iter() + .filter(|sdk| !sdk.is_symlink() && sdk.platform() == &*platform) + .collect(); + if sdks.len() != 1 { + panic!("found multiple sdks {sdks:?} in {:?}", &*platform); + } + sdks[0].sdk_path() + }) + }); + + let mut result: BTreeMap> = configs + .iter() + .map(|(library, _)| (library.clone(), BTreeMap::new())) + .collect(); + + // TODO: Compare SDKs + for sdk in sdks { + println!("status: parsing {:?}...", sdk.platform); + + let mut preprocessing = true; + + parse_and_visit_stmts(&index, &sdk, |library, file_name, entity| { + if let Some(config) = configs.get(library) { + let files = result.get_mut(library).expect("files"); + match entity.get_kind() { + EntityKind::InclusionDirective if preprocessing => { + // println!("{library}/{file_name}.h: {entity:?}"); + // If umbrella header + let name = entity.get_name().expect("inclusion name"); + let mut iter = name.split('/'); + let framework = iter.next().expect("inclusion name has framework"); + if framework == library { + let included = iter + .next() + .expect("inclusion name has file") + .strip_suffix(".h") + .expect("inclusion name file is header") + .to_string(); + if iter.count() != 0 { + panic!("invalid inclusion of {name:?}"); + } + + // If inclusion is not umbrella header + if included != library { + // The file is often included twice, even + // within the same file, so insertion can fail + files.entry(included).or_insert_with(RustFile::new); + } + } + } + EntityKind::MacroExpansion if preprocessing => {} + EntityKind::MacroDefinition if preprocessing => { + // let name = entity.get_name().expect("macro def name"); + // entity.is_function_like_macro(); + // println!("macrodef in {library}/{file_name}.h: {}", name); + } + _ => { + if preprocessing { + println!("status: preprocessed {:?}...", sdk.platform); + } + preprocessing = false; + // No more includes / macro expansions after this line + let file = files.get_mut(file_name).expect("file"); + if let Some(stmt) = Stmt::parse(&entity, &config) { + if sdk.platform == Platform::MacOsX { + file.add_stmt(stmt); + } + } + } + } + } else { + // println!("library not found {library}"); + } + }); + println!("status: done parsing {:?}", sdk.platform); + } + + for (library, files) in result { + println!("status: writing framework {library}..."); + let output_path = crate_src.join("generated").join(&library); + let config = configs.get(&library).expect("configs get library"); + output_files(&output_path, files, FORMAT_INCREMENTALLY, config).unwrap(); + println!("status: written framework {library}"); + } + + if !FORMAT_INCREMENTALLY { + println!("status: formatting"); + run_cargo_fmt("icrate"); + } +} + +fn load_configs(crate_src: &Path) -> BTreeMap { + crate_src + .read_dir() + .expect("read_dir") + .filter_map(|dir| { + let dir = dir.expect("dir"); + if !dir.file_type().expect("file type").is_dir() { + return None; + } + let path = dir.path(); + let file = path.join("translation-config.toml"); + match Config::from_file(&file) { + Ok(config) => Some(( + path.file_name() + .expect("framework name") + .to_string_lossy() + .to_string(), + config, + )), + Err(err) if err.kind() == io::ErrorKind::NotFound => None, + Err(err) => panic!("{file:?}: {err}"), + } + }) + .collect() +} + +fn parse_and_visit_stmts( + index: &Index<'_>, + sdk: &SdkPath, + mut f: impl FnMut(&str, &str, Entity<'_>), +) { + let (target, version_min) = match &sdk.platform { + Platform::MacOsX => ("--target=x86_64-apple-macos", "-mmacosx-version-min=10.7"), + Platform::IPhoneOs => ("--target=arm64-apple-ios", "-miphoneos-version-min=7.0"), + _ => todo!(), + }; + + let tu = index + .parser(&Path::new(env!("CARGO_MANIFEST_DIR")).join("framework-includes.h")) + .detailed_preprocessing_record(true) + .incomplete(true) + .skip_function_bodies(true) + .keep_going(true) + // .single_file_parse(true) + .include_attributed_types(true) + .visit_implicit_attributes(true) + // .ignore_non_errors_from_included_files(true) + .retain_excluded_conditional_blocks(true) + .arguments(&[ + "-x", + "objective-c", + target, + "-Wall", + "-Wextra", + "-fobjc-arc", + "-fobjc-arc-exceptions", + "-fobjc-abi-version=2", // 3?? + // "-fparse-all-comments", + "-fapinotes", + version_min, + "-isysroot", + sdk.path.to_str().unwrap(), + ]) + .parse() + .unwrap(); + + println!("status: initialized translation unit {:?}", sdk.platform); + + dbg!(&tu); + dbg!(tu.get_target()); + dbg!(tu.get_memory_usage()); + dbg!(tu.get_diagnostics()); + + // let dbg_file = |file: File<'_>| { + // dbg!( + // &file, + // file.get_module(), + // file.get_skipped_ranges(), + // file.is_include_guarded(), + // // file.get_includes(), + // // file.get_references(), + // ); + // }; + // + // dbg_file(tu.get_file(&header).unwrap()); + // dbg_file(tu.get_file(&dir.join("NSAccessibility.h")).unwrap()); + // let cursor_file = tu.get_file(&dir.join("NSCursor.h")).unwrap(); + // dbg_file(cursor_file); + + let entity = tu.get_entity(); + + dbg!(&entity); + dbg!(entity.get_availability()); + + let framework_dir = sdk.path.join("System/Library/Frameworks"); + entity.visit_children(|entity, _parent| { + if let Some(location) = entity.get_location() { + if let Some(file) = location.get_file_location().file { + let path = file.get_path(); + if let Ok(path) = path.strip_prefix(&framework_dir) { + let mut components = path.components(); + let library = components + .next() + .expect("components next") + .as_os_str() + .to_str() + .expect("component to_str") + .strip_suffix(".framework") + .expect("framework fileending"); + + let path = components.as_path(); + let name = path + .file_stem() + .expect("path file stem") + .to_string_lossy() + .to_owned(); + + f(&library, &name, entity); + } + } + } + EntityVisitResult::Continue + }); +} + +fn output_files( + output_path: &Path, + files: impl IntoIterator, + format_incrementally: bool, + config: &Config, +) -> fmt::Result { + let declared: Vec<_> = files + .into_iter() + .map(|(name, file)| { + let (declared_types, tokens) = file.finish(config); + + let mut path = output_path.join(&name); + path.set_extension("rs"); + + let output = if format_incrementally { + run_rustfmt(tokens) + } else { + tokens.into() + }; + + fs::write(&path, output).unwrap(); + + (name, declared_types) + }) + .collect(); + + let mut tokens = String::new(); + + for (name, _) in &declared { + writeln!(tokens, "#[path = \"{name}.rs\"]")?; + writeln!(tokens, "mod __{name};")?; + } + writeln!(tokens, "")?; + for (name, declared_types) in declared { + if !declared_types.is_empty() { + let declared_types: Vec<_> = declared_types.into_iter().collect(); + writeln!( + tokens, + "pub use self::__{name}::{{{}}};", + declared_types.join(",") + )?; + } + } + + let output = if format_incrementally { + run_rustfmt(tokens) + } else { + tokens.into() + }; + + // truncate if the file exists + fs::write(output_path.join("mod.rs"), output).unwrap(); + + Ok(()) +} diff --git a/crates/header-translator/src/method.rs b/crates/header-translator/src/method.rs new file mode 100644 index 000000000..d8199b880 --- /dev/null +++ b/crates/header-translator/src/method.rs @@ -0,0 +1,421 @@ +use std::fmt; + +use clang::{Entity, EntityKind, EntityVisitResult, ObjCQualifiers}; + +use crate::availability::Availability; +use crate::config::MethodData; +use crate::objc2_utils::in_selector_family; +use crate::rust_type::Ty; +use crate::unexposed_macro::UnexposedMacro; + +#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)] +pub enum Qualifier { + In, + Inout, + Out, + Bycopy, + Byref, + Oneway, +} + +impl Qualifier { + pub fn parse(qualifiers: ObjCQualifiers) -> Self { + match qualifiers { + ObjCQualifiers { + in_: true, + inout: false, + out: false, + bycopy: false, + byref: false, + oneway: false, + } => Self::In, + ObjCQualifiers { + in_: false, + inout: true, + out: false, + bycopy: false, + byref: false, + oneway: false, + } => Self::Inout, + ObjCQualifiers { + in_: false, + inout: false, + out: true, + bycopy: false, + byref: false, + oneway: false, + } => Self::Out, + ObjCQualifiers { + in_: false, + inout: false, + out: false, + bycopy: true, + byref: false, + oneway: false, + } => Self::Bycopy, + ObjCQualifiers { + in_: false, + inout: false, + out: false, + bycopy: false, + byref: true, + oneway: false, + } => Self::Byref, + ObjCQualifiers { + in_: false, + inout: false, + out: false, + bycopy: false, + byref: false, + oneway: true, + } => Self::Oneway, + _ => unreachable!("invalid qualifiers: {:?}", qualifiers), + } + } +} + +#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)] +pub enum MemoryManagement { + /// Consumes self and returns retained pointer + Init, + ReturnsRetained, + ReturnsInnerPointer, + Normal, +} + +impl MemoryManagement { + /// Verifies that the selector and the memory management rules match up + /// in a way that we can just use `msg_send_id!`. + fn verify_sel(self, sel: &str) { + let bytes = sel.as_bytes(); + if in_selector_family(bytes, b"init") { + assert!(self == Self::Init, "{:?} did not match {}", self, sel); + } else if in_selector_family(bytes, b"new") + || in_selector_family(bytes, b"alloc") + || in_selector_family(bytes, b"copy") + || in_selector_family(bytes, b"mutableCopy") + { + assert!( + self == Self::ReturnsRetained, + "{:?} did not match {}", + self, + sel + ); + } else { + if self == Self::ReturnsInnerPointer { + return; + } + assert!(self == Self::Normal, "{:?} did not match {}", self, sel); + } + } + + /// Matches `objc2::__macro_helpers::retain_semantics`. + fn get_memory_management_name(sel: &str) -> &'static str { + let bytes = sel.as_bytes(); + match ( + in_selector_family(bytes, b"new"), + in_selector_family(bytes, b"alloc"), + in_selector_family(bytes, b"init"), + in_selector_family(bytes, b"copy"), + in_selector_family(bytes, b"mutableCopy"), + ) { + (true, false, false, false, false) => "New", + (false, true, false, false, false) => "Alloc", + (false, false, true, false, false) => "Init", + (false, false, false, true, false) => "CopyOrMutCopy", + (false, false, false, false, true) => "CopyOrMutCopy", + (false, false, false, false, false) => "Other", + _ => unreachable!(), + } + } + + pub fn is_init(sel: &str) -> bool { + in_selector_family(sel.as_bytes(), b"init") + } + + pub fn is_alloc(sel: &str) -> bool { + in_selector_family(sel.as_bytes(), b"alloc") + } + + pub fn is_new(sel: &str) -> bool { + in_selector_family(sel.as_bytes(), b"new") + } +} + +#[allow(dead_code)] +#[derive(Debug, Clone)] +pub struct Method { + pub selector: String, + pub fn_name: String, + pub availability: Availability, + pub is_class: bool, + pub is_optional_protocol: bool, + pub memory_management: MemoryManagement, + pub designated_initializer: bool, + pub arguments: Vec<(String, Option, Ty)>, + pub result_type: Ty, + pub safe: bool, +} + +impl Method { + /// Takes one of `EntityKind::ObjCInstanceMethodDecl` or + /// `EntityKind::ObjCClassMethodDecl`. + pub fn partial(entity: Entity<'_>) -> PartialMethod<'_> { + let selector = entity.get_name().expect("method selector"); + let fn_name = selector.trim_end_matches(|c| c == ':').replace(':', "_"); + + let is_class = match entity.get_kind() { + EntityKind::ObjCInstanceMethodDecl => false, + EntityKind::ObjCClassMethodDecl => true, + _ => unreachable!("unknown method kind"), + }; + + PartialMethod { + entity, + selector, + is_class, + fn_name, + } + } +} + +#[derive(Debug, Clone)] +pub struct PartialMethod<'tu> { + entity: Entity<'tu>, + selector: String, + pub is_class: bool, + pub fn_name: String, +} + +impl<'tu> PartialMethod<'tu> { + pub fn parse(self, data: MethodData) -> Option { + let Self { + entity, + selector, + is_class, + fn_name, + } = self; + + // println!("Method {:?}", selector); + if data.skipped { + return None; + } + + if entity.is_variadic() { + println!("Can't handle variadic method {}", selector); + return None; + } + + let availability = Availability::parse( + entity + .get_platform_availability() + .expect("method availability"), + ); + + let mut arguments: Vec<_> = entity + .get_arguments() + .expect("method arguments") + .into_iter() + .map(|entity| { + let name = entity.get_name().expect("arg display name"); + let qualifier = entity.get_objc_qualifiers().map(Qualifier::parse); + let mut is_consumed = false; + + entity.visit_children(|entity, _parent| { + match entity.get_kind() { + EntityKind::ObjCClassRef + | EntityKind::ObjCProtocolRef + | EntityKind::TypeRef + | EntityKind::ParmDecl => { + // Ignore + } + EntityKind::NSConsumed => { + if is_consumed { + panic!("got NSConsumed twice"); + } + is_consumed = true; + } + EntityKind::UnexposedAttr => { + if let Some(macro_) = UnexposedMacro::parse(&entity) { + println!("method argument {fn_name}/{name}: {macro_:?}"); + } + } + // For some reason we recurse into array types + EntityKind::IntegerLiteral => {} + _ => panic!("Unknown method argument child: {:?}, {:?}", entity, _parent), + }; + EntityVisitResult::Continue + }); + + let ty = entity.get_type().expect("argument type"); + let ty = Ty::parse_method_argument(ty, is_consumed); + + (name, qualifier, ty) + }) + .collect(); + + let is_error = if let Some((_, _, ty)) = arguments.last() { + ty.argument_is_error_out() + } else { + false + }; + + // TODO: Strip these from function name? + // selector.ends_with("error:") + // || selector.ends_with("AndReturnError:") + // || selector.ends_with("WithError:") + + if is_error { + arguments.pop(); + } + + if let Some(qualifiers) = entity.get_objc_qualifiers() { + let qualifier = Qualifier::parse(qualifiers); + panic!( + "unexpected qualifier `{:?}` on return type: {:?}", + qualifier, entity + ); + } + + let result_type = entity.get_result_type().expect("method return type"); + let mut result_type = Ty::parse_method_return(result_type); + + result_type.fix_related_result_type(is_class, &selector); + + if is_class && MemoryManagement::is_alloc(&selector) { + result_type.set_is_alloc(); + } + + if is_error { + result_type.set_is_error(); + } + + let mut designated_initializer = false; + let mut consumes_self = false; + let mut memory_management = MemoryManagement::Normal; + + entity.visit_children(|entity, _parent| { + match entity.get_kind() { + EntityKind::ObjCClassRef + | EntityKind::ObjCProtocolRef + | EntityKind::TypeRef + | EntityKind::ParmDecl => { + // Ignore + } + EntityKind::ObjCDesignatedInitializer => { + if designated_initializer { + panic!("encountered ObjCDesignatedInitializer twice"); + } + designated_initializer = true; + } + EntityKind::NSConsumesSelf => { + consumes_self = true; + } + EntityKind::NSReturnsRetained => { + if memory_management != MemoryManagement::Normal { + panic!("got unexpected NSReturnsRetained") + } + memory_management = MemoryManagement::ReturnsRetained; + } + EntityKind::ObjCReturnsInnerPointer => { + if memory_management != MemoryManagement::Normal { + panic!("got unexpected ObjCReturnsInnerPointer") + } + memory_management = MemoryManagement::ReturnsInnerPointer; + } + EntityKind::NSConsumed => { + // Handled inside arguments + } + EntityKind::IbActionAttr => { + // TODO: What is this? + } + EntityKind::ObjCRequiresSuper => { + // TODO: Can we use this for something? + // + } + EntityKind::UnexposedAttr => { + if let Some(macro_) = UnexposedMacro::parse(&entity) { + println!("method {fn_name}: {macro_:?}"); + } + } + _ => panic!("Unknown method child: {:?}, {:?}", entity, _parent), + }; + // TODO: Verify that Continue is good enough + EntityVisitResult::Continue + }); + + if consumes_self { + if memory_management != MemoryManagement::ReturnsRetained { + panic!("got NSConsumesSelf without NSReturnsRetained"); + } + memory_management = MemoryManagement::Init; + } + + // Verify that memory management is as expected + if result_type.is_id() { + memory_management.verify_sel(&selector); + } + + Some(Method { + selector, + fn_name, + availability, + is_class, + is_optional_protocol: entity.is_objc_optional(), + memory_management, + designated_initializer, + arguments, + result_type, + safe: !data.unsafe_, + }) + } +} + +impl fmt::Display for Method { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if self.is_optional_protocol { + writeln!(f, " #[optional]")?; + } + + if self.result_type.is_id() { + writeln!( + f, + " #[method_id(@__retain_semantics {} {})]", + MemoryManagement::get_memory_management_name(&self.selector), + self.selector + )?; + } else { + writeln!(f, " #[method({})]", self.selector)?; + }; + + write!(f, " pub ")?; + if !self.safe { + write!(f, "unsafe ")?; + } + write!(f, "fn {}(", handle_reserved(&self.fn_name))?; + if !self.is_class { + if MemoryManagement::is_init(&self.selector) { + write!(f, "this: Option>, ")?; + } else { + write!(f, "&self, ")?; + } + } + for (param, _qualifier, arg_ty) in &self.arguments { + write!(f, "{}: {arg_ty},", handle_reserved(param))?; + } + write!(f, ")")?; + + writeln!(f, "{};", self.result_type)?; + + Ok(()) + } +} + +pub(crate) fn handle_reserved(s: &str) -> &str { + match s { + "type" => "type_", + "trait" => "trait_", + "abstract" => "abstract_", + s => s, + } +} diff --git a/crates/header-translator/src/objc2_utils.rs b/crates/header-translator/src/objc2_utils.rs new file mode 100644 index 000000000..779da0986 --- /dev/null +++ b/crates/header-translator/src/objc2_utils.rs @@ -0,0 +1,40 @@ +//! Utilities copied from `objc2` + +pub const fn in_selector_family(mut selector: &[u8], mut family: &[u8]) -> bool { + // Skip leading underscores from selector + loop { + selector = match selector { + [b'_', rest @ ..] => rest, + _ => break, + } + } + + // Compare each character + loop { + (selector, family) = match (selector, family) { + // Remaining items + ([s, selector @ ..], [f, family @ ..]) => { + if *s == *f { + // Next iteration + (selector, family) + } else { + // Family does not begin with selector + return false; + } + } + // Equal + ([], []) => { + return true; + } + // Selector can't be part of familiy if smaller than it + ([], _) => { + return false; + } + // Remaining items in selector + // -> ensure next character is not lowercase + ([s, ..], []) => { + return !s.is_ascii_lowercase(); + } + } + } +} diff --git a/crates/header-translator/src/property.rs b/crates/header-translator/src/property.rs new file mode 100644 index 000000000..2f7640ef8 --- /dev/null +++ b/crates/header-translator/src/property.rs @@ -0,0 +1,183 @@ +use std::fmt; + +use clang::{Entity, EntityKind, EntityVisitResult, Nullability, ObjCAttributes}; + +use crate::availability::Availability; +use crate::config::MethodData; +use crate::method::{MemoryManagement, Method, Qualifier}; +use crate::rust_type::Ty; +use crate::unexposed_macro::UnexposedMacro; + +#[allow(dead_code)] +#[derive(Debug, Clone)] +pub struct Property { + name: String, + getter_name: String, + setter_name: Option, + availability: Availability, + is_class: bool, + is_optional_protocol: bool, + type_in: Ty, + type_out: Ty, + safe: bool, +} + +impl Property { + /// Takes `EntityKind::ObjCPropertyDecl`. + pub fn partial(entity: Entity<'_>) -> PartialProperty<'_> { + let attributes = entity.get_objc_attributes(); + let has_setter = attributes.map(|a| !a.readonly).unwrap_or(true); + + PartialProperty { + entity, + name: entity.get_display_name().expect("property getter name"), + getter_name: entity.get_objc_getter_name().expect("property getter name"), + setter_name: has_setter.then(|| { + entity + .get_objc_setter_name() + .expect("property setter name") + .trim_end_matches(|c| c == ':') + .to_string() + }), + is_class: attributes.map(|a| a.class).unwrap_or(false), + attributes: entity.get_objc_attributes(), + } + } +} + +#[derive(Debug, Clone)] +pub struct PartialProperty<'tu> { + entity: Entity<'tu>, + pub name: String, + pub getter_name: String, + pub setter_name: Option, + pub is_class: bool, + attributes: Option, +} + +impl PartialProperty<'_> { + pub fn parse(self, data: MethodData) -> Option { + let Self { + entity, + name, + getter_name, + setter_name, + is_class, + attributes, + } = self; + + if data.skipped { + return None; + } + + // println!("Property {getter_name:?}/{setter_name:?}: {attributes:?}"); + + let availability = Availability::parse( + entity + .get_platform_availability() + .expect("method availability"), + ); + + // `@property(copy)` for some reason returns nonnull? + // + // Swift signifies that they use forced unwrapping here, perhaps + // because they know that it can fail (e.g. in OOM situations), but + // is very unlikely to? + let default_nullability = if attributes.map(|a| a.copy).unwrap_or(false) { + Nullability::NonNull + } else { + Nullability::Unspecified + }; + + let type_in = Ty::parse_property( + entity.get_type().expect("property type"), + Nullability::Unspecified, + ); + let type_out = Ty::parse_property_return( + entity.get_type().expect("property type"), + default_nullability, + ); + + let mut memory_management = MemoryManagement::Normal; + + entity.visit_children(|entity, _parent| { + match entity.get_kind() { + EntityKind::ObjCClassRef + | EntityKind::ObjCProtocolRef + | EntityKind::TypeRef + | EntityKind::ParmDecl => { + // Ignore + } + EntityKind::ObjCReturnsInnerPointer => { + if memory_management != MemoryManagement::Normal { + panic!("got unexpected ObjCReturnsInnerPointer") + } + memory_management = MemoryManagement::ReturnsInnerPointer; + } + EntityKind::ObjCInstanceMethodDecl => { + println!("method in property: {entity:?}"); + } + EntityKind::IbOutletAttr => { + // TODO: What is this? + } + EntityKind::UnexposedAttr => { + if let Some(macro_) = UnexposedMacro::parse(&entity) { + println!("property {name}: {macro_:?}"); + } + } + _ => panic!("Unknown property child: {:?}, {:?}", entity, _parent), + }; + EntityVisitResult::Continue + }); + + let qualifier = entity.get_objc_qualifiers().map(Qualifier::parse); + assert_eq!(qualifier, None, "properties do not support qualifiers"); + + Some(Property { + name, + getter_name, + setter_name, + availability, + is_class, + is_optional_protocol: entity.is_objc_optional(), + type_in, + type_out, + safe: !data.unsafe_, + }) + } +} + +impl fmt::Display for Property { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let method = Method { + selector: self.getter_name.clone(), + fn_name: self.getter_name.clone(), + availability: self.availability.clone(), + is_class: self.is_class, + is_optional_protocol: self.is_optional_protocol, + memory_management: MemoryManagement::Normal, + designated_initializer: false, + arguments: Vec::new(), + result_type: self.type_out.clone(), + safe: self.safe, + }; + write!(f, "{method}")?; + if let Some(setter_name) = &self.setter_name { + writeln!(f, "")?; + let method = Method { + selector: setter_name.clone() + ":", + fn_name: setter_name.clone(), + availability: self.availability.clone(), + is_class: self.is_class, + is_optional_protocol: self.is_optional_protocol, + memory_management: MemoryManagement::Normal, + designated_initializer: false, + arguments: Vec::from([(self.name.clone(), None, self.type_in.clone())]), + result_type: Ty::VOID_RESULT, + safe: self.safe, + }; + write!(f, "{method}")?; + } + Ok(()) + } +} diff --git a/crates/header-translator/src/rust_type.rs b/crates/header-translator/src/rust_type.rs new file mode 100644 index 000000000..a1990e7b3 --- /dev/null +++ b/crates/header-translator/src/rust_type.rs @@ -0,0 +1,1219 @@ +use std::fmt; + +use clang::{CallingConvention, Nullability, Type, TypeKind}; + +use crate::method::MemoryManagement; + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct GenericType { + pub name: String, + pub generics: Vec, +} + +impl GenericType { + pub fn parse_objc_pointer(ty: Type<'_>) -> Self { + match ty.get_kind() { + TypeKind::ObjCInterface => { + let generics = ty.get_objc_type_arguments(); + if !generics.is_empty() { + panic!("generics not empty: {ty:?}, {generics:?}"); + } + let protocols = ty.get_objc_protocol_declarations(); + if !protocols.is_empty() { + panic!("protocols not empty: {ty:?}, {protocols:?}"); + } + let name = ty.get_display_name(); + Self { + name, + generics: Vec::new(), + } + } + TypeKind::ObjCObject => { + let base_ty = ty + .get_objc_object_base_type() + .expect("object to have base type"); + let mut name = base_ty.get_display_name(); + + let generics: Vec<_> = ty + .get_objc_type_arguments() + .into_iter() + .map(|param| { + match RustType::parse(param, false, Nullability::Unspecified, false) { + RustType::Id { + type_, + is_const: _, + lifetime: _, + nullability: _, + } => type_, + // TODO: Handle this better + RustType::Class { nullability: _ } => Self { + name: "TodoClass".to_string(), + generics: Vec::new(), + }, + param => { + panic!("invalid generic parameter {:?} in {:?}", param, ty) + } + } + }) + .collect(); + + let protocols: Vec<_> = ty + .get_objc_protocol_declarations() + .into_iter() + .map(|entity| entity.get_display_name().expect("protocol name")) + .collect(); + if !protocols.is_empty() { + if name == "id" && generics.is_empty() && protocols.len() == 1 { + name = protocols[0].clone(); + } else { + name = "TodoProtocols".to_string(); + } + } + + Self { name, generics } + } + _ => panic!("pointee was neither objcinterface nor objcobject: {ty:?}"), + } + } +} + +impl fmt::Display for GenericType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.name)?; + if !self.generics.is_empty() { + write!(f, "<")?; + for generic in &self.generics { + write!(f, "{generic},")?; + } + write!(f, ">")?; + } + Ok(()) + } +} + +/// ObjCLifetime +#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)] +pub enum Lifetime { + Unspecified, + /// OCL_ExplicitNone + Unretained, + /// OCL_Strong + Strong, + /// OCL_Weak + Weak, + /// OCL_Autoreleasing + Autoreleasing, +} + +/// Parse attributes. +/// +/// This is _very_ ugly, but required because libclang doesn't expose most +/// of these. +fn parse_attributed<'a>( + ty: Type<'a>, + nullability: &mut Nullability, + lifetime: &mut Lifetime, + kindof: &mut bool, + inside_partial_array: bool, +) -> Type<'a> { + let mut modified_ty = ty.clone(); + while modified_ty.get_kind() == TypeKind::Attributed { + // println!("{ty:?}, {modified_ty:?}"); + modified_ty = modified_ty + .get_modified_type() + .expect("attributed type to have modified type"); + } + + if modified_ty == ty { + return ty; + } + + let mut name = &*ty.get_display_name(); + let mut modified_name = &*modified_ty.get_display_name(); + + fn get_inner_fn(name: &str) -> &str { + let (_, name) = name.split_once('(').expect("fn to have begin parenthesis"); + let (name, _) = name.split_once(')').expect("fn to have end parenthesis"); + name.trim() + } + + match modified_ty.get_kind() { + TypeKind::ConstantArray => { + let (res, _) = name.split_once("[").expect("array to end with ["); + name = res.trim(); + let (res, _) = modified_name.split_once("[").expect("array to end with ["); + modified_name = res.trim(); + } + TypeKind::IncompleteArray => { + name = name + .strip_suffix("[]") + .expect("array to end with []") + .trim(); + modified_name = modified_name + .strip_suffix("[]") + .expect("array to end with []") + .trim(); + } + TypeKind::BlockPointer => { + name = get_inner_fn(name); + modified_name = get_inner_fn(modified_name); + } + TypeKind::Pointer => { + if modified_ty + .get_pointee_type() + .expect("pointer to have pointee") + .get_kind() + == TypeKind::FunctionPrototype + { + name = get_inner_fn(name); + modified_name = get_inner_fn(modified_name); + } + } + _ => {} + } + + if ty.is_const_qualified() { + if let Some(rest) = name.strip_suffix("const") { + name = rest.trim(); + } + if !modified_ty.is_const_qualified() { + // TODO: Fix this + println!("unnecessarily stripped const"); + } + } + + if inside_partial_array { + if let Some(rest) = name.strip_prefix("__unsafe_unretained") { + *lifetime = Lifetime::Unretained; + name = rest.trim(); + } + } + + if let Some(rest) = name.strip_suffix("__unsafe_unretained") { + *lifetime = Lifetime::Unretained; + name = rest.trim(); + } else if let Some(rest) = name.strip_suffix("__strong") { + *lifetime = Lifetime::Strong; + name = rest.trim(); + } else if let Some(rest) = name.strip_suffix("__weak") { + *lifetime = Lifetime::Weak; + name = rest.trim(); + } else if let Some(rest) = name.strip_suffix("__autoreleasing") { + *lifetime = Lifetime::Autoreleasing; + name = rest.trim(); + } + + if let Some(rest) = name.strip_suffix("_Nullable") { + assert_eq!( + ty.get_nullability(), + Some(Nullability::Nullable), + "nullable" + ); + *nullability = Nullability::Nullable; + name = rest.trim(); + } else if let Some(rest) = name.strip_suffix("_Nonnull") { + assert_eq!(ty.get_nullability(), Some(Nullability::NonNull), "nonnull"); + *nullability = match nullability { + Nullability::Nullable => Nullability::Nullable, + _ => Nullability::NonNull, + }; + name = rest.trim(); + } else if let Some(rest) = name.strip_suffix("_Null_unspecified") { + assert_eq!( + ty.get_nullability(), + Some(Nullability::Unspecified), + "unspecified" + ); + // Do nothing + name = rest.trim(); + } else { + assert_eq!( + ty.get_nullability(), + None, + "expected no nullability attribute on {name:?}" + ); + } + + if name != modified_name { + if let Some(rest) = name.strip_prefix("__kindof") { + name = rest.trim(); + *kindof = true; + } + + if name != modified_name { + let original_name = ty.get_display_name(); + println!("attributes: {original_name:?} -> {name:?} != {modified_name:?}"); + panic!( + "could not extract all attributes from attributed type. Inner: {ty:?}, {modified_ty:?}" + ); + } + } + + modified_ty +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +enum RustType { + // Primitives + Void, + C99Bool, + Char, + SChar, + UChar, + Short, + UShort, + Int, + UInt, + Long, + ULong, + LongLong, + ULongLong, + Float, + Double, + F32, + F64, + I8, + U8, + I16, + U16, + I32, + U32, + I64, + U64, + + // Objective-C + Id { + type_: GenericType, + is_const: bool, + lifetime: Lifetime, + nullability: Nullability, + }, + Class { + nullability: Nullability, + }, + Sel { + nullability: Nullability, + }, + ObjcBool, + + // Others + Pointer { + nullability: Nullability, + is_const: bool, + pointee: Box, + }, + IncompleteArray { + nullability: Nullability, + is_const: bool, + pointee: Box, + }, + Array { + element_type: Box, + num_elements: usize, + }, + Enum { + name: String, + }, + Struct { + name: String, + }, + Fn { + is_variadic: bool, + arguments: Vec, + result_type: Box, + }, + Block { + arguments: Vec, + result_type: Box, + }, + + TypeDef { + name: String, + }, +} + +impl RustType { + fn parse( + ty: Type<'_>, + is_consumed: bool, + mut nullability: Nullability, + inside_partial_array: bool, + ) -> Self { + use TypeKind::*; + + // println!("{:?}, {:?}", ty, ty.get_class_type()); + + let mut kindof = false; + let mut lifetime = Lifetime::Unspecified; + let ty = parse_attributed( + ty, + &mut nullability, + &mut lifetime, + &mut kindof, + inside_partial_array, + ); + + // println!("{:?}: {:?}", ty.get_kind(), ty.get_display_name()); + + match ty.get_kind() { + Void => Self::Void, + Bool => Self::C99Bool, + CharS | CharU => Self::Char, + SChar => Self::SChar, + UChar => Self::UChar, + Short => Self::Short, + UShort => Self::UShort, + Int => Self::Int, + UInt => Self::UInt, + Long => Self::Long, + ULong => Self::ULong, + LongLong => Self::LongLong, + ULongLong => Self::ULongLong, + Float => Self::Float, + Double => Self::Double, + ObjCId => Self::Id { + type_: GenericType { + name: "Object".to_string(), + generics: Vec::new(), + }, + is_const: ty.is_const_qualified(), + lifetime, + nullability, + }, + ObjCClass => Self::Class { nullability }, + ObjCSel => Self::Sel { nullability }, + Pointer => { + let is_const = ty.is_const_qualified(); + let ty = ty.get_pointee_type().expect("pointer type to have pointee"); + let pointee = Self::parse(ty, is_consumed, Nullability::Unspecified, false); + Self::Pointer { + nullability, + is_const, + pointee: Box::new(pointee), + } + } + BlockPointer => { + let is_const = ty.is_const_qualified(); + let ty = ty.get_pointee_type().expect("pointer type to have pointee"); + match Self::parse(ty, is_consumed, Nullability::Unspecified, false) { + Self::Fn { + is_variadic: false, + mut arguments, + mut result_type, + } => { + for arg in &mut arguments { + arg.set_block(); + } + result_type.set_block(); + Self::Pointer { + nullability, + is_const, + pointee: Box::new(Self::Block { + arguments, + result_type, + }), + } + } + pointee => panic!("unexpected pointee in block: {pointee:?}"), + } + } + ObjCObjectPointer => { + let ty = ty.get_pointee_type().expect("pointer type to have pointee"); + let mut kindof = false; + let ty = parse_attributed(ty, &mut nullability, &mut lifetime, &mut kindof, false); + let type_ = GenericType::parse_objc_pointer(ty); + + Self::Id { + type_, + is_const: ty.is_const_qualified(), + lifetime, + nullability, + } + } + Typedef => { + let typedef_name = ty.get_typedef_name().expect("typedef has name"); + match &*typedef_name { + "BOOL" => Self::ObjcBool, + + "int8_t" => Self::I8, + "uint8_t" => Self::U8, + "int16_t" => Self::I16, + "uint16_t" => Self::U16, + "int32_t" => Self::I32, + "uint32_t" => Self::U32, + "int64_t" => Self::I64, + "uint64_t" => Self::U64, + + // MacTypes.h + "UInt8" => Self::U8, + "UInt16" => Self::U16, + "UInt32" => Self::U32, + "UInt64" => Self::U64, + "SInt8" => Self::I8, + "SInt16" => Self::I16, + "SInt32" => Self::I32, + "SInt64" => Self::I64, + "Float32" => Self::F32, + "Float64" => Self::F64, + "Float80" => panic!("can't handle 80 bit MacOS float"), + "Float96" => panic!("can't handle 96 bit 68881 float"), + + "instancetype" => Self::Id { + type_: GenericType { + name: "Self".to_string(), + generics: Vec::new(), + }, + is_const: ty.is_const_qualified(), + lifetime, + nullability, + }, + _ => { + let ty = ty.get_canonical_type(); + match ty.get_kind() { + ObjCObjectPointer => { + let ty = + ty.get_pointee_type().expect("pointer type to have pointee"); + let type_ = GenericType::parse_objc_pointer(ty); + if !type_.generics.is_empty() { + panic!("typedef generics not empty"); + } + + Self::Id { + type_: GenericType { + name: typedef_name, + generics: Vec::new(), + }, + is_const: ty.is_const_qualified(), + lifetime, + nullability, + } + } + _ => Self::TypeDef { name: typedef_name }, + } + } + } + } + Elaborated => { + let ty = ty.get_elaborated_type().expect("elaborated"); + match ty.get_kind() { + TypeKind::Record => { + let name = ty + .get_display_name() + .trim_start_matches("struct ") + .to_string(); + Self::Struct { name } + } + TypeKind::Enum => { + let name = ty + .get_display_name() + .trim_start_matches("enum ") + .to_string(); + Self::Enum { name } + } + _ => panic!("unknown elaborated type {ty:?}"), + } + } + FunctionPrototype => { + let call_conv = ty.get_calling_convention().expect("fn calling convention"); + assert_eq!( + call_conv, + CallingConvention::Cdecl, + "fn calling convention is C" + ); + + let arguments = ty + .get_argument_types() + .expect("fn type to have argument types") + .into_iter() + .map(Ty::parse_fn_argument) + .collect(); + + let result_type = ty.get_result_type().expect("fn type to have result type"); + let result_type = Ty::parse_fn_result(result_type); + + Self::Fn { + is_variadic: ty.is_variadic(), + arguments, + result_type: Box::new(result_type), + } + } + IncompleteArray => { + let is_const = ty.is_const_qualified(); + let ty = ty + .get_element_type() + .expect("incomplete array to have element type"); + let pointee = Self::parse(ty, is_consumed, Nullability::Unspecified, true); + Self::IncompleteArray { + nullability, + is_const, + pointee: Box::new(pointee), + } + } + ConstantArray => { + let element_type = Self::parse( + ty.get_element_type().expect("array to have element type"), + is_consumed, + Nullability::Unspecified, + false, + ); + let num_elements = ty + .get_size() + .expect("constant array to have element length"); + Self::Array { + element_type: Box::new(element_type), + num_elements, + } + } + _ => { + panic!("Unsupported type: {:?}", ty) + } + } + } + + fn visit_lifetime(&self, mut f: impl FnMut(Lifetime)) { + match self { + Self::Id { lifetime, .. } => f(*lifetime), + Self::Pointer { pointee, .. } => pointee.visit_lifetime(f), + Self::IncompleteArray { pointee, .. } => pointee.visit_lifetime(f), + Self::Array { element_type, .. } => element_type.visit_lifetime(f), + _ => {} + } + } +} + +/// This is sound to output in (almost, c_void is not a valid return type) any +/// context. `Ty` is then used to change these types into something nicer when +/// requires. +impl fmt::Display for RustType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + use RustType::*; + match self { + // Primitives + Void => write!(f, "c_void"), + C99Bool => panic!("C99's bool is unsupported"), // write!(f, "bool") + Char => write!(f, "c_char"), + SChar => write!(f, "c_schar"), + UChar => write!(f, "c_uchar"), + Short => write!(f, "c_short"), + UShort => write!(f, "c_ushort"), + Int => write!(f, "c_int"), + UInt => write!(f, "c_uint"), + Long => write!(f, "c_long"), + ULong => write!(f, "c_ulong"), + LongLong => write!(f, "c_longlong"), + ULongLong => write!(f, "c_ulonglong"), + Float => write!(f, "c_float"), + Double => write!(f, "c_double"), + F32 => write!(f, "f32"), + F64 => write!(f, "f64"), + I8 => write!(f, "i8"), + U8 => write!(f, "u8"), + I16 => write!(f, "i16"), + U16 => write!(f, "u16"), + I32 => write!(f, "i32"), + U32 => write!(f, "u32"), + I64 => write!(f, "i64"), + U64 => write!(f, "u64"), + + // Objective-C + Id { + type_: ty, + is_const, + // Ignore + lifetime: _, + nullability, + } => { + if *nullability == Nullability::NonNull { + write!(f, "NonNull<{ty}>") + } else if *is_const { + write!(f, "*const {ty}") + } else { + write!(f, "*mut {ty}") + } + } + Class { nullability } => { + if *nullability == Nullability::NonNull { + write!(f, "NonNull") + } else { + write!(f, "*const Class") + } + } + Sel { nullability } => { + if *nullability == Nullability::NonNull { + write!(f, "Sel") + } else { + write!(f, "OptionSel") + } + } + ObjcBool => write!(f, "Bool"), + + // Others + Pointer { + nullability, + is_const, + pointee, + } => match &**pointee { + Self::Fn { + is_variadic, + arguments, + result_type, + } => { + if *nullability != Nullability::NonNull { + write!(f, "Option<")?; + } + write!(f, "unsafe extern \"C\" fn(")?; + for arg in arguments { + write!(f, "{arg},")?; + } + if *is_variadic { + write!(f, "...")?; + } + write!(f, "){result_type}")?; + + if *nullability != Nullability::NonNull { + write!(f, ">")?; + } + Ok(()) + } + pointee => { + if *nullability == Nullability::NonNull { + write!(f, "NonNull<{pointee}>") + } else if *is_const { + write!(f, "*const {pointee}") + } else { + write!(f, "*mut {pointee}") + } + } + }, + IncompleteArray { + nullability, + is_const, + pointee, + } => { + if *nullability == Nullability::NonNull { + write!(f, "NonNull<{pointee}>") + } else if *is_const { + write!(f, "*const {pointee}") + } else { + write!(f, "*mut {pointee}") + } + } + Array { + element_type, + num_elements, + } => write!(f, "[{element_type}; {num_elements}]"), + Enum { name } | Struct { name } | TypeDef { name } => write!(f, "{name}"), + Self::Fn { .. } => write!(f, "TodoFunction"), + Block { + arguments, + result_type, + } => { + write!(f, "Block<(")?; + for arg in arguments { + write!(f, "{arg}, ")?; + } + write!(f, "), {result_type}>") + } + } + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +enum TyKind { + InMethodReturn, + InFnDeclReturn, + InMethodReturnWithError, + InStatic, + InTypedef, + InMethodArgument, + InFnDeclArgument, + InStructEnum, + InFnArgument, + InFnReturn, + InBlockArgument, + InBlockReturn, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct Ty { + ty: RustType, + kind: TyKind, +} + +impl Ty { + pub const VOID_RESULT: Self = Self { + ty: RustType::Void, + kind: TyKind::InMethodReturn, + }; + + pub fn parse_method_argument(ty: Type<'_>, is_consumed: bool) -> Self { + let ty = RustType::parse(ty, is_consumed, Nullability::Unspecified, false); + + match &ty { + RustType::Pointer { pointee, .. } => pointee.visit_lifetime(|lifetime| { + if lifetime != Lifetime::Autoreleasing && lifetime != Lifetime::Unspecified { + panic!("unexpected lifetime {lifetime:?} in pointer argument {ty:?}"); + } + }), + RustType::IncompleteArray { pointee, .. } => pointee.visit_lifetime(|lifetime| { + if lifetime != Lifetime::Unretained && lifetime != Lifetime::Unspecified { + panic!("unexpected lifetime {lifetime:?} in incomplete array argument {ty:?}"); + } + }), + _ => ty.visit_lifetime(|lifetime| { + if lifetime != Lifetime::Strong && lifetime != Lifetime::Unspecified { + panic!("unexpected lifetime {lifetime:?} in argument {ty:?}"); + } + }), + } + + Self { + ty, + kind: TyKind::InMethodArgument, + } + } + + pub fn parse_method_return(ty: Type<'_>) -> Self { + let ty = RustType::parse(ty, false, Nullability::Unspecified, false); + + ty.visit_lifetime(|lifetime| { + if lifetime != Lifetime::Unspecified { + panic!("unexpected lifetime in return {ty:?}"); + } + }); + + Self { + ty, + kind: TyKind::InMethodReturn, + } + } + + pub fn parse_function_argument(ty: Type<'_>) -> Self { + let mut this = Self::parse_method_argument(ty, false); + this.kind = TyKind::InFnDeclArgument; + this + } + + pub fn parse_function_return(ty: Type<'_>) -> Self { + let mut this = Self::parse_method_return(ty); + this.kind = TyKind::InFnDeclReturn; + this + } + + pub fn parse_typedef(ty: Type<'_>) -> Option { + let mut ty = RustType::parse(ty, false, Nullability::Unspecified, false); + + ty.visit_lifetime(|lifetime| { + if lifetime != Lifetime::Unspecified { + panic!("unexpected lifetime in typedef {ty:?}"); + } + }); + + match &mut ty { + // Handled by Stmt::EnumDecl + RustType::Enum { .. } => None, + // Handled above and in Stmt::StructDecl + // The rest is only `NSZone` + RustType::Struct { name } => { + assert_eq!(name, "_NSZone", "invalid struct in typedef"); + None + } + // Opaque structs + RustType::Pointer { pointee, .. } if matches!(&**pointee, RustType::Struct { .. }) => { + **pointee = RustType::Void; + Some(Self { + ty, + kind: TyKind::InTypedef, + }) + } + RustType::IncompleteArray { .. } => { + unimplemented!("incomplete array in struct") + } + _ => Some(Self { + ty, + kind: TyKind::InTypedef, + }), + } + } + + pub fn parse_property(ty: Type<'_>, default_nullability: Nullability) -> Self { + let ty = RustType::parse(ty, false, default_nullability, false); + + ty.visit_lifetime(|lifetime| { + if lifetime != Lifetime::Unspecified { + panic!("unexpected lifetime in property {ty:?}"); + } + }); + + Self { + ty, + kind: TyKind::InMethodArgument, + } + } + + pub fn parse_property_return(ty: Type<'_>, default_nullability: Nullability) -> Self { + let ty = RustType::parse(ty, false, default_nullability, false); + + ty.visit_lifetime(|lifetime| { + if lifetime != Lifetime::Unspecified { + panic!("unexpected lifetime in property {ty:?}"); + } + }); + + Self { + ty, + kind: TyKind::InMethodReturn, + } + } + + pub fn parse_struct_field(ty: Type<'_>) -> Self { + let ty = RustType::parse(ty, false, Nullability::Unspecified, false); + + ty.visit_lifetime(|lifetime| { + if lifetime != Lifetime::Unspecified { + panic!("unexpected lifetime in struct field {ty:?}"); + } + }); + + Self { + ty, + kind: TyKind::InStructEnum, + } + } + + pub fn parse_enum(ty: Type<'_>) -> Self { + let ty = RustType::parse(ty, false, Nullability::Unspecified, false); + + ty.visit_lifetime(|_lifetime| { + panic!("unexpected lifetime in enum {ty:?}"); + }); + + Self { + ty, + kind: TyKind::InStructEnum, + } + } + + pub fn parse_static(ty: Type<'_>) -> Self { + let ty = RustType::parse(ty, false, Nullability::Unspecified, false); + + ty.visit_lifetime(|lifetime| { + if lifetime != Lifetime::Strong && lifetime != Lifetime::Unspecified { + panic!("unexpected lifetime in var {ty:?}"); + } + }); + + Self { + ty, + kind: TyKind::InStatic, + } + } + + fn parse_fn_argument(ty: Type<'_>) -> Self { + let ty = RustType::parse(ty, false, Nullability::Unspecified, false); + + ty.visit_lifetime(|lifetime| { + if lifetime != Lifetime::Strong { + panic!("unexpected lifetime {lifetime:?} in fn argument {ty:?}"); + } + }); + + Self { + ty, + kind: TyKind::InFnArgument, + } + } + + fn parse_fn_result(ty: Type<'_>) -> Self { + let ty = RustType::parse(ty, false, Nullability::Unspecified, false); + + ty.visit_lifetime(|lifetime| { + if lifetime != Lifetime::Unspecified { + panic!("unexpected lifetime {lifetime:?} in fn result {ty:?}"); + } + }); + + Self { + ty, + kind: TyKind::InFnReturn, + } + } + + fn set_block(&mut self) { + self.kind = match self.kind { + TyKind::InFnArgument => TyKind::InBlockArgument, + TyKind::InFnReturn => TyKind::InBlockReturn, + _ => unreachable!("set block kind"), + } + } +} + +impl Ty { + pub fn argument_is_error_out(&self) -> bool { + if let RustType::Pointer { + nullability, + is_const, + pointee, + } = &self.ty + { + if let RustType::Id { + type_: ty, + is_const: id_is_const, + lifetime, + nullability: id_nullability, + } = &**pointee + { + if ty.name != "NSError" { + return false; + } + assert_eq!( + *nullability, + Nullability::Nullable, + "invalid error nullability {self:?}" + ); + assert!(!is_const, "expected error not const {self:?}"); + + assert!( + ty.generics.is_empty(), + "expected error generics to be empty {self:?}" + ); + assert_eq!( + *id_nullability, + Nullability::Nullable, + "invalid inner error nullability {self:?}" + ); + assert!(!id_is_const, "expected inner error not const {self:?}"); + assert_eq!( + *lifetime, + Lifetime::Unspecified, + "invalid error lifetime {self:?}" + ); + return true; + } + } + false + } + + pub fn is_id(&self) -> bool { + matches!(self.ty, RustType::Id { .. }) + } + + pub fn set_is_alloc(&mut self) { + match &mut self.ty { + RustType::Id { + type_: ty, + lifetime: Lifetime::Unspecified, + is_const: false, + nullability: Nullability::NonNull, + } if ty.name == "Self" && ty.generics.is_empty() => { + ty.name = "Allocated".into(); + ty.generics = vec![GenericType { + name: "Self".into(), + generics: vec![], + }]; + } + _ => panic!("invalid alloc return type {self:?}"), + } + } + + pub fn set_is_error(&mut self) { + assert_eq!(self.kind, TyKind::InMethodReturn); + self.kind = TyKind::InMethodReturnWithError; + } + + /// Related result types + /// https://clang.llvm.org/docs/AutomaticReferenceCounting.html#related-result-types + pub fn fix_related_result_type(&mut self, is_class: bool, selector: &str) { + if let RustType::Id { type_, .. } = &mut self.ty { + if type_.name == "Object" { + assert!(type_.generics.is_empty(), "Object return generics empty"); + if (is_class && MemoryManagement::is_new(&selector)) + || (is_class && MemoryManagement::is_alloc(&selector)) + || (!is_class && MemoryManagement::is_init(&selector)) + || (!is_class && selector == "self") + { + type_.name = "Self".into(); + } + } + } + } +} + +impl fmt::Display for Ty { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match &self.kind { + TyKind::InMethodReturn => { + if let RustType::Void = &self.ty { + // Don't output anything + return Ok(()); + } + + write!(f, " -> ")?; + + match &self.ty { + RustType::Id { + type_: ty, + // Ignore + is_const: _, + // Ignore + lifetime: _, + nullability, + } => { + if *nullability == Nullability::NonNull { + write!(f, "Id<{ty}, Shared>") + } else { + write!(f, "Option>") + } + } + RustType::Class { nullability } => { + if *nullability == Nullability::NonNull { + write!(f, "&'static Class") + } else { + write!(f, "Option<&'static Class>") + } + } + RustType::ObjcBool => write!(f, "bool"), + ty => write!(f, "{ty}"), + } + } + TyKind::InMethodReturnWithError => match &self.ty { + RustType::Id { + type_: ty, + lifetime: Lifetime::Unspecified, + is_const: false, + nullability: Nullability::Nullable, + } => { + // NULL -> error + write!(f, " -> Result, Id>") + } + RustType::ObjcBool => { + // NO -> error + write!(f, " -> Result<(), Id>") + } + _ => panic!("unknown error result type {self:?}"), + }, + TyKind::InStatic => match &self.ty { + RustType::Id { + type_: ty, + is_const: false, + lifetime: Lifetime::Strong | Lifetime::Unspecified, + nullability, + } => { + if *nullability == Nullability::NonNull { + write!(f, "&'static {ty}") + } else { + write!(f, "Option<&'static {ty}>") + } + } + ty @ RustType::Id { .. } => panic!("invalid static {ty:?}"), + ty => write!(f, "{ty}"), + }, + TyKind::InTypedef => match &self.ty { + // When we encounter a typedef declaration like this: + // typedef NSString* NSAbc; + // + // We parse it as one of: + // type NSAbc = NSString; + // struct NSAbc(NSString); + // + // Instead of: + // type NSAbc = *const NSString; + // + // Because that means we can use ordinary Id elsewhere. + RustType::Id { + type_: ty, + is_const: _, + lifetime: _, + nullability, + } => { + match &*ty.name { + "NSString" => {} + "NSUnit" => {} // TODO: Handle this differently + "TodoProtocols" => {} // TODO + _ => panic!("typedef declaration was not NSString: {ty:?}"), + } + + if !ty.generics.is_empty() { + panic!("typedef declaration generics not empty"); + } + + assert_ne!(*nullability, Nullability::NonNull); + write!(f, "{ty}") + } + ty => write!(f, "{ty}"), + }, + TyKind::InMethodArgument | TyKind::InFnDeclArgument => match &self.ty { + RustType::Id { + type_: ty, + is_const: false, + lifetime: Lifetime::Unspecified | Lifetime::Strong, + nullability, + } => { + if *nullability == Nullability::NonNull { + write!(f, "&{ty}") + } else { + write!(f, "Option<&{ty}>") + } + } + RustType::Class { nullability } => { + if *nullability == Nullability::NonNull { + write!(f, "&Class") + } else { + write!(f, "Option<&Class>") + } + } + RustType::ObjcBool if self.kind == TyKind::InMethodArgument => write!(f, "bool"), + ty @ RustType::Pointer { + nullability, + is_const: false, + pointee, + } => match &**pointee { + // TODO: Re-enable once we can support it + // RustType::Id { + // type_: ty, + // is_const: false, + // lifetime: Lifetime::Autoreleasing, + // nullability: inner_nullability, + // } if self.kind == TyKind::InMethodArgument => { + // let tokens = if *inner_nullability == Nullability::NonNull { + // format!("Id<{ty}, Shared>") + // } else { + // format!("Option>") + // }; + // if *nullability == Nullability::NonNull { + // write!(f, "&mut {tokens}") + // } else { + // write!(f, "Option<&mut {tokens}>") + // } + // } + // RustType::Id { .. } => { + // unreachable!("there should be no id with other values: {self:?}") + // } + block @ RustType::Block { .. } => { + if *nullability == Nullability::NonNull { + write!(f, "&{block}") + } else { + write!(f, "Option<&{block}>") + } + } + _ => write!(f, "{ty}"), + }, + ty => write!(f, "{ty}"), + }, + TyKind::InStructEnum => write!(f, "{}", self.ty), + TyKind::InFnArgument | TyKind::InBlockArgument => write!(f, "{}", self.ty), + TyKind::InFnDeclReturn | TyKind::InFnReturn => { + if let RustType::Void = &self.ty { + // Don't output anything + return Ok(()); + } + + write!(f, " -> {}", self.ty) + } + TyKind::InBlockReturn => match &self.ty { + RustType::Void => write!(f, "()"), + ty => write!(f, "{ty}"), + }, + } + } +} diff --git a/crates/header-translator/src/stmt.rs b/crates/header-translator/src/stmt.rs new file mode 100644 index 000000000..2f0b6f3cd --- /dev/null +++ b/crates/header-translator/src/stmt.rs @@ -0,0 +1,898 @@ +use std::collections::HashSet; +use std::fmt; + +use clang::{Entity, EntityKind, EntityVisitResult}; + +use crate::availability::Availability; +use crate::config::{ClassData, Config}; +use crate::expr::Expr; +use crate::method::{handle_reserved, Method}; +use crate::property::Property; +use crate::rust_type::Ty; +use crate::unexposed_macro::UnexposedMacro; + +#[derive(Debug, Clone)] +pub enum MethodOrProperty { + Method(Method), + Property(Property), +} + +impl fmt::Display for MethodOrProperty { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Method(method) => write!(f, "{method}"), + Self::Property(property) => write!(f, "{property}"), + } + } +} + +/// Takes one of: +/// - `EntityKind::ObjCInterfaceDecl` +/// - `EntityKind::ObjCProtocolDecl` +/// - `EntityKind::ObjCCategoryDecl` +fn parse_objc_decl( + entity: &Entity<'_>, + mut superclass: Option<&mut Option>>, + mut generics: Option<&mut Vec>, + data: Option<&ClassData>, +) -> (Vec, Vec) { + let mut protocols = Vec::new(); + let mut methods = Vec::new(); + + // Track seen properties, so that when methods are autogenerated by the + // compiler from them, we can skip them + let mut properties = HashSet::new(); + + entity.visit_children(|entity, _parent| { + match entity.get_kind() { + EntityKind::ObjCExplicitProtocolImpl if generics.is_none() && superclass.is_none() => { + // TODO NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION + } + EntityKind::ObjCIvarDecl if superclass.is_some() => { + // Explicitly ignored + } + EntityKind::ObjCSuperClassRef => { + if let Some(superclass) = &mut superclass { + **superclass = Some(Some(entity.get_name().expect("superclass name"))); + } else { + panic!("unsupported superclass {entity:?}"); + } + } + EntityKind::ObjCRootClass => { + if let Some(superclass) = &mut superclass { + // TODO: Maybe just skip root classes entirely? + **superclass = Some(None); + } else { + panic!("unsupported root class {entity:?}"); + } + } + EntityKind::ObjCClassRef if generics.is_some() => { + // println!("ObjCClassRef: {:?}", entity.get_display_name()); + } + EntityKind::TemplateTypeParameter => { + if let Some(generics) = &mut generics { + // TODO: Generics with bounds (like NSMeasurement) + // let ty = entity.get_type().expect("template type"); + let name = entity.get_display_name().expect("template name"); + generics.push(name); + } else { + panic!("unsupported generics {entity:?}"); + } + } + EntityKind::ObjCProtocolRef => { + protocols.push(entity.get_name().expect("protocolref to have name")); + } + EntityKind::ObjCInstanceMethodDecl | EntityKind::ObjCClassMethodDecl => { + let partial = Method::partial(entity); + + if !properties.remove(&(partial.is_class, partial.fn_name.clone())) { + let data = data + .map(|data| { + data.methods + .get(&partial.fn_name) + .copied() + .unwrap_or_default() + }) + .unwrap_or_default(); + if let Some(method) = partial.parse(data) { + methods.push(MethodOrProperty::Method(method)); + } + } + } + EntityKind::ObjCPropertyDecl => { + let partial = Property::partial(entity); + let data = data + .map(|data| { + data.properties + .get(&partial.name) + .copied() + .unwrap_or_default() + }) + .unwrap_or_default(); + + assert!( + properties.insert((partial.is_class, partial.getter_name.clone())), + "already exisiting property" + ); + if let Some(setter_name) = partial.setter_name.clone() { + assert!( + properties.insert((partial.is_class, setter_name)), + "already exisiting property" + ); + } + if let Some(property) = partial.parse(data) { + methods.push(MethodOrProperty::Property(property)); + } + } + EntityKind::VisibilityAttr => { + // Already exposed as entity.get_visibility() + } + EntityKind::TypeRef if superclass.is_some() => { + // TODO + } + EntityKind::ObjCException if superclass.is_some() => { + // Maybe useful for knowing when to implement `Error` for the type + } + EntityKind::UnexposedAttr => { + if let Some(macro_) = UnexposedMacro::parse(&entity) { + println!("objc decl {entity:?}: {macro_:?}"); + } + } + _ => panic!("unknown objc decl child {entity:?}"), + }; + EntityVisitResult::Continue + }); + + if !properties.is_empty() { + if properties == HashSet::from([(false, "setDisplayName".to_owned())]) { + // TODO + } else { + panic!("did not properly add methods to properties:\n{methods:?}\n{properties:?}"); + } + } + + (protocols, methods) +} + +#[derive(Debug, Clone)] +pub enum Stmt { + /// @interface name: superclass + ClassDecl { + name: String, + availability: Availability, + // TODO: Generics + superclass: Option, + generics: Vec, + protocols: Vec, + methods: Vec, + }, + /// @interface class_name (name) + CategoryDecl { + class_name: String, + availability: Availability, + /// Some categories don't have a name. Example: NSClipView + name: Option, + generics: Vec, + /// I don't quite know what this means? + protocols: Vec, + methods: Vec, + }, + /// @protocol name + ProtocolDecl { + name: String, + availability: Availability, + protocols: Vec, + methods: Vec, + }, + /// struct name { + /// fields* + /// }; + /// + /// typedef struct { + /// fields* + /// } name; + /// + /// typedef struct _name { + /// fields* + /// } name; + StructDecl { + name: String, + boxable: bool, + fields: Vec<(String, Ty)>, + }, + /// typedef NS_OPTIONS(type, name) { + /// variants* + /// }; + /// + /// typedef NS_ENUM(type, name) { + /// variants* + /// }; + /// + /// enum name { + /// variants* + /// }; + /// + /// enum { + /// variants* + /// }; + EnumDecl { + name: Option, + ty: Ty, + kind: Option, + variants: Vec<(String, Expr)>, + }, + /// static const ty name = expr; + /// extern const ty name; + VarDecl { + name: String, + ty: Ty, + value: Option, + }, + /// extern ret name(args*); + /// + /// static inline ret name(args*) { + /// body + /// } + FnDecl { + name: String, + arguments: Vec<(String, Ty)>, + result_type: Ty, + // Some -> inline function. + body: Option<()>, + }, + /// typedef Type TypedefName; + AliasDecl { name: String, ty: Ty }, +} + +fn parse_struct(entity: &Entity<'_>, name: String) -> Stmt { + let mut boxable = false; + let mut fields = Vec::new(); + + entity.visit_children(|entity, _parent| { + match entity.get_kind() { + EntityKind::UnexposedAttr => { + if let Some(macro_) = UnexposedMacro::parse(&entity) { + panic!("unexpected attribute: {macro_:?}"); + } + } + EntityKind::FieldDecl => { + let name = entity.get_name().expect("struct field name"); + let ty = entity.get_type().expect("struct field type"); + let ty = Ty::parse_struct_field(ty); + + if entity.is_bit_field() { + println!("[UNSOUND] struct bitfield {name}: {entity:?}"); + } + + fields.push((name, ty)) + } + EntityKind::ObjCBoxable => { + boxable = true; + } + _ => panic!("unknown struct field {entity:?}"), + } + EntityVisitResult::Continue + }); + + Stmt::StructDecl { + name, + boxable, + fields, + } +} + +impl Stmt { + pub fn parse(entity: &Entity<'_>, config: &Config) -> Option { + match entity.get_kind() { + // These are inconsequential for us, since we resolve imports differently + EntityKind::ObjCClassRef | EntityKind::ObjCProtocolRef => None, + EntityKind::ObjCInterfaceDecl => { + // entity.get_mangled_objc_names() + let name = entity.get_name().expect("class name"); + let class_data = config.class_data.get(&name); + + if class_data.map(|data| data.skipped).unwrap_or_default() { + return None; + } + + let availability = Availability::parse( + entity + .get_platform_availability() + .expect("class availability"), + ); + // println!("Availability: {:?}", entity.get_platform_availability()); + let mut superclass = None; + let mut generics = Vec::new(); + + let (protocols, methods) = parse_objc_decl( + &entity, + Some(&mut superclass), + Some(&mut generics), + class_data, + ); + + if let Some(new_name) = + class_data.and_then(|data| data.new_superclass_name.as_ref()) + { + superclass = Some(Some(new_name.clone())); + } + + let superclass = superclass.expect("no superclass found"); + + Some(Self::ClassDecl { + name, + availability, + superclass, + generics, + protocols, + methods, + }) + } + EntityKind::ObjCCategoryDecl => { + let name = entity.get_name(); + let availability = Availability::parse( + entity + .get_platform_availability() + .expect("category availability"), + ); + + let mut class_name = None; + entity.visit_children(|entity, _parent| { + if entity.get_kind() == EntityKind::ObjCClassRef { + if class_name.is_some() { + panic!("could not find unique category class") + } + class_name = Some(entity.get_name().expect("class name")); + EntityVisitResult::Break + } else { + EntityVisitResult::Continue + } + }); + let class_name = class_name.expect("could not find category class"); + let class_data = config.class_data.get(&class_name); + + if class_data.map(|data| data.skipped).unwrap_or_default() { + return None; + } + + let mut generics = Vec::new(); + + let (protocols, methods) = + parse_objc_decl(&entity, None, Some(&mut generics), class_data); + + Some(Self::CategoryDecl { + class_name, + availability, + name, + generics, + protocols, + methods, + }) + } + EntityKind::ObjCProtocolDecl => { + let name = entity.get_name().expect("protocol name"); + let protocol_data = config.protocol_data.get(&name); + + if protocol_data.map(|data| data.skipped).unwrap_or_default() { + return None; + } + + let availability = Availability::parse( + entity + .get_platform_availability() + .expect("protocol availability"), + ); + + let (protocols, methods) = parse_objc_decl(&entity, None, None, protocol_data); + + Some(Self::ProtocolDecl { + name, + availability, + protocols, + methods, + }) + } + EntityKind::TypedefDecl => { + let name = entity.get_name().expect("typedef name"); + let mut struct_ = None; + let mut skip_struct = false; + + entity.visit_children(|entity, _parent| { + match entity.get_kind() { + // TODO: Parse NS_TYPED_EXTENSIBLE_ENUM vs. NS_TYPED_ENUM + EntityKind::UnexposedAttr => { + if let Some(macro_) = UnexposedMacro::parse(&entity) { + panic!("unexpected attribute: {macro_:?}"); + } + } + EntityKind::StructDecl => { + if config + .struct_data + .get(&name) + .map(|data| data.skipped) + .unwrap_or_default() + { + skip_struct = true; + return EntityVisitResult::Continue; + } + + let struct_name = entity.get_name(); + if struct_name + .map(|name| name.starts_with('_')) + .unwrap_or(true) + { + // If this struct doesn't have a name, or the + // name is private, let's parse it with the + // typedef name. + struct_ = Some(parse_struct(&entity, name.clone())) + } else { + skip_struct = true; + } + } + EntityKind::ObjCClassRef + | EntityKind::ObjCProtocolRef + | EntityKind::TypeRef + | EntityKind::ParmDecl => {} + _ => panic!("unknown typedef child in {name}: {entity:?}"), + }; + EntityVisitResult::Continue + }); + + if let Some(struct_) = struct_ { + return Some(struct_); + } + + if skip_struct { + return None; + } + + if config + .typedef_data + .get(&name) + .map(|data| data.skipped) + .unwrap_or_default() + { + return None; + } + + let ty = entity + .get_typedef_underlying_type() + .expect("typedef underlying type"); + Ty::parse_typedef(ty).map(|ty| Self::AliasDecl { name, ty }) + } + EntityKind::StructDecl => { + if let Some(name) = entity.get_name() { + if config + .struct_data + .get(&name) + .map(|data| data.skipped) + .unwrap_or_default() + { + return None; + } + if !name.starts_with('_') { + return Some(parse_struct(entity, name)); + } + } + None + } + EntityKind::EnumDecl => { + // Enum declarations show up twice for some reason, but + // luckily this flag is set on the least descriptive entity. + if !entity.is_definition() { + return None; + } + + let name = entity.get_name(); + + let data = config + .enum_data + .get(name.as_deref().unwrap_or("anonymous")) + .cloned() + .unwrap_or_default(); + if data.skipped { + return None; + } + + let ty = entity.get_enum_underlying_type().expect("enum type"); + let is_signed = ty.is_signed_integer(); + let ty = Ty::parse_enum(ty); + let mut kind = None; + let mut variants = Vec::new(); + + entity.visit_children(|entity, _parent| { + match entity.get_kind() { + EntityKind::EnumConstantDecl => { + let name = entity.get_name().expect("enum constant name"); + + if data + .constants + .get(&name) + .map(|data| data.skipped) + .unwrap_or_default() + { + return EntityVisitResult::Continue; + } + + let val = Expr::from_val( + entity + .get_enum_constant_value() + .expect("enum constant value"), + is_signed, + ); + let expr = if data.use_value { + val + } else { + Expr::parse_enum_constant(&entity).unwrap_or(val) + }; + variants.push((name, expr)); + } + EntityKind::UnexposedAttr => { + if let Some(macro_) = UnexposedMacro::parse(&entity) { + if let Some(kind) = &kind { + assert_eq!( + kind, ¯o_, + "got differing enum kinds in {name:?}" + ); + } else { + kind = Some(macro_); + } + } + } + EntityKind::FlagEnum => { + let macro_ = UnexposedMacro::Options; + if let Some(kind) = &kind { + assert_eq!(kind, ¯o_, "got differing enum kinds in {name:?}"); + } else { + kind = Some(macro_); + } + } + _ => { + panic!("unknown enum child {entity:?} in {name:?}"); + } + } + EntityVisitResult::Continue + }); + + Some(Self::EnumDecl { + name, + ty, + kind, + variants, + }) + } + EntityKind::VarDecl => { + let name = entity.get_name().expect("var decl name"); + + if config + .statics + .get(&name) + .map(|data| data.skipped) + .unwrap_or_default() + { + return None; + } + + let ty = entity.get_type().expect("var type"); + let ty = Ty::parse_static(ty); + let mut value = None; + + entity.visit_children(|entity, _parent| { + match entity.get_kind() { + EntityKind::UnexposedAttr => { + if let Some(macro_) = UnexposedMacro::parse(&entity) { + panic!("unexpected attribute: {macro_:?}"); + } + } + EntityKind::VisibilityAttr => {} + EntityKind::ObjCClassRef => {} + EntityKind::TypeRef => {} + _ if entity.is_expression() => { + if value.is_none() { + value = Some(Expr::parse_var(&entity)); + } else { + panic!("got variable value twice") + } + } + _ => panic!("unknown vardecl child in {name}: {entity:?}"), + }; + EntityVisitResult::Continue + }); + + let value = match value { + Some(Some(expr)) => Some(expr), + Some(None) => { + println!("skipped static {name}"); + return None; + } + None => None, + }; + + Some(Self::VarDecl { name, ty, value }) + } + EntityKind::FunctionDecl => { + let name = entity.get_name().expect("function name"); + + if config + .fns + .get(&name) + .map(|data| data.skipped) + .unwrap_or_default() + { + return None; + } + + if entity.is_variadic() { + println!("can't handle variadic function {name}"); + return None; + } + + let result_type = entity.get_result_type().expect("function result type"); + let result_type = Ty::parse_function_return(result_type); + let mut arguments = Vec::new(); + + assert!( + !entity.is_static_method(), + "unexpected static method {name}" + ); + + entity.visit_children(|entity, _parent| { + match entity.get_kind() { + EntityKind::UnexposedAttr => { + if let Some(macro_) = UnexposedMacro::parse(&entity) { + panic!("unexpected function attribute: {macro_:?}"); + } + } + EntityKind::ObjCClassRef | EntityKind::TypeRef => {} + EntityKind::ParmDecl => { + // Could also be retrieved via. `get_arguments` + let name = entity.get_name().unwrap_or_else(|| "_".into()); + let ty = entity.get_type().expect("function argument type"); + let ty = Ty::parse_function_argument(ty); + arguments.push((name, ty)) + } + _ => panic!("unknown function child in {name}: {entity:?}"), + }; + EntityVisitResult::Continue + }); + + let body = if entity.is_inline_function() { + Some(()) + } else { + None + }; + + Some(Self::FnDecl { + name, + arguments, + result_type, + body, + }) + } + EntityKind::UnionDecl => { + // println!( + // "union: {:?}, {:?}, {:#?}, {:#?}", + // entity.get_display_name(), + // entity.get_name(), + // entity.has_attributes(), + // entity.get_children(), + // ); + None + } + _ => { + panic!("Unknown: {:?}", entity) + } + } + } +} + +impl fmt::Display for Stmt { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::ClassDecl { + name, + availability: _, + superclass, + generics, + protocols: _, + methods, + } => { + let struct_generic = if generics.is_empty() { + name.clone() + } else { + format!( + "{name}<{}: Message = Object>", + generics.join(": Message = Object,") + ) + }; + + let generic_params = if generics.is_empty() { + String::new() + } else { + format!("<{}: Message>", generics.join(": Message,")) + }; + + let ty = if generics.is_empty() { + name.clone() + } else { + format!("{name}<{}>", generics.join(",")) + }; + + let superclass_name = superclass.as_deref().unwrap_or("Object"); + + // TODO: Use ty.get_objc_protocol_declarations() + + let macro_name = if generics.is_empty() { + "extern_class" + } else { + "__inner_extern_class" + }; + + writeln!(f, "{macro_name}!(")?; + writeln!(f, " #[derive(Debug)]")?; + write!(f, " pub struct {struct_generic}")?; + if generics.is_empty() { + writeln!(f, ";")?; + } else { + writeln!(f, " {{")?; + for (i, generic) in generics.iter().enumerate() { + // Invariant over the generic (for now) + writeln!(f, "_inner{i}: PhantomData<*mut {generic}>,")?; + } + writeln!(f, "}}")?; + } + writeln!(f, "")?; + writeln!(f, " unsafe impl{generic_params} ClassType for {ty} {{")?; + writeln!(f, " type Super = {superclass_name};")?; + writeln!(f, " }}")?; + writeln!(f, ");")?; + writeln!(f, "")?; + writeln!(f, "extern_methods!(")?; + writeln!(f, " unsafe impl{generic_params} {ty} {{")?; + for method in methods { + writeln!(f, "{method}")?; + } + writeln!(f, " }}")?; + writeln!(f, ");")?; + } + Self::CategoryDecl { + class_name, + availability: _, + name, + generics, + protocols: _, + methods, + } => { + let generic_params = if generics.is_empty() { + String::new() + } else { + format!("<{}: Message>", generics.join(": Message,")) + }; + + let ty = if generics.is_empty() { + class_name.clone() + } else { + format!("{class_name}<{}>", generics.join(",")) + }; + + writeln!(f, "extern_methods!(")?; + if let Some(name) = name { + writeln!(f, " /// {name}")?; + } + writeln!(f, " unsafe impl{generic_params} {ty} {{")?; + for method in methods { + writeln!(f, "{method}")?; + } + writeln!(f, " }}")?; + writeln!(f, ");")?; + } + Self::ProtocolDecl { + name, + availability: _, + protocols: _, + methods, + } => { + writeln!(f, "extern_protocol!(")?; + writeln!(f, " pub struct {name};")?; + writeln!(f, "")?; + writeln!(f, " unsafe impl {name} {{")?; + for method in methods { + writeln!(f, "{method}")?; + } + writeln!(f, " }}")?; + writeln!(f, ");")?; + } + Self::StructDecl { + name, + boxable: _, + fields, + } => { + writeln!(f, "extern_struct!(")?; + writeln!(f, " pub struct {name} {{")?; + for (name, ty) in fields { + write!(f, " ")?; + if !name.starts_with('_') { + write!(f, "pub ")?; + } + writeln!(f, "{name}: {ty},")?; + } + writeln!(f, " }}")?; + writeln!(f, ");")?; + } + Self::EnumDecl { + name, + ty, + kind, + variants, + } => { + let macro_name = match kind { + None => "extern_enum", + Some(UnexposedMacro::Enum) => "ns_enum", + Some(UnexposedMacro::Options) => "ns_options", + Some(UnexposedMacro::ClosedEnum) => "ns_closed_enum", + Some(UnexposedMacro::ErrorEnum) => "ns_error_enum", + }; + writeln!(f, "{}!(", macro_name)?; + writeln!(f, " #[underlying({ty})]")?; + write!(f, " pub enum ",)?; + if let Some(name) = name { + write!(f, "{name} ")?; + } + writeln!(f, "{{")?; + for (name, expr) in variants { + writeln!(f, " {name} = {expr},")?; + } + writeln!(f, " }}")?; + writeln!(f, ");")?; + } + Self::VarDecl { + name, + ty, + value: None, + } => { + writeln!(f, "extern_static!({name}: {ty});")?; + } + Self::VarDecl { + name, + ty, + value: Some(expr), + } => { + writeln!(f, "extern_static!({name}: {ty} = {expr});")?; + } + Self::FnDecl { + name, + arguments, + result_type, + body: None, + } => { + writeln!(f, "extern_fn!(")?; + write!(f, " pub unsafe fn {name}(")?; + for (param, arg_ty) in arguments { + write!(f, "{}: {arg_ty},", handle_reserved(¶m))?; + } + writeln!(f, "){result_type};")?; + writeln!(f, ");")?; + } + Self::FnDecl { + name, + arguments, + result_type, + body: Some(_body), + } => { + writeln!(f, "inline_fn!(")?; + write!(f, " pub unsafe fn {name}(")?; + for (param, arg_ty) in arguments { + write!(f, "{}: {arg_ty},", handle_reserved(¶m))?; + } + writeln!(f, "){result_type} {{")?; + writeln!(f, " todo!()")?; + writeln!(f, " }}")?; + writeln!(f, ");")?; + } + Self::AliasDecl { name, ty } => { + writeln!(f, "pub type {name} = {ty};")?; + } + }; + Ok(()) + } +} diff --git a/crates/header-translator/src/unexposed_macro.rs b/crates/header-translator/src/unexposed_macro.rs new file mode 100644 index 000000000..54aabfbee --- /dev/null +++ b/crates/header-translator/src/unexposed_macro.rs @@ -0,0 +1,56 @@ +use clang::{Entity, EntityKind}; + +/// Parts of `EntityKind::UnexposedAttr` that we can easily parse. +#[derive(Clone, Debug, PartialEq, Eq, Hash)] +pub enum UnexposedMacro { + Enum, + Options, + ClosedEnum, + ErrorEnum, +} + +impl UnexposedMacro { + fn from_name(s: &str) -> Option { + match s { + "NS_ENUM" => Some(Self::Enum), + "NS_OPTIONS" => Some(Self::Options), + "NS_CLOSED_ENUM" => Some(Self::ClosedEnum), + "NS_ERROR_ENUM" => Some(Self::ErrorEnum), + // TODO + "NS_FORMAT_FUNCTION" => None, + "NS_FORMAT_ARGUMENT" => None, + // Uninteresting, their data is already exposed elsewhere + "API_AVAILABLE" + | "API_UNAVAILABLE" + | "API_DEPRECATED" + | "API_DEPRECATED_WITH_REPLACEMENT" + | "NS_SWIFT_UNAVAILABLE" + | "NS_SWIFT_NAME" + | "NS_CLASS_AVAILABLE_MAC" + | "NS_AVAILABLE" + | "NS_OPENGL_DEPRECATED" + | "NS_OPENGL_CLASS_DEPRECATED" + | "NS_OPENGL_ENUM_DEPRECATED" => None, + name => panic!("unknown unexposed macro name {name}"), + } + } + + pub fn parse(entity: &Entity<'_>) -> Option { + let location = entity.get_location().expect("unexposed attr location"); + if let Some(parsed) = location.get_entity() { + match parsed.get_kind() { + EntityKind::MacroExpansion => { + let macro_name = parsed.get_name().expect("macro name"); + Self::from_name(¯o_name) + } + // Some macros can't be found using this method, + // for example NS_NOESCAPE. + _ => None, + } + } else { + // File-global macros like APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST + // are not findable with this approach + None + } + } +} diff --git a/crates/icrate/Cargo.toml b/crates/icrate/Cargo.toml new file mode 100644 index 000000000..28b8726ac --- /dev/null +++ b/crates/icrate/Cargo.toml @@ -0,0 +1,359 @@ +[package] +name = "icrate" +version = "0.0.1" +authors = ["Mads Marquart "] +edition = "2021" + +description = "Bindings to Apple's frameworks" +keywords = ["macos", "ios", "cocoa", "apple", "framework"] +categories = [ + "accessibility", + "api-bindings", + "development-tools::ffi", + "external-ffi-bindings", + "os::macos-apis", +] +readme = "README.md" +repository = "https://github.com/madsmtm/objc2" +documentation = "https://docs.rs/icrate/" +license = "MIT" + +[dependencies] +# This does not support GNUStep or other runtimes +objc2 = { path = "../objc2", version = "=0.3.0-beta.3", default-features = false, optional = true, features = ["apple"] } +block2 = { path = "../block2", version = "=0.2.0-alpha.6", default-features = false, optional = true } + +[package.metadata.docs.rs] +default-target = "x86_64-apple-darwin" +all-features = true + +targets = [ + # MacOS + "x86_64-apple-darwin", + "aarch64-apple-darwin", + # "i686-apple-darwin", + # iOS + "aarch64-apple-ios", + "x86_64-apple-ios", + # "armv7-apple-ios", + # "i386-apple-ios", + # GNUStep + "x86_64-unknown-linux-gnu", + "i686-unknown-linux-gnu", + # Windows + "x86_64-pc-windows-msvc", +] + +[features] +default = ["std"] + +# Currently not possible to turn off, put here for forwards compatibility. +std = ["alloc", "objc2?/std"] +alloc = ["objc2?/alloc"] + +# Expose features that requires Objective-C. +objective-c = ["objc2"] + +# Expose features that requires creating blocks. +blocks = ["objc2?/block", "block2"] + +# For better documentation on docs.rs +unstable-docsrs = [] + +# Frameworks +# Based on: +# - https://developer.apple.com/documentation/technologies +# - https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemFrameworks/SystemFrameworks.html +# - https://github.com/youknowone/apple-sys + +# Accelerate = [] +# Accessibility = [] +# Accounts = [] +# AddressBook = [] # + AddressBookUI.h +# AdServices = [] +# AdSupport = [] +# AGL = [] +# AppClip = [] +# AppIntents = [] +# AppTrackingTransparency = [] +AppKit = ["Foundation", "CoreData"] +# AppleScriptKit = [] +# AppleScriptObjC = [] +# ApplicationServices = [] +# AppTrackingTransparency = [] +# ARKit = [] +# AssetsLibrary = [] # iOS +# AudioToolbox = [] +# AudioUnit = [] +# AudioDriverKit = [] +# AudioVideoBridging = [] +AuthenticationServices = ["Foundation"] +# AutomaticAssessmentConfiguration = [] +# Automator = [] +# AVFAudio = [] +# AVFoundation = [] +# AVKit = [] +# BackgroundTasks = [] +# BusinessChat = [] +# CalendarStore = [] +# CallKit = [] +# Carbon = [] +# CareKit = [] +# CarPlay = [] # iOS +# CFNetwork = [] +# CHIP = [] +# ClassKit = [] +# ClockKit = [] +# CloudKit = [] +# Cocoa = [] +# Collaboration = [] +# ColorSync = [] +# Combine = [] +# Compression = [] +# Contacts = [] +# ContactsUI = [] +# CoreAudio = [] +# CoreAudioKit = [] +# CoreAudioTypes = [] +# CoreBluetooth = [] +CoreData = ["Foundation"] +# CoreFoundation = [] +# CoreGraphics = [] +# CoreHaptics = [] +# CoreImage = [] +# CoreLocation = [] +# CoreLocationUI = [] +# CoreMedia = [] +# CoreMediaIO = [] +# CoreMIDI = [] +# CoreML = [] +# CoreMotion = [] +# CoreNFC = [] +# CoreServices = [] +# CoreSpotlight = [] +# CoreTelephony = [] +# CoreText = [] +# CoreTransferable = [] +# CoreVideo = [] +# CoreWLAN = [] +# CreateML = [] +# CreateMLComponents = [] +# CryptoTokenKit = [] +# DataDetection = [] +# DeveloperToolsSupport = [] +# DeviceActivity = [] +# DeviceManagement = [] +# DeviceCheck = [] +# DeviceDiscoveryExtension = [] +# DeviceDiscoveryUI = [] +# DirectoryService = [] +# DiscRecording = [] +# DiscRecordingUI = [] +# DiskArbitration = [] +# dispatch = [] +# Distributed = [] +# dnssd = [] +# DocC = [] +# DriverKit = [] +# DVDPlayback = [] +# Endpoint Security = [] +# EventKit = [] +# EventKitUI = [] +# ExceptionHandling = [] +# ExecutionPolicy = [] +# ExposureNotification = [] +# ExtensionFoundation = [] +# ExtensionKit = [] +# ExternalAccessory = [] +# Family Controls = [] +# FileProvider = [] +# FileProviderUI = [] +# FinderSync = [] +# ForceFeedback = [] +Foundation = ["objective-c", "blocks", "objc2/foundation"] +# FWAUserLib = [] +# GameController = [] +# GameKit = [] +# GameplayKit = [] +# GLKit = [] +# GLUT = [] +# GroupActivities = [] +# GSS = [] +# HealthKit = [] +# HIDDriverKit = [] +# HomeKit = [] +# HTTP Live Streaming = [] +# Hypervisor = [] +# iAd = [] +# ICADevices = [] +# IdentityLookup = [] +# ImageCaptureCore = [] +# ImageIO = [] +# IMServicePlugIn = [] +# InputMethodKit = [] +# InstallerJS = [] +# InstallerPlugins = [] +# InstantMessage = [] +# Intents = [] +# IntentsUI = [] +# IOBluetooth = [] +# IOBluetoothUI = [] +# IOKit = [] +# IOSurface = [] +# IOUSBHost = [] +# iTunesLibrary = [] +# JavaNativeFoundation = [] +# JavaRuntimeSupport = [] +# JavaScriptCore = [] +# Kerberos = [] +# Kernel = [] +# KernelManagement = [] +# LatentSemanticMapping = [] +# LDAP = [] +# LinkPresentation = [] +# LivePhotosKit JS = [] +# LocalAuthentication = [] +# LocalAuthenticationEmbeddedUI = [] +# MailKit = [] +# ManagedSettings = [] +# ManagedSettingsUI = [] +# MapKit = [] +# Maps Web Snapshots = [] +# MediaAccessibility = [] +# MediaLibrary = [] +# MediaPlayer = [] +# MediaSetup = [] +# MediaToolbox = [] +# Message UI = [] +# Messages = [] +# Metal = [] +# MetalPerformanceShaders = [] +# MetalPerformanceShadersGraph = [] +# MetalFX = [] +# MetalKit = [] +# MetricKit = [] +# MLCompute = [] +# ModelIO = [] +# MultipeerConnectivity = [] +# MusicKit = [] +# NaturalLanguage = [] +# NearbyInteraction = [] +# NetFS = [] +# Network = [] +# NetworkExtension = [] +# NetworkingDriverKit = [] +# NewsstandKit = [] +# NotificationCenter = [] +# OpenAL = [] +# OpenCL = [] +# OpenDirectory = [] +# OpenGL = [] # ES? +# os = [] +# OSAKit = [] +# OSLog = [] +# PackageDescription = [] +# ParavirtualizedGraphics = [] +# PassKit = [] +# PCIDriverKit = [] +# PCSC = [] +# PDFKit = [] +# PencilKit = [] +# PHASE = [] +# PhotoKit = [] +# Photos = [] +# PhotosUI = [] +# Playground Bluetooth = [] +# Playground Support = [] +# PreferencePanes = [] +# Professional Video Applications = [] +# ProximityReader = [] +# Push to Talk = [] +# PushKit = [] +# Quartz = [] +# QuartzCore = [] # Core Animation +# QuickLook = [] +# QuickLookThumbnailing = [] +# QuickLookUI = [] +# RealityKit = [] +# RegexBuilder = [] +# ReplayKit = [] +# RoomPlan = [] +# Roster API = [] +# Safari app extensions = [] +# SafariServices = [] +# SafetyKit = [] +# SceneKit = [] +# ScreenCaptureKit = [] +# ScreenSaver = [] +# ScreenTime = [] +# ScriptingBridge = [] +# SCSIControllerDriverKit = [] +# SCSIPeripheralsDriverKit = [] +# Security = [] +# SecurityFoundation = [] +# SecurityInterface = [] +# SensorKit = [] +# SerialDriverKit = [] +# ServiceManagement = [] +# Shared with You = [] +# ShazamKit = [] +# Sign in with Apple = [] +# simd = [] +# Siri Event Suggestions Markup = [] +# SiriKit = [] +# SiriKit Cloud Media = [] +# SMS and Call Reporting = [] +# Social = [] +# SoundAnalysis = [] +# Spatial = [] +# Speech = [] +# SpriteKit = [] +# StoreKit = [] +# StoreKit Test = [] +# Swift = [] +# Swift Charts = [] +# Swift Packages = [] +# Swift Playgrounds = [] +# SwiftUI = [] +# System = [] +# SyncServices = [] +# SystemConfiguration = [] +# SystemExtensions = [] +# Tabular Data = [] +# Tcl = [] +# Technotes = [] +# Thread Network = [] +# TV Services = [] +# TVML = [] +# TVMLKit = [] +# TVMLKit JS = [] +# TVUIKit = [] +# TWAIN = [] +# UIKit = [] +# UniformTypeIdentifiers = [] +# USBDriverKit = [] +# USBSerialDriverKit = [] +# UserNotifications = [] +# UserNotificationsUI = [] +# VideoDecodeAcceleration = [] +# VideoSubscriberAccount = [] +# VideoToolbox = [] +# Virtualization = [] +# Vision = [] +# VisionKit = [] +# vmnet = [] +# Wallet Orders = [] +# Wallet Passes = [] +# Watch Connectivity = [] +# WatchKit = [] +# watchOS Apps = [] +# WeatherKit = [] +# WeatherKit REST API = [] +# WebKit = [] +# WidgetKit = [] +# Xcode = [] +# Xcode Cloud = [] +# XcodeKit = [] +# xcselect = [] +# XCTest = [] +# XPC = [] diff --git a/crates/icrate/README.md b/crates/icrate/README.md new file mode 100644 index 000000000..3b5632360 --- /dev/null +++ b/crates/icrate/README.md @@ -0,0 +1,19 @@ +# `icrate` + +[![Latest version](https://badgen.net/crates/v/icrate)](https://crates.io/crates/icrate) +[![License](https://badgen.net/badge/license/MIT/blue)](../LICENSE.txt) +[![Documentation](https://docs.rs/icrate/badge.svg)](https://docs.rs/icrate/) +[![CI](https://github.com/madsmtm/objc2/actions/workflows/ci.yml/badge.svg)](https://github.com/madsmtm/objc2/actions/workflows/ci.yml) + +Rust bindings to Apple's frameworks. + +These are automatically generated from the SDKs in Xcode 14.0.1 (will be periodically updated). + +Currently supports: +- macOS: `7.0-12.3` +- iOS/iPadOS: `7.0-16.0` (WIP) +- tvOS: `9.0-16.0` (WIP) +- watchOS: `1.0-9.0` (WIP) + +This crate is part of the [`objc2` project](https://github.com/madsmtm/objc2), +see that for related crates. diff --git a/crates/icrate/src/AppKit/mod.rs b/crates/icrate/src/AppKit/mod.rs new file mode 100644 index 000000000..c5593d688 --- /dev/null +++ b/crates/icrate/src/AppKit/mod.rs @@ -0,0 +1,5 @@ +#[allow(unused_imports)] +#[path = "../generated/AppKit/mod.rs"] +mod generated; + +pub use self::generated::*; diff --git a/crates/icrate/src/AppKit/translation-config.toml b/crates/icrate/src/AppKit/translation-config.toml new file mode 100644 index 000000000..d457a9139 --- /dev/null +++ b/crates/icrate/src/AppKit/translation-config.toml @@ -0,0 +1,177 @@ +imports = ["AppKit", "CoreData", "Foundation"] + +# These return `oneway void`, which is a bit tricky to handle. +[class.NSPasteboard.methods.releaseGlobally] +skipped = true +[class.NSView.methods.releaseGState] +skipped = true + +# Works weirdly since it's defined both as a property, and as a method. +[class.NSDocument.methods.setDisplayName] +skipped = true + +# Typedef that uses a generic from a class +[typedef.NSCollectionViewDiffableDataSourceItemProvider] +skipped = true +[class.NSCollectionViewDiffableDataSource.methods.initWithCollectionView_itemProvider] +skipped = true + +# Both protocols and classes +[protocol.NSTextAttachmentCell] +skipped = true +[protocol.NSAccessibilityElement] +skipped = true + +# Both instance and class methods +[class.NSCursor.methods.pop] +skipped = true +[class.NSDrawer.methods.open] +skipped = true +[class.NSDrawer.methods.close] +skipped = true +[class.NSEvent.properties.modifierFlags] +skipped = true +[class.NSFormCell.methods.titleWidth] +skipped = true +[class.NSGestureRecognizer.properties.state] +skipped = true +[class.NSGraphicsContext.methods.saveGraphicsState] +skipped = true +[class.NSGraphicsContext.methods.restoreGraphicsState] +skipped = true +[class.NSSlider.properties.vertical] +skipped = true +[class.NSSliderCell.methods.drawKnob] +skipped = true +[class.NSSliderCell.properties.vertical] +skipped = true +[class.NSWorkspace.methods.noteFileSystemChanged] +skipped = true +[class.NSBundle.methods.loadNibFile_externalNameTable_withZone] +skipped = true + +# Uses stuff from different frameworks / system libraries +[class.NSAnimationContext.properties.timingFunction] +skipped = true +[class.NSBezierPath.methods.appendBezierPathWithCGGlyph_inFont] +skipped = true +[class.NSBezierPath.methods.appendBezierPathWithCGGlyphs_count_inFont] +skipped = true +[class.NSBitmapImageRep.methods.initWithCGImage] +skipped = true +[class.NSBitmapImageRep.methods.initWithCIImage] +skipped = true +[class.NSBitmapImageRep.properties.CGImage] +skipped = true +[class.NSColor.properties.CGColor] +skipped = true +[class.NSColor.methods.colorWithCGColor] +skipped = true +[class.NSColor.methods.colorWithCIColor] +skipped = true +[class.NSColorSpace.methods.initWithCGColorSpace] +skipped = true +[class.NSColorSpace.properties.CGColorSpace] +skipped = true +[class.NSCIImageRep] +skipped = true +[class.NSEvent.properties.CGEvent] +skipped = true +[class.NSEvent.methods.eventWithCGEvent] +skipped = true +[class.NSFont.methods] +boundingRectForCGGlyph = { skipped = true } +advancementForCGGlyph = { skipped = true } +getBoundingRects_forCGGlyphs_count = { skipped = true } +getAdvancements_forCGGlyphs_count = { skipped = true } +[class.NSGlyphInfo.methods.glyphInfoWithCGGlyph_forFont_baseString] +skipped = true +[class.NSGlyphInfo.properties.glyphID] +skipped = true +[class.NSGraphicsContext.methods.graphicsContextWithCGContext_flipped] +skipped = true +[class.NSGraphicsContext.properties.CGContext] +skipped = true +[class.NSGraphicsContext.properties.CIContext] +skipped = true +[class.NSImage.methods] +initWithCGImage_size = { skipped = true } +CGImageForProposedRect_context_hints = { skipped = true } +initWithIconRef = { skipped = true } +[class.NSImageRep.methods.CGImageForProposedRect_context_hints] +skipped = true +[class.NSItemProvider.methods.registerCloudKitShareWithPreparationHandler] +skipped = true +[class.NSItemProvider.methods.registerCloudKitShare_container] +skipped = true +[class.NSLayoutManager.methods] +setGlyphs_properties_characterIndexes_font_forGlyphRange = { skipped = true } +CGGlyphAtIndex_isValidIndex = { skipped = true } +CGGlyphAtIndex = { skipped = true } +getGlyphsInRange_glyphs_properties_characterIndexes_bidiLevels = { skipped = true } +glyphIndexForPoint_inTextContainer_fractionOfDistanceThroughGlyph = { skipped = true } +showCGGlyphs_positions_count_font_textMatrix_attributes_inContext = { skipped = true } +showCGGlyphs_positions_count_font_matrix_attributes_inContext = { skipped = true } +[class.NSLayoutManagerDelegate.methods.layoutManager_shouldGenerateGlyphs_properties_characterIndexes_font_forGlyphRange] +skipped = true +[class.NSMovie.methods.initWithMovie] +skipped = true +[class.NSMovie.methods.QTMovie] +skipped = true +[class.NSOpenGLContext] +skipped = true +[class.NSOpenGLLayer] +skipped = true +[class.NSOpenGLPixelFormat] +skipped = true +[class.NSOpenGLPixelBuffer] +skipped = true +[class.NSOpenGLView] +skipped = true +[fn.NSOpenGLSetOption] +skipped = true +[fn.NSOpenGLGetOption] +skipped = true +[fn.NSOpenGLGetVersion] +skipped = true +[class.NSTextLayoutFragment.methods.drawAtPoint_inContext] +skipped = true +[class.NSTextLineFragment.methods.drawAtPoint_inContext] +skipped = true +[class.NSTextView.methods.quickLookPreviewableItemsInRanges] +skipped = true +[class.NSRunningApplication.properties.processIdentifier] +skipped = true +[class.NSRunningApplication.methods.runningApplicationWithProcessIdentifier] +skipped = true +[class.NSSavePanel.properties.allowedContentTypes] +skipped = true +[class.NSView.properties] +layer = { skipped = true } +backgroundFilters = { skipped = true } +compositingFilter = { skipped = true } +contentFilters = { skipped = true } +[class.NSView.methods] +makeBackingLayer = { skipped = true } +[class.NSObject.methods] +layer_shouldInheritContentsScale_fromWindow = { skipped = true } +[class.NSWorkspace.methods] +iconForContentType = { skipped = true } +URLForApplicationToOpenContentType = { skipped = true } +URLsForApplicationsToOpenContentType = { skipped = true } +setDefaultApplicationAtURL_toOpenContentType_completionHandler = { skipped = true } +[class.NSWorkspaceOpenConfiguration.properties.architecture] +skipped = true + +# Wrong type for enum +[enum.anonymous.constants] +NSOKButton = { skipped = true } +NSCancelButton = { skipped = true } +NSFileHandlingPanelCancelButton = { skipped = true } +NSFileHandlingPanelOKButton = { skipped = true } + +# Categories for classes defined in other frameworks +[class.CIImage] +skipped = true +[class.CIColor] +skipped = true diff --git a/crates/icrate/src/AuthenticationServices/fixes/mod.rs b/crates/icrate/src/AuthenticationServices/fixes/mod.rs new file mode 100644 index 000000000..a7a41b048 --- /dev/null +++ b/crates/icrate/src/AuthenticationServices/fixes/mod.rs @@ -0,0 +1,11 @@ +use crate::Foundation::NSObject; + +// TODO: UIViewController on iOS, NSViewController on macOS +pub type ASViewController = NSObject; +// TODO: UIWindow on iOS, NSWindow on macOS +pub type ASPresentationAnchor = NSObject; +// TODO: UIImage on iOS, NSImage on macOS +pub type ASImage = NSObject; + +// TODO: UIControl on iOS, NSControl on macOS +pub(crate) type ASControl = NSObject; diff --git a/crates/icrate/src/AuthenticationServices/mod.rs b/crates/icrate/src/AuthenticationServices/mod.rs new file mode 100644 index 000000000..3267474c3 --- /dev/null +++ b/crates/icrate/src/AuthenticationServices/mod.rs @@ -0,0 +1,7 @@ +mod fixes; +#[allow(unused_imports)] +#[path = "../generated/AuthenticationServices/mod.rs"] +mod generated; + +pub use self::fixes::*; +pub use self::generated::*; diff --git a/crates/icrate/src/AuthenticationServices/translation-config.toml b/crates/icrate/src/AuthenticationServices/translation-config.toml new file mode 100644 index 000000000..0aa61f27f --- /dev/null +++ b/crates/icrate/src/AuthenticationServices/translation-config.toml @@ -0,0 +1,20 @@ +imports = ["AuthenticationServices", "Foundation"] + +# Uses a bit of complex feature testing setup, see ASFoundation.h +[typedef.ASPresentationAnchor] +skipped = true +[typedef.ASViewController] +skipped = true +[typedef.ASImage] +skipped = true + +# It is a bit difficult to extract the original typedef name from the +# superclass name, so let's just overwrite it here. +[class.ASCredentialProviderViewController] +superclass-name = "ASViewController" +[class.ASAccountAuthenticationModificationViewController] +superclass-name = "ASViewController" + +# Specifies UIControl or NSControl conditionally +[class.ASAuthorizationAppleIDButton] +superclass-name = "ASControl" diff --git a/crates/icrate/src/CoreData/mod.rs b/crates/icrate/src/CoreData/mod.rs new file mode 100644 index 000000000..fff32a503 --- /dev/null +++ b/crates/icrate/src/CoreData/mod.rs @@ -0,0 +1,5 @@ +#[allow(unused_imports)] +#[path = "../generated/CoreData/mod.rs"] +mod generated; + +pub use self::generated::*; diff --git a/crates/icrate/src/CoreData/translation-config.toml b/crates/icrate/src/CoreData/translation-config.toml new file mode 100644 index 000000000..72e235c2d --- /dev/null +++ b/crates/icrate/src/CoreData/translation-config.toml @@ -0,0 +1,34 @@ +imports = ["CoreData", "Foundation"] + +# Has `error:` parameter, but returns NSInteger (where 0 means error) +[class.NSManagedObjectContext.methods] +countForFetchRequest_error = { skipped = true } + +# Defined in multiple files +[static.NSErrorMergePolicy] +skipped = true +[static.NSMergeByPropertyObjectTrumpMergePolicy] +skipped = true +[static.NSMergeByPropertyStoreTrumpMergePolicy] +skipped = true +[static.NSOverwriteMergePolicy] +skipped = true +[static.NSRollbackMergePolicy] +skipped = true + +# Both instance and class methods +[class.NSManagedObject.methods.entity] +skipped = true + +# References classes from other frameworks +[class.NSCoreDataCoreSpotlightDelegate.methods] +attributeSetForObject = { skipped = true } +searchableIndex_reindexAllSearchableItemsWithAcknowledgementHandler = { skipped = true } +searchableIndex_reindexSearchableItemsWithIdentifiers_acknowledgementHandler = { skipped = true } +[class.NSPersistentCloudKitContainer.methods] +recordForManagedObjectID = { skipped = true } +recordsForManagedObjectIDs = { skipped = true } +recordIDForManagedObjectID = { skipped = true } +recordIDsForManagedObjectIDs = { skipped = true } +[class.NSPersistentCloudKitContainerOptions.properties.databaseScope] +skipped = true diff --git a/crates/icrate/src/Foundation/fixes/NSDecimal.rs b/crates/icrate/src/Foundation/fixes/NSDecimal.rs new file mode 100644 index 000000000..17b9b3f73 --- /dev/null +++ b/crates/icrate/src/Foundation/fixes/NSDecimal.rs @@ -0,0 +1,13 @@ +use std::ffi::c_ushort; + +extern_struct!( + pub struct NSDecimal { + // signed int _exponent:8; + // unsigned int _length:4; + // unsigned int _isNegative:1; + // unsigned int _isCompact:1; + // unsigned int _reserved:18; + _inner: i32, + _mantissa: [c_ushort; 8], + } +); diff --git a/crates/icrate/src/Foundation/fixes/NSObject.rs b/crates/icrate/src/Foundation/fixes/NSObject.rs new file mode 100644 index 000000000..b94792f3b --- /dev/null +++ b/crates/icrate/src/Foundation/fixes/NSObject.rs @@ -0,0 +1,47 @@ +objc2::__inner_extern_class! { + @__inner + pub struct (NSObject) {} + + unsafe impl () for NSObject { + INHERITS = [objc2::runtime::Object]; + } +} + +unsafe impl objc2::ClassType for NSObject { + type Super = objc2::runtime::Object; + const NAME: &'static str = "NSObject"; + + #[inline] + fn class() -> &'static objc2::runtime::Class { + objc2::class!(NSObject) + } + + fn as_super(&self) -> &Self::Super { + &self.__inner + } + + fn as_super_mut(&mut self) -> &mut Self::Super { + &mut self.__inner + } +} + +impl PartialEq for NSObject { + fn eq(&self, _other: &Self) -> bool { + todo!() + } +} + +impl Eq for NSObject {} + +impl std::hash::Hash for NSObject { + #[inline] + fn hash(&self, _state: &mut H) { + todo!() + } +} + +impl std::fmt::Debug for NSObject { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + todo!() + } +} diff --git a/crates/icrate/src/Foundation/fixes/NSProxy.rs b/crates/icrate/src/Foundation/fixes/NSProxy.rs new file mode 100644 index 000000000..7d3fd6803 --- /dev/null +++ b/crates/icrate/src/Foundation/fixes/NSProxy.rs @@ -0,0 +1,53 @@ +use core::fmt; +use core::hash; + +use objc2::runtime::{Class, Object}; +use objc2::{ClassType, __inner_extern_class}; + +__inner_extern_class! { + @__inner + pub struct (NSProxy) {} + + unsafe impl () for NSProxy { + INHERITS = [Object]; + } +} + +unsafe impl ClassType for NSProxy { + type Super = Object; + const NAME: &'static str = "NSProxy"; + + #[inline] + fn class() -> &'static Class { + objc2::class!(NSProxy) + } + + fn as_super(&self) -> &Self::Super { + &self.__inner + } + + fn as_super_mut(&mut self) -> &mut Self::Super { + &mut self.__inner + } +} + +impl PartialEq for NSProxy { + fn eq(&self, _other: &Self) -> bool { + todo!() + } +} + +impl Eq for NSProxy {} + +impl hash::Hash for NSProxy { + #[inline] + fn hash(&self, _state: &mut H) { + todo!() + } +} + +impl fmt::Debug for NSProxy { + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { + todo!() + } +} diff --git a/crates/icrate/src/Foundation/fixes/mod.rs b/crates/icrate/src/Foundation/fixes/mod.rs new file mode 100644 index 000000000..6b58210b0 --- /dev/null +++ b/crates/icrate/src/Foundation/fixes/mod.rs @@ -0,0 +1,7 @@ +mod NSDecimal; +mod NSObject; +mod NSProxy; + +pub use self::NSDecimal::*; +pub use self::NSObject::*; +pub use self::NSProxy::*; diff --git a/crates/icrate/src/Foundation/mod.rs b/crates/icrate/src/Foundation/mod.rs new file mode 100644 index 000000000..9a2499284 --- /dev/null +++ b/crates/icrate/src/Foundation/mod.rs @@ -0,0 +1,11 @@ +mod fixes; +#[allow(unused_imports)] +#[path = "../generated/Foundation/mod.rs"] +mod generated; + +pub use objc2::ffi::NSIntegerMax; +pub use objc2::foundation::{CGFloat, CGPoint, CGRect, CGSize, NSZone}; +pub use objc2::ns_string; + +pub use self::fixes::*; +pub use self::generated::*; diff --git a/crates/icrate/src/Foundation/translation-config.toml b/crates/icrate/src/Foundation/translation-config.toml new file mode 100644 index 000000000..2fad301d7 --- /dev/null +++ b/crates/icrate/src/Foundation/translation-config.toml @@ -0,0 +1,213 @@ +imports = ["Foundation"] + +[class.NSObject.methods] +# Uses NS_REPLACES_RECEIVER +awakeAfterUsingCoder = { skipped = true } + +[protocol.NSKeyedUnarchiverDelegate.methods] +# Uses NS_RELEASES_ARGUMENT and NS_RETURNS_RETAINED +unarchiver_didDecodeObject = { skipped = true } + +[class.NSString.methods] +new = { unsafe = false } +# Assuming that (non-)nullability is properly set +stringByAppendingString = { unsafe = false } +stringByAppendingPathComponent = { unsafe = false } +# Assuming `NSStringEncoding` can be made safe +lengthOfBytesUsingEncoding = { unsafe = false } + +[class.NSString.properties] +length = { unsafe = false } +# Safe to call, but the returned pointer may not be safe to use +UTF8String = { unsafe = false } + +[class.NSMutableString.methods] +new = { unsafe = false } +initWithString = { unsafe = false } +# "appendString:" = { unsafe = false, mutable = true } +# "setString:" = { unsafe = false, mutable = true } + +[class.NSBlockOperation.properties] +# Uses `NSArray`, which is difficult to handle +executionBlocks = { skipped = true } + +# These use `Class`, which is unsupported +[class.NSItemProvider.methods] +registerObjectOfClass_visibility_loadHandler = { skipped = true } +canLoadObjectOfClass = { skipped = true } +loadObjectOfClass_completionHandler = { skipped = true } + +# These use `SomeObject * __strong *`, which is unsupported +[class.NSNetService.methods] +getInputStream_outputStream = { skipped = true } +[class.NSPropertyListSerialization.methods] +dataFromPropertyList_format_errorDescription = { skipped = true } +propertyListFromData_mutabilityOption_format_errorDescription = { skipped = true } + +# Has `error:` parameter, but returns NSInteger (where 0 means error) +[class.NSJSONSerialization.methods.writeJSONObject_toStream_options_error] +skipped = true +[class.NSPropertyListSerialization.methods.writePropertyList_toStream_format_options_error] +skipped = true + +# Not supported on clang 11.0.0 +[class.NSBundle.methods.localizedAttributedStringForKey_value_table] +skipped = true + +# Both instance and class methods +[class.NSUnarchiver.methods.decodeClassName_asClassName] +skipped = true +[class.NSUnarchiver.methods.classNameDecodedForArchiveClassName] +skipped = true +[class.NSAutoreleasePool.methods.addObject] +skipped = true +[class.NSBundle.methods.pathForResource_ofType_inDirectory] +skipped = true +[class.NSBundle.methods.pathsForResourcesOfType_inDirectory] +skipped = true +[class.NSKeyedArchiver.methods.setClassName_forClass] +skipped = true +[class.NSKeyedArchiver.methods.classNameForClass] +skipped = true +[class.NSKeyedUnarchiver.methods.setClass_forClassName] +skipped = true +[class.NSKeyedUnarchiver.methods.classForClassName] +skipped = true +[class.NSThread.properties.threadPriority] +skipped = true +[class.NSThread.properties.isMainThread] +skipped = true +[class.NSDate.properties.timeIntervalSinceReferenceDate] +skipped = true + +# Root class +[class.NSProxy] +skipped = true + +# Contains bitfields +[struct.NSDecimal] +skipped = true + +# Uses stuff from core Darwin libraries which we have not yet mapped +[class.NSAppleEventDescriptor.methods] +descriptorWithDescriptorType_bytes_length = { skipped = true } +descriptorWithDescriptorType_data = { skipped = true } +appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID = { skipped = true } +descriptorWithProcessIdentifier = { skipped = true } +initWithAEDescNoCopy = { skipped = true } +initWithDescriptorType_bytes_length = { skipped = true } +initWithDescriptorType_data = { skipped = true } +initWithEventClass_eventID_targetDescriptor_returnID_transactionID = { skipped = true } +setParamDescriptor_forKeyword = { skipped = true } +paramDescriptorForKeyword = { skipped = true } +removeParamDescriptorWithKeyword = { skipped = true } +setAttributeDescriptor_forKeyword = { skipped = true } +attributeDescriptorForKeyword = { skipped = true } +sendEventWithOptions_timeout_error = { skipped = true } +setDescriptor_forKeyword = { skipped = true } +descriptorForKeyword = { skipped = true } +removeDescriptorWithKeyword = { skipped = true } +keywordForDescriptorAtIndex = { skipped = true } +coerceToDescriptorType = { skipped = true } +[class.NSAppleEventDescriptor.properties] +aeDesc = { skipped = true } +descriptorType = { skipped = true } +eventClass = { skipped = true } +eventID = { skipped = true } +returnID = { skipped = true } +transactionID = { skipped = true } +[class.NSAppleEventManager.methods] +setEventHandler_andSelector_forEventClass_andEventID = { skipped = true } +removeEventHandlerForEventClass_andEventID = { skipped = true } +dispatchRawAppleEvent_withRawReply_handlerRefCon = { skipped = true } +[class.NSOperationQueue.properties.underlyingQueue] +skipped = true +[class.NSRunLoop.methods.getCFRunLoop] +skipped = true +[class.NSURLCredential.methods] +initWithIdentity_certificates_persistence = { skipped = true } +credentialWithIdentity_certificates_persistence = { skipped = true } +initWithTrust = { skipped = true } +credentialForTrust = { skipped = true } +[class.NSURLCredential.properties.identity] +skipped = true +[class.NSURLProtectionSpace.properties.serverTrust] +skipped = true +[class.NSURLSessionConfiguration.properties] +TLSMinimumSupportedProtocol = { skipped = true } +TLSMaximumSupportedProtocol = { skipped = true } +TLSMinimumSupportedProtocolVersion = { skipped = true } +TLSMaximumSupportedProtocolVersion = { skipped = true } +[class.NSUUID.methods] +initWithUUIDBytes = { skipped = true } +getUUIDBytes = { skipped = true } +[class.NSXPCConnection.properties] +auditSessionIdentifier = { skipped = true } +processIdentifier = { skipped = true } +effectiveUserIdentifier = { skipped = true } +effectiveGroupIdentifier = { skipped = true } +[class.NSXPCInterface.methods] +setXPCType_forSelector_argumentIndex_ofReply = { skipped = true } +XPCTypeForSelector_argumentIndex_ofReply = { skipped = true } +[class.NSXPCCoder.methods] +encodeXPCObject_forKey = { skipped = true } +decodeXPCObjectOfType_forKey = { skipped = true } + +# Uses constants from CoreFoundation or similar frameworks +[enum.NSAppleEventSendOptions] +use-value = true +[enum.NSCalendarUnit] +use-value = true +[enum.NSDateFormatterStyle] +use-value = true +[enum.NSRectEdge] +use-value = true +[enum.NSISO8601DateFormatOptions] +use-value = true +[enum.NSLocaleLanguageDirection] +use-value = true +[enum.NSNumberFormatterStyle] +use-value = true +[enum.NSNumberFormatterPadPosition] +use-value = true +[enum.NSNumberFormatterRoundingMode] +use-value = true +[enum.NSPropertyListMutabilityOptions] +use-value = true +[enum.NSPropertyListFormat] +use-value = true +[enum.anonymous.constants.NS_UnknownByteOrder] +skipped = true +[enum.anonymous.constants.NS_LittleEndian] +skipped = true +[enum.anonymous.constants.NS_BigEndian] +skipped = true + +# Uses va_list +[class.NSAttributedString.methods.initWithFormat_options_locale_arguments] +skipped = true +[class.NSException.methods.raise_format_arguments] +skipped = true +[class.NSExpression.methods.expressionWithFormat_arguments] +skipped = true +[class.NSPredicate.methods.predicateWithFormat_arguments] +skipped = true +[class.NSString.methods.initWithFormat_arguments] +skipped = true +[class.NSString.methods.initWithFormat_locale_arguments] +skipped = true +[fn.NSLogv] +skipped = true + +# Wrong type compared to value +[enum.anonymous.constants.NSWrapCalendarComponents] +skipped = true + +# Uses NSImage, which is only available in AppKit +[class.NSUserNotification.properties.contentImage] +skipped = true + +# Has the wrong generic parameter +[class.NSDictionary.methods] +initWithContentsOfURL_error = { skipped = true } +dictionaryWithContentsOfURL_error = { skipped = true } diff --git a/crates/icrate/src/generated/AppKit/AppKitDefines.rs b/crates/icrate/src/generated/AppKit/AppKitDefines.rs new file mode 100644 index 000000000..661a20881 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/AppKitDefines.rs @@ -0,0 +1,6 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; diff --git a/crates/icrate/src/generated/AppKit/AppKitErrors.rs b/crates/icrate/src/generated/AppKit/AppKitErrors.rs new file mode 100644 index 000000000..047a12cfc --- /dev/null +++ b/crates/icrate/src/generated/AppKit/AppKitErrors.rs @@ -0,0 +1,33 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSTextReadInapplicableDocumentTypeError = 65806, + NSTextWriteInapplicableDocumentTypeError = 66062, + NSTextReadWriteErrorMinimum = 65792, + NSTextReadWriteErrorMaximum = 66303, + NSFontAssetDownloadError = 66304, + NSFontErrorMinimum = 66304, + NSFontErrorMaximum = 66335, + NSServiceApplicationNotFoundError = 66560, + NSServiceApplicationLaunchFailedError = 66561, + NSServiceRequestTimedOutError = 66562, + NSServiceInvalidPasteboardDataError = 66563, + NSServiceMalformedServiceDictionaryError = 66564, + NSServiceMiscellaneousError = 66800, + NSServiceErrorMinimum = 66560, + NSServiceErrorMaximum = 66817, + NSSharingServiceNotConfiguredError = 67072, + NSSharingServiceErrorMinimum = 67072, + NSSharingServiceErrorMaximum = 67327, + NSWorkspaceAuthorizationInvalidError = 67328, + NSWorkspaceErrorMinimum = 67328, + NSWorkspaceErrorMaximum = 67455, + } +); diff --git a/crates/icrate/src/generated/AppKit/NSATSTypesetter.rs b/crates/icrate/src/generated/AppKit/NSATSTypesetter.rs new file mode 100644 index 000000000..0d8cd8178 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSATSTypesetter.rs @@ -0,0 +1,201 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSATSTypesetter; + + unsafe impl ClassType for NSATSTypesetter { + type Super = NSTypesetter; + } +); + +extern_methods!( + unsafe impl NSATSTypesetter { + #[method_id(@__retain_semantics Other sharedTypesetter)] + pub unsafe fn sharedTypesetter() -> Id; + } +); + +extern_methods!( + /// NSPantherCompatibility + unsafe impl NSATSTypesetter { + #[method(lineFragmentRectForProposedRect:remainingRect:)] + pub unsafe fn lineFragmentRectForProposedRect_remainingRect( + &self, + proposedRect: NSRect, + remainingRect: NSRectPointer, + ) -> NSRect; + } +); + +extern_methods!( + /// NSPrimitiveInterface + unsafe impl NSATSTypesetter { + #[method(usesFontLeading)] + pub unsafe fn usesFontLeading(&self) -> bool; + + #[method(setUsesFontLeading:)] + pub unsafe fn setUsesFontLeading(&self, usesFontLeading: bool); + + #[method(typesetterBehavior)] + pub unsafe fn typesetterBehavior(&self) -> NSTypesetterBehavior; + + #[method(setTypesetterBehavior:)] + pub unsafe fn setTypesetterBehavior(&self, typesetterBehavior: NSTypesetterBehavior); + + #[method(hyphenationFactor)] + pub unsafe fn hyphenationFactor(&self) -> c_float; + + #[method(setHyphenationFactor:)] + pub unsafe fn setHyphenationFactor(&self, hyphenationFactor: c_float); + + #[method(lineFragmentPadding)] + pub unsafe fn lineFragmentPadding(&self) -> CGFloat; + + #[method(setLineFragmentPadding:)] + pub unsafe fn setLineFragmentPadding(&self, lineFragmentPadding: CGFloat); + + #[method_id(@__retain_semantics Other substituteFontForFont:)] + pub unsafe fn substituteFontForFont(&self, originalFont: &NSFont) -> Id; + + #[method_id(@__retain_semantics Other textTabForGlyphLocation:writingDirection:maxLocation:)] + pub unsafe fn textTabForGlyphLocation_writingDirection_maxLocation( + &self, + glyphLocation: CGFloat, + direction: NSWritingDirection, + maxLocation: CGFloat, + ) -> Option>; + + #[method(bidiProcessingEnabled)] + pub unsafe fn bidiProcessingEnabled(&self) -> bool; + + #[method(setBidiProcessingEnabled:)] + pub unsafe fn setBidiProcessingEnabled(&self, bidiProcessingEnabled: bool); + + #[method_id(@__retain_semantics Other attributedString)] + pub unsafe fn attributedString(&self) -> Option>; + + #[method(setAttributedString:)] + pub unsafe fn setAttributedString(&self, attributedString: Option<&NSAttributedString>); + + #[method(setParagraphGlyphRange:separatorGlyphRange:)] + pub unsafe fn setParagraphGlyphRange_separatorGlyphRange( + &self, + paragraphRange: NSRange, + paragraphSeparatorRange: NSRange, + ); + + #[method(paragraphGlyphRange)] + pub unsafe fn paragraphGlyphRange(&self) -> NSRange; + + #[method(paragraphSeparatorGlyphRange)] + pub unsafe fn paragraphSeparatorGlyphRange(&self) -> NSRange; + + #[method(layoutParagraphAtPoint:)] + pub unsafe fn layoutParagraphAtPoint( + &self, + lineFragmentOrigin: NonNull, + ) -> NSUInteger; + + #[method(lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:)] + pub unsafe fn lineSpacingAfterGlyphAtIndex_withProposedLineFragmentRect( + &self, + glyphIndex: NSUInteger, + rect: NSRect, + ) -> CGFloat; + + #[method(paragraphSpacingBeforeGlyphAtIndex:withProposedLineFragmentRect:)] + pub unsafe fn paragraphSpacingBeforeGlyphAtIndex_withProposedLineFragmentRect( + &self, + glyphIndex: NSUInteger, + rect: NSRect, + ) -> CGFloat; + + #[method(paragraphSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:)] + pub unsafe fn paragraphSpacingAfterGlyphAtIndex_withProposedLineFragmentRect( + &self, + glyphIndex: NSUInteger, + rect: NSRect, + ) -> CGFloat; + + #[method_id(@__retain_semantics Other layoutManager)] + pub unsafe fn layoutManager(&self) -> Option>; + + #[method_id(@__retain_semantics Other currentTextContainer)] + pub unsafe fn currentTextContainer(&self) -> Option>; + + #[method(setHardInvalidation:forGlyphRange:)] + pub unsafe fn setHardInvalidation_forGlyphRange(&self, flag: bool, glyphRange: NSRange); + + #[method(getLineFragmentRect:usedRect:forParagraphSeparatorGlyphRange:atProposedOrigin:)] + pub unsafe fn getLineFragmentRect_usedRect_forParagraphSeparatorGlyphRange_atProposedOrigin( + &self, + lineFragmentRect: NonNull, + lineFragmentUsedRect: NonNull, + paragraphSeparatorGlyphRange: NSRange, + lineOrigin: NSPoint, + ); + } +); + +extern_methods!( + /// NSLayoutPhaseInterface + unsafe impl NSATSTypesetter { + #[method(willSetLineFragmentRect:forGlyphRange:usedRect:baselineOffset:)] + pub unsafe fn willSetLineFragmentRect_forGlyphRange_usedRect_baselineOffset( + &self, + lineRect: NonNull, + glyphRange: NSRange, + usedRect: NonNull, + baselineOffset: NonNull, + ); + + #[method(shouldBreakLineByWordBeforeCharacterAtIndex:)] + pub unsafe fn shouldBreakLineByWordBeforeCharacterAtIndex( + &self, + charIndex: NSUInteger, + ) -> bool; + + #[method(shouldBreakLineByHyphenatingBeforeCharacterAtIndex:)] + pub unsafe fn shouldBreakLineByHyphenatingBeforeCharacterAtIndex( + &self, + charIndex: NSUInteger, + ) -> bool; + + #[method(hyphenationFactorForGlyphAtIndex:)] + pub unsafe fn hyphenationFactorForGlyphAtIndex(&self, glyphIndex: NSUInteger) -> c_float; + + #[method(hyphenCharacterForGlyphAtIndex:)] + pub unsafe fn hyphenCharacterForGlyphAtIndex(&self, glyphIndex: NSUInteger) -> UTF32Char; + + #[method(boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex:)] + pub unsafe fn boundingBoxForControlGlyphAtIndex_forTextContainer_proposedLineFragment_glyphPosition_characterIndex( + &self, + glyphIndex: NSUInteger, + textContainer: &NSTextContainer, + proposedRect: NSRect, + glyphPosition: NSPoint, + charIndex: NSUInteger, + ) -> NSRect; + } +); + +extern_methods!( + /// NSGlyphStorageInterface + unsafe impl NSATSTypesetter { + #[method(getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:)] + pub unsafe fn getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits( + &self, + glyphsRange: NSRange, + glyphBuffer: *mut NSGlyph, + charIndexBuffer: *mut NSUInteger, + inscribeBuffer: *mut NSGlyphInscription, + elasticBuffer: *mut Bool, + ) -> NSUInteger; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSAccessibility.rs b/crates/icrate/src/generated/AppKit/NSAccessibility.rs new file mode 100644 index 000000000..29ae23754 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAccessibility.rs @@ -0,0 +1,199 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_methods!( + /// NSAccessibility + unsafe impl NSObject { + #[method_id(@__retain_semantics Other accessibilityAttributeNames)] + pub unsafe fn accessibilityAttributeNames( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other accessibilityAttributeValue:)] + pub unsafe fn accessibilityAttributeValue( + &self, + attribute: &NSAccessibilityAttributeName, + ) -> Option>; + + #[method(accessibilityIsAttributeSettable:)] + pub unsafe fn accessibilityIsAttributeSettable( + &self, + attribute: &NSAccessibilityAttributeName, + ) -> bool; + + #[method(accessibilitySetValue:forAttribute:)] + pub unsafe fn accessibilitySetValue_forAttribute( + &self, + value: Option<&Object>, + attribute: &NSAccessibilityAttributeName, + ); + + #[method_id(@__retain_semantics Other accessibilityParameterizedAttributeNames)] + pub unsafe fn accessibilityParameterizedAttributeNames( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other accessibilityAttributeValue:forParameter:)] + pub unsafe fn accessibilityAttributeValue_forParameter( + &self, + attribute: &NSAccessibilityParameterizedAttributeName, + parameter: Option<&Object>, + ) -> Option>; + + #[method_id(@__retain_semantics Other accessibilityActionNames)] + pub unsafe fn accessibilityActionNames( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other accessibilityActionDescription:)] + pub unsafe fn accessibilityActionDescription( + &self, + action: &NSAccessibilityActionName, + ) -> Option>; + + #[method(accessibilityPerformAction:)] + pub unsafe fn accessibilityPerformAction(&self, action: &NSAccessibilityActionName); + + #[method(accessibilityIsIgnored)] + pub unsafe fn accessibilityIsIgnored(&self) -> bool; + + #[method_id(@__retain_semantics Other accessibilityHitTest:)] + pub unsafe fn accessibilityHitTest(&self, point: NSPoint) -> Option>; + + #[method_id(@__retain_semantics Other accessibilityFocusedUIElement)] + pub unsafe fn accessibilityFocusedUIElement(&self) -> Option>; + + #[method(accessibilityIndexOfChild:)] + pub unsafe fn accessibilityIndexOfChild(&self, child: &Object) -> NSUInteger; + + #[method(accessibilityArrayAttributeCount:)] + pub unsafe fn accessibilityArrayAttributeCount( + &self, + attribute: &NSAccessibilityAttributeName, + ) -> NSUInteger; + + #[method_id(@__retain_semantics Other accessibilityArrayAttributeValues:index:maxCount:)] + pub unsafe fn accessibilityArrayAttributeValues_index_maxCount( + &self, + attribute: &NSAccessibilityAttributeName, + index: NSUInteger, + maxCount: NSUInteger, + ) -> Id; + + #[method(accessibilityNotifiesWhenDestroyed)] + pub unsafe fn accessibilityNotifiesWhenDestroyed(&self) -> bool; + } +); + +extern_methods!( + /// NSWorkspaceAccessibilityDisplay + unsafe impl NSWorkspace { + #[method(accessibilityDisplayShouldIncreaseContrast)] + pub unsafe fn accessibilityDisplayShouldIncreaseContrast(&self) -> bool; + + #[method(accessibilityDisplayShouldDifferentiateWithoutColor)] + pub unsafe fn accessibilityDisplayShouldDifferentiateWithoutColor(&self) -> bool; + + #[method(accessibilityDisplayShouldReduceTransparency)] + pub unsafe fn accessibilityDisplayShouldReduceTransparency(&self) -> bool; + + #[method(accessibilityDisplayShouldReduceMotion)] + pub unsafe fn accessibilityDisplayShouldReduceMotion(&self) -> bool; + + #[method(accessibilityDisplayShouldInvertColors)] + pub unsafe fn accessibilityDisplayShouldInvertColors(&self) -> bool; + } +); + +extern_methods!( + /// NSWorkspaceAccessibility + unsafe impl NSWorkspace { + #[method(isVoiceOverEnabled)] + pub unsafe fn isVoiceOverEnabled(&self) -> bool; + + #[method(isSwitchControlEnabled)] + pub unsafe fn isSwitchControlEnabled(&self) -> bool; + } +); + +extern_static!( + NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification: &'static NSNotificationName +); + +extern_methods!( + /// NSAccessibilityAdditions + unsafe impl NSObject { + #[method(accessibilitySetOverrideValue:forAttribute:)] + pub unsafe fn accessibilitySetOverrideValue_forAttribute( + &self, + value: Option<&Object>, + attribute: &NSAccessibilityAttributeName, + ) -> bool; + } +); + +extern_fn!( + pub unsafe fn NSAccessibilityFrameInView(parentView: &NSView, frame: NSRect) -> NSRect; +); + +extern_fn!( + pub unsafe fn NSAccessibilityPointInView(parentView: &NSView, point: NSPoint) -> NSPoint; +); + +extern_fn!( + pub unsafe fn NSAccessibilitySetMayContainProtectedContent(flag: Bool) -> Bool; +); + +extern_fn!( + pub unsafe fn NSAccessibilityRoleDescription( + role: &NSAccessibilityRole, + subrole: Option<&NSAccessibilitySubrole>, + ) -> *mut NSString; +); + +extern_fn!( + pub unsafe fn NSAccessibilityRoleDescriptionForUIElement(element: &Object) -> *mut NSString; +); + +extern_fn!( + pub unsafe fn NSAccessibilityActionDescription( + action: &NSAccessibilityActionName, + ) -> *mut NSString; +); + +extern_fn!( + pub unsafe fn NSAccessibilityRaiseBadArgumentException( + element: Option<&Object>, + attribute: Option<&NSAccessibilityAttributeName>, + value: Option<&Object>, + ); +); + +extern_fn!( + pub unsafe fn NSAccessibilityUnignoredAncestor(element: &Object) -> *mut Object; +); + +extern_fn!( + pub unsafe fn NSAccessibilityUnignoredDescendant(element: &Object) -> *mut Object; +); + +extern_fn!( + pub unsafe fn NSAccessibilityUnignoredChildren(originalChildren: &NSArray) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSAccessibilityUnignoredChildrenForOnlyChild( + originalChild: &Object, + ) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSAccessibilityPostNotification( + element: &Object, + notification: &NSAccessibilityNotificationName, + ); +); diff --git a/crates/icrate/src/generated/AppKit/NSAccessibilityConstants.rs b/crates/icrate/src/generated/AppKit/NSAccessibilityConstants.rs new file mode 100644 index 000000000..8cee6be9e --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAccessibilityConstants.rs @@ -0,0 +1,857 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSAccessibilityErrorCodeExceptionInfo: &'static NSString); + +pub type NSAccessibilityAttributeName = NSString; + +extern_static!(NSAccessibilityRoleAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityRoleDescriptionAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySubroleAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityHelpAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityValueAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityMinValueAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityMaxValueAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityEnabledAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityFocusedAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityParentAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityChildrenAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityWindowAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityTopLevelUIElementAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySelectedChildrenAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityVisibleChildrenAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityPositionAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySizeAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityContentsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityTitleAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityDescriptionAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityShownMenuAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityValueDescriptionAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySharedFocusElementsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityPreviousContentsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityNextContentsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityHeaderAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityEditedAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityTabsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityHorizontalScrollBarAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityVerticalScrollBarAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityOverflowButtonAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityIncrementButtonAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityDecrementButtonAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityFilenameAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityExpandedAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySelectedAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySplittersAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityDocumentAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityActivationPointAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityURLAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityIndexAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityRowCountAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityColumnCountAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityOrderedByRowAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityWarningValueAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityCriticalValueAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityPlaceholderValueAttribute: &'static NSAccessibilityAttributeName); + +extern_static!( + NSAccessibilityContainsProtectedContentAttribute: &'static NSAccessibilityAttributeName +); + +extern_static!(NSAccessibilityAlternateUIVisibleAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityRequiredAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityTitleUIElementAttribute: &'static NSAccessibilityAttributeName); + +extern_static!( + NSAccessibilityServesAsTitleForUIElementsAttribute: &'static NSAccessibilityAttributeName +); + +extern_static!(NSAccessibilityLinkedUIElementsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySelectedTextAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySelectedTextRangeAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityNumberOfCharactersAttribute: &'static NSAccessibilityAttributeName); + +extern_static!( + NSAccessibilityVisibleCharacterRangeAttribute: &'static NSAccessibilityAttributeName +); + +extern_static!(NSAccessibilitySharedTextUIElementsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySharedCharacterRangeAttribute: &'static NSAccessibilityAttributeName); + +extern_static!( + NSAccessibilityInsertionPointLineNumberAttribute: &'static NSAccessibilityAttributeName +); + +extern_static!(NSAccessibilitySelectedTextRangesAttribute: &'static NSAccessibilityAttributeName); + +pub type NSAccessibilityParameterizedAttributeName = NSString; + +extern_static!( + NSAccessibilityLineForIndexParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!( + NSAccessibilityRangeForLineParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!( + NSAccessibilityStringForRangeParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!( + NSAccessibilityRangeForPositionParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!( + NSAccessibilityRangeForIndexParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!( + NSAccessibilityBoundsForRangeParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!( + NSAccessibilityRTFForRangeParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!( + NSAccessibilityStyleRangeForIndexParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!( + NSAccessibilityAttributedStringForRangeParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!(NSAccessibilityFontTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityForegroundColorTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityBackgroundColorTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityUnderlineColorTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityStrikethroughColorTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityUnderlineTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilitySuperscriptTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityStrikethroughTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityShadowTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityAttachmentTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityLinkTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityAutocorrectedTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityTextAlignmentAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityListItemPrefixTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityListItemIndexTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityListItemLevelTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityMisspelledTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityMarkedMisspelledTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityLanguageTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityCustomTextAttribute: &'static NSAttributedStringKey); + +extern_static!(NSAccessibilityAnnotationTextAttribute: &'static NSAttributedStringKey); + +pub type NSAccessibilityAnnotationAttributeKey = NSString; + +extern_static!(NSAccessibilityAnnotationLabel: &'static NSAccessibilityAnnotationAttributeKey); + +extern_static!(NSAccessibilityAnnotationElement: &'static NSAccessibilityAnnotationAttributeKey); + +extern_static!(NSAccessibilityAnnotationLocation: &'static NSAccessibilityAnnotationAttributeKey); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSAccessibilityAnnotationPosition { + NSAccessibilityAnnotationPositionFullRange = 0, + NSAccessibilityAnnotationPositionStart = 1, + NSAccessibilityAnnotationPositionEnd = 2, + } +); + +pub type NSAccessibilityFontAttributeKey = NSString; + +extern_static!(NSAccessibilityFontNameKey: &'static NSAccessibilityFontAttributeKey); + +extern_static!(NSAccessibilityFontFamilyKey: &'static NSAccessibilityFontAttributeKey); + +extern_static!(NSAccessibilityVisibleNameKey: &'static NSAccessibilityFontAttributeKey); + +extern_static!(NSAccessibilityFontSizeKey: &'static NSAccessibilityFontAttributeKey); + +extern_static!(NSAccessibilityMainAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityMinimizedAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityCloseButtonAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityZoomButtonAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityMinimizeButtonAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityToolbarButtonAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityProxyAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityGrowAreaAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityModalAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityDefaultButtonAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityCancelButtonAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityFullScreenButtonAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityMenuBarAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityWindowsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityFrontmostAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityHiddenAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityMainWindowAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityFocusedWindowAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityFocusedUIElementAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityExtrasMenuBarAttribute: &'static NSAccessibilityAttributeName); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSAccessibilityOrientation { + NSAccessibilityOrientationUnknown = 0, + NSAccessibilityOrientationVertical = 1, + NSAccessibilityOrientationHorizontal = 2, + } +); + +extern_static!(NSAccessibilityOrientationAttribute: &'static NSAccessibilityAttributeName); + +pub type NSAccessibilityOrientationValue = NSString; + +extern_static!(NSAccessibilityVerticalOrientationValue: &'static NSAccessibilityOrientationValue); + +extern_static!(NSAccessibilityHorizontalOrientationValue: &'static NSAccessibilityOrientationValue); + +extern_static!(NSAccessibilityUnknownOrientationValue: &'static NSAccessibilityOrientationValue); + +extern_static!(NSAccessibilityColumnTitlesAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySearchButtonAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySearchMenuAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityClearButtonAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityRowsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityVisibleRowsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySelectedRowsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityColumnsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityVisibleColumnsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySelectedColumnsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySortDirectionAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilitySelectedCellsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityVisibleCellsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityRowHeaderUIElementsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!( + NSAccessibilityColumnHeaderUIElementsAttribute: &'static NSAccessibilityAttributeName +); + +extern_static!( + NSAccessibilityCellForColumnAndRowParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!(NSAccessibilityRowIndexRangeAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityColumnIndexRangeAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityHorizontalUnitsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityVerticalUnitsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!( + NSAccessibilityHorizontalUnitDescriptionAttribute: &'static NSAccessibilityAttributeName +); + +extern_static!( + NSAccessibilityVerticalUnitDescriptionAttribute: &'static NSAccessibilityAttributeName +); + +extern_static!( + NSAccessibilityLayoutPointForScreenPointParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!( + NSAccessibilityLayoutSizeForScreenSizeParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!( + NSAccessibilityScreenPointForLayoutPointParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!( + NSAccessibilityScreenSizeForLayoutSizeParameterizedAttribute: + &'static NSAccessibilityParameterizedAttributeName +); + +extern_static!(NSAccessibilityHandlesAttribute: &'static NSAccessibilityAttributeName); + +pub type NSAccessibilitySortDirectionValue = NSString; + +extern_static!( + NSAccessibilityAscendingSortDirectionValue: &'static NSAccessibilitySortDirectionValue +); + +extern_static!( + NSAccessibilityDescendingSortDirectionValue: &'static NSAccessibilitySortDirectionValue +); + +extern_static!( + NSAccessibilityUnknownSortDirectionValue: &'static NSAccessibilitySortDirectionValue +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSAccessibilitySortDirection { + NSAccessibilitySortDirectionUnknown = 0, + NSAccessibilitySortDirectionAscending = 1, + NSAccessibilitySortDirectionDescending = 2, + } +); + +extern_static!(NSAccessibilityDisclosingAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityDisclosedRowsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityDisclosedByRowAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityDisclosureLevelAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityAllowedValuesAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityLabelUIElementsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityLabelValueAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityMatteHoleAttribute: &'static NSAccessibilityAttributeName); + +extern_static!( + NSAccessibilityMatteContentUIElementAttribute: &'static NSAccessibilityAttributeName +); + +extern_static!(NSAccessibilityMarkerUIElementsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityMarkerValuesAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityMarkerGroupUIElementAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityUnitsAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityUnitDescriptionAttribute: &'static NSAccessibilityAttributeName); + +extern_static!(NSAccessibilityMarkerTypeAttribute: &'static NSAccessibilityAttributeName); + +extern_static!( + NSAccessibilityMarkerTypeDescriptionAttribute: &'static NSAccessibilityAttributeName +); + +extern_static!(NSAccessibilityIdentifierAttribute: &'static NSAccessibilityAttributeName); + +pub type NSAccessibilityRulerMarkerTypeValue = NSString; + +extern_static!( + NSAccessibilityLeftTabStopMarkerTypeValue: &'static NSAccessibilityRulerMarkerTypeValue +); + +extern_static!( + NSAccessibilityRightTabStopMarkerTypeValue: &'static NSAccessibilityRulerMarkerTypeValue +); + +extern_static!( + NSAccessibilityCenterTabStopMarkerTypeValue: &'static NSAccessibilityRulerMarkerTypeValue +); + +extern_static!( + NSAccessibilityDecimalTabStopMarkerTypeValue: &'static NSAccessibilityRulerMarkerTypeValue +); + +extern_static!( + NSAccessibilityHeadIndentMarkerTypeValue: &'static NSAccessibilityRulerMarkerTypeValue +); + +extern_static!( + NSAccessibilityTailIndentMarkerTypeValue: &'static NSAccessibilityRulerMarkerTypeValue +); + +extern_static!( + NSAccessibilityFirstLineIndentMarkerTypeValue: &'static NSAccessibilityRulerMarkerTypeValue +); + +extern_static!(NSAccessibilityUnknownMarkerTypeValue: &'static NSAccessibilityRulerMarkerTypeValue); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSAccessibilityRulerMarkerType { + NSAccessibilityRulerMarkerTypeUnknown = 0, + NSAccessibilityRulerMarkerTypeTabStopLeft = 1, + NSAccessibilityRulerMarkerTypeTabStopRight = 2, + NSAccessibilityRulerMarkerTypeTabStopCenter = 3, + NSAccessibilityRulerMarkerTypeTabStopDecimal = 4, + NSAccessibilityRulerMarkerTypeIndentHead = 5, + NSAccessibilityRulerMarkerTypeIndentTail = 6, + NSAccessibilityRulerMarkerTypeIndentFirstLine = 7, + } +); + +pub type NSAccessibilityRulerUnitValue = NSString; + +extern_static!(NSAccessibilityInchesUnitValue: &'static NSAccessibilityRulerUnitValue); + +extern_static!(NSAccessibilityCentimetersUnitValue: &'static NSAccessibilityRulerUnitValue); + +extern_static!(NSAccessibilityPointsUnitValue: &'static NSAccessibilityRulerUnitValue); + +extern_static!(NSAccessibilityPicasUnitValue: &'static NSAccessibilityRulerUnitValue); + +extern_static!(NSAccessibilityUnknownUnitValue: &'static NSAccessibilityRulerUnitValue); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSAccessibilityUnits { + NSAccessibilityUnitsUnknown = 0, + NSAccessibilityUnitsInches = 1, + NSAccessibilityUnitsCentimeters = 2, + NSAccessibilityUnitsPoints = 3, + NSAccessibilityUnitsPicas = 4, + } +); + +pub type NSAccessibilityActionName = NSString; + +extern_static!(NSAccessibilityPressAction: &'static NSAccessibilityActionName); + +extern_static!(NSAccessibilityIncrementAction: &'static NSAccessibilityActionName); + +extern_static!(NSAccessibilityDecrementAction: &'static NSAccessibilityActionName); + +extern_static!(NSAccessibilityConfirmAction: &'static NSAccessibilityActionName); + +extern_static!(NSAccessibilityPickAction: &'static NSAccessibilityActionName); + +extern_static!(NSAccessibilityCancelAction: &'static NSAccessibilityActionName); + +extern_static!(NSAccessibilityRaiseAction: &'static NSAccessibilityActionName); + +extern_static!(NSAccessibilityShowMenuAction: &'static NSAccessibilityActionName); + +extern_static!(NSAccessibilityDeleteAction: &'static NSAccessibilityActionName); + +extern_static!(NSAccessibilityShowAlternateUIAction: &'static NSAccessibilityActionName); + +extern_static!(NSAccessibilityShowDefaultUIAction: &'static NSAccessibilityActionName); + +pub type NSAccessibilityNotificationName = NSString; + +extern_static!( + NSAccessibilityMainWindowChangedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!( + NSAccessibilityFocusedWindowChangedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!( + NSAccessibilityFocusedUIElementChangedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!( + NSAccessibilityApplicationActivatedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!( + NSAccessibilityApplicationDeactivatedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!( + NSAccessibilityApplicationHiddenNotification: &'static NSAccessibilityNotificationName +); + +extern_static!( + NSAccessibilityApplicationShownNotification: &'static NSAccessibilityNotificationName +); + +extern_static!(NSAccessibilityWindowCreatedNotification: &'static NSAccessibilityNotificationName); + +extern_static!(NSAccessibilityWindowMovedNotification: &'static NSAccessibilityNotificationName); + +extern_static!(NSAccessibilityWindowResizedNotification: &'static NSAccessibilityNotificationName); + +extern_static!( + NSAccessibilityWindowMiniaturizedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!( + NSAccessibilityWindowDeminiaturizedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!(NSAccessibilityDrawerCreatedNotification: &'static NSAccessibilityNotificationName); + +extern_static!(NSAccessibilitySheetCreatedNotification: &'static NSAccessibilityNotificationName); + +extern_static!( + NSAccessibilityUIElementDestroyedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!(NSAccessibilityValueChangedNotification: &'static NSAccessibilityNotificationName); + +extern_static!(NSAccessibilityTitleChangedNotification: &'static NSAccessibilityNotificationName); + +extern_static!(NSAccessibilityResizedNotification: &'static NSAccessibilityNotificationName); + +extern_static!(NSAccessibilityMovedNotification: &'static NSAccessibilityNotificationName); + +extern_static!(NSAccessibilityCreatedNotification: &'static NSAccessibilityNotificationName); + +extern_static!(NSAccessibilityLayoutChangedNotification: &'static NSAccessibilityNotificationName); + +extern_static!(NSAccessibilityHelpTagCreatedNotification: &'static NSAccessibilityNotificationName); + +extern_static!( + NSAccessibilitySelectedTextChangedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!( + NSAccessibilityRowCountChangedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!( + NSAccessibilitySelectedChildrenChangedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!( + NSAccessibilitySelectedRowsChangedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!( + NSAccessibilitySelectedColumnsChangedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!(NSAccessibilityRowExpandedNotification: &'static NSAccessibilityNotificationName); + +extern_static!(NSAccessibilityRowCollapsedNotification: &'static NSAccessibilityNotificationName); + +extern_static!( + NSAccessibilitySelectedCellsChangedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!(NSAccessibilityUnitsChangedNotification: &'static NSAccessibilityNotificationName); + +extern_static!( + NSAccessibilitySelectedChildrenMovedNotification: &'static NSAccessibilityNotificationName +); + +extern_static!( + NSAccessibilityAnnouncementRequestedNotification: &'static NSAccessibilityNotificationName +); + +pub type NSAccessibilityRole = NSString; + +extern_static!(NSAccessibilityUnknownRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityButtonRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityRadioButtonRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityCheckBoxRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilitySliderRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityTabGroupRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityTextFieldRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityStaticTextRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityTextAreaRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityScrollAreaRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityPopUpButtonRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityMenuButtonRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityTableRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityApplicationRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityGroupRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityRadioGroupRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityListRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityScrollBarRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityValueIndicatorRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityImageRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityMenuBarRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityMenuBarItemRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityMenuRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityMenuItemRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityColumnRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityRowRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityToolbarRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityBusyIndicatorRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityProgressIndicatorRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityWindowRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityDrawerRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilitySystemWideRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityOutlineRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityIncrementorRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityBrowserRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityComboBoxRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilitySplitGroupRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilitySplitterRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityColorWellRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityGrowAreaRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilitySheetRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityHelpTagRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityMatteRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityRulerRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityRulerMarkerRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityLinkRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityDisclosureTriangleRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityGridRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityRelevanceIndicatorRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityLevelIndicatorRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityCellRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityPopoverRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityPageRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityLayoutAreaRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityLayoutItemRole: &'static NSAccessibilityRole); + +extern_static!(NSAccessibilityHandleRole: &'static NSAccessibilityRole); + +pub type NSAccessibilitySubrole = NSString; + +extern_static!(NSAccessibilityUnknownSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityCloseButtonSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityZoomButtonSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityMinimizeButtonSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityToolbarButtonSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityTableRowSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityOutlineRowSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilitySecureTextFieldSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityStandardWindowSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityDialogSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilitySystemDialogSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityFloatingWindowSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilitySystemFloatingWindowSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityIncrementArrowSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityDecrementArrowSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityIncrementPageSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityDecrementPageSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilitySearchFieldSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityTextAttachmentSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityTextLinkSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityTimelineSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilitySortButtonSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityRatingIndicatorSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityContentListSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityDefinitionListSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityFullScreenButtonSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityToggleSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilitySwitchSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityDescriptionListSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityTabButtonSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilityCollectionListSubrole: &'static NSAccessibilitySubrole); + +extern_static!(NSAccessibilitySectionListSubrole: &'static NSAccessibilitySubrole); + +pub type NSAccessibilityNotificationUserInfoKey = NSString; + +extern_static!(NSAccessibilityUIElementsKey: &'static NSAccessibilityNotificationUserInfoKey); + +extern_static!(NSAccessibilityPriorityKey: &'static NSAccessibilityNotificationUserInfoKey); + +extern_static!(NSAccessibilityAnnouncementKey: &'static NSAccessibilityNotificationUserInfoKey); + +extern_fn!( + pub unsafe fn NSAccessibilityPostNotificationWithUserInfo( + element: &Object, + notification: &NSAccessibilityNotificationName, + userInfo: Option<&NSDictionary>, + ); +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSAccessibilityPriorityLevel { + NSAccessibilityPriorityLow = 10, + NSAccessibilityPriorityMedium = 50, + NSAccessibilityPriorityHigh = 90, + } +); + +pub type NSAccessibilityLoadingToken = TodoProtocols; + +extern_static!(NSAccessibilitySortButtonRole: &'static NSAccessibilityRole); diff --git a/crates/icrate/src/generated/AppKit/NSAccessibilityCustomAction.rs b/crates/icrate/src/generated/AppKit/NSAccessibilityCustomAction.rs new file mode 100644 index 000000000..6393a1572 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAccessibilityCustomAction.rs @@ -0,0 +1,58 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSAccessibilityCustomAction; + + unsafe impl ClassType for NSAccessibilityCustomAction { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAccessibilityCustomAction { + #[method_id(@__retain_semantics Init initWithName:handler:)] + pub unsafe fn initWithName_handler( + this: Option>, + name: &NSString, + handler: Option<&Block<(), Bool>>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithName:target:selector:)] + pub unsafe fn initWithName_target_selector( + this: Option>, + name: &NSString, + target: &NSObject, + selector: Sel, + ) -> Id; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method(setName:)] + pub unsafe fn setName(&self, name: &NSString); + + #[method(handler)] + pub unsafe fn handler(&self) -> *mut Block<(), Bool>; + + #[method(setHandler:)] + pub unsafe fn setHandler(&self, handler: Option<&Block<(), Bool>>); + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&NSObject>); + + #[method(selector)] + pub unsafe fn selector(&self) -> OptionSel; + + #[method(setSelector:)] + pub unsafe fn setSelector(&self, selector: OptionSel); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSAccessibilityCustomRotor.rs b/crates/icrate/src/generated/AppKit/NSAccessibilityCustomRotor.rs new file mode 100644 index 000000000..3d82bc376 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAccessibilityCustomRotor.rs @@ -0,0 +1,205 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSAccessibilityCustomRotorSearchDirection { + NSAccessibilityCustomRotorSearchDirectionPrevious = 0, + NSAccessibilityCustomRotorSearchDirectionNext = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSAccessibilityCustomRotorType { + NSAccessibilityCustomRotorTypeCustom = 0, + NSAccessibilityCustomRotorTypeAny = 1, + NSAccessibilityCustomRotorTypeAnnotation = 2, + NSAccessibilityCustomRotorTypeBoldText = 3, + NSAccessibilityCustomRotorTypeHeading = 4, + NSAccessibilityCustomRotorTypeHeadingLevel1 = 5, + NSAccessibilityCustomRotorTypeHeadingLevel2 = 6, + NSAccessibilityCustomRotorTypeHeadingLevel3 = 7, + NSAccessibilityCustomRotorTypeHeadingLevel4 = 8, + NSAccessibilityCustomRotorTypeHeadingLevel5 = 9, + NSAccessibilityCustomRotorTypeHeadingLevel6 = 10, + NSAccessibilityCustomRotorTypeImage = 11, + NSAccessibilityCustomRotorTypeItalicText = 12, + NSAccessibilityCustomRotorTypeLandmark = 13, + NSAccessibilityCustomRotorTypeLink = 14, + NSAccessibilityCustomRotorTypeList = 15, + NSAccessibilityCustomRotorTypeMisspelledWord = 16, + NSAccessibilityCustomRotorTypeTable = 17, + NSAccessibilityCustomRotorTypeTextField = 18, + NSAccessibilityCustomRotorTypeUnderlinedText = 19, + NSAccessibilityCustomRotorTypeVisitedLink = 20, + NSAccessibilityCustomRotorTypeAudiograph = 21, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSAccessibilityCustomRotor; + + unsafe impl ClassType for NSAccessibilityCustomRotor { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAccessibilityCustomRotor { + #[method_id(@__retain_semantics Init initWithLabel:itemSearchDelegate:)] + pub unsafe fn initWithLabel_itemSearchDelegate( + this: Option>, + label: &NSString, + itemSearchDelegate: &NSAccessibilityCustomRotorItemSearchDelegate, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithRotorType:itemSearchDelegate:)] + pub unsafe fn initWithRotorType_itemSearchDelegate( + this: Option>, + rotorType: NSAccessibilityCustomRotorType, + itemSearchDelegate: &NSAccessibilityCustomRotorItemSearchDelegate, + ) -> Id; + + #[method(type)] + pub unsafe fn type_(&self) -> NSAccessibilityCustomRotorType; + + #[method(setType:)] + pub unsafe fn setType(&self, type_: NSAccessibilityCustomRotorType); + + #[method_id(@__retain_semantics Other label)] + pub unsafe fn label(&self) -> Id; + + #[method(setLabel:)] + pub unsafe fn setLabel(&self, label: &NSString); + + #[method_id(@__retain_semantics Other itemSearchDelegate)] + pub unsafe fn itemSearchDelegate( + &self, + ) -> Option>; + + #[method(setItemSearchDelegate:)] + pub unsafe fn setItemSearchDelegate( + &self, + itemSearchDelegate: Option<&NSAccessibilityCustomRotorItemSearchDelegate>, + ); + + #[method_id(@__retain_semantics Other itemLoadingDelegate)] + pub unsafe fn itemLoadingDelegate( + &self, + ) -> Option>; + + #[method(setItemLoadingDelegate:)] + pub unsafe fn setItemLoadingDelegate( + &self, + itemLoadingDelegate: Option<&NSAccessibilityElementLoading>, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSAccessibilityCustomRotorSearchParameters; + + unsafe impl ClassType for NSAccessibilityCustomRotorSearchParameters { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAccessibilityCustomRotorSearchParameters { + #[method_id(@__retain_semantics Other currentItem)] + pub unsafe fn currentItem( + &self, + ) -> Option>; + + #[method(setCurrentItem:)] + pub unsafe fn setCurrentItem( + &self, + currentItem: Option<&NSAccessibilityCustomRotorItemResult>, + ); + + #[method(searchDirection)] + pub unsafe fn searchDirection(&self) -> NSAccessibilityCustomRotorSearchDirection; + + #[method(setSearchDirection:)] + pub unsafe fn setSearchDirection( + &self, + searchDirection: NSAccessibilityCustomRotorSearchDirection, + ); + + #[method_id(@__retain_semantics Other filterString)] + pub unsafe fn filterString(&self) -> Id; + + #[method(setFilterString:)] + pub unsafe fn setFilterString(&self, filterString: &NSString); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSAccessibilityCustomRotorItemResult; + + unsafe impl ClassType for NSAccessibilityCustomRotorItemResult { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAccessibilityCustomRotorItemResult { + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithTargetElement:)] + pub unsafe fn initWithTargetElement( + this: Option>, + targetElement: &NSAccessibilityElement, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithItemLoadingToken:customLabel:)] + pub unsafe fn initWithItemLoadingToken_customLabel( + this: Option>, + itemLoadingToken: &NSAccessibilityLoadingToken, + customLabel: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other targetElement)] + pub unsafe fn targetElement(&self) -> Option>; + + #[method_id(@__retain_semantics Other itemLoadingToken)] + pub unsafe fn itemLoadingToken(&self) -> Option>; + + #[method(targetRange)] + pub unsafe fn targetRange(&self) -> NSRange; + + #[method(setTargetRange:)] + pub unsafe fn setTargetRange(&self, targetRange: NSRange); + + #[method_id(@__retain_semantics Other customLabel)] + pub unsafe fn customLabel(&self) -> Option>; + + #[method(setCustomLabel:)] + pub unsafe fn setCustomLabel(&self, customLabel: Option<&NSString>); + } +); + +extern_protocol!( + pub struct NSAccessibilityCustomRotorItemSearchDelegate; + + unsafe impl NSAccessibilityCustomRotorItemSearchDelegate { + #[method_id(@__retain_semantics Other rotor:resultForSearchParameters:)] + pub unsafe fn rotor_resultForSearchParameters( + &self, + rotor: &NSAccessibilityCustomRotor, + searchParameters: &NSAccessibilityCustomRotorSearchParameters, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSAccessibilityElement.rs b/crates/icrate/src/generated/AppKit/NSAccessibilityElement.rs new file mode 100644 index 000000000..b2254cd32 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAccessibilityElement.rs @@ -0,0 +1,39 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSAccessibilityElement; + + unsafe impl ClassType for NSAccessibilityElement { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAccessibilityElement { + #[method_id(@__retain_semantics Other accessibilityElementWithRole:frame:label:parent:)] + pub unsafe fn accessibilityElementWithRole_frame_label_parent( + role: &NSAccessibilityRole, + frame: NSRect, + label: Option<&NSString>, + parent: Option<&Object>, + ) -> Id; + + #[method(accessibilityAddChildElement:)] + pub unsafe fn accessibilityAddChildElement(&self, childElement: &NSAccessibilityElement); + + #[method(accessibilityFrameInParentSpace)] + pub unsafe fn accessibilityFrameInParentSpace(&self) -> NSRect; + + #[method(setAccessibilityFrameInParentSpace:)] + pub unsafe fn setAccessibilityFrameInParentSpace( + &self, + accessibilityFrameInParentSpace: NSRect, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSAccessibilityProtocols.rs b/crates/icrate/src/generated/AppKit/NSAccessibilityProtocols.rs new file mode 100644 index 000000000..52cbc66b4 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAccessibilityProtocols.rs @@ -0,0 +1,1347 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSAccessibilityGroup; + + unsafe impl NSAccessibilityGroup {} +); + +extern_protocol!( + pub struct NSAccessibilityButton; + + unsafe impl NSAccessibilityButton { + #[method_id(@__retain_semantics Other accessibilityLabel)] + pub unsafe fn accessibilityLabel(&self) -> Option>; + + #[method(accessibilityPerformPress)] + pub unsafe fn accessibilityPerformPress(&self) -> bool; + } +); + +extern_protocol!( + pub struct NSAccessibilitySwitch; + + unsafe impl NSAccessibilitySwitch { + #[method_id(@__retain_semantics Other accessibilityValue)] + pub unsafe fn accessibilityValue(&self) -> Option>; + + #[optional] + #[method(accessibilityPerformIncrement)] + pub unsafe fn accessibilityPerformIncrement(&self) -> bool; + + #[optional] + #[method(accessibilityPerformDecrement)] + pub unsafe fn accessibilityPerformDecrement(&self) -> bool; + } +); + +extern_protocol!( + pub struct NSAccessibilityRadioButton; + + unsafe impl NSAccessibilityRadioButton { + #[method_id(@__retain_semantics Other accessibilityValue)] + pub unsafe fn accessibilityValue(&self) -> Option>; + } +); + +extern_protocol!( + pub struct NSAccessibilityCheckBox; + + unsafe impl NSAccessibilityCheckBox { + #[method_id(@__retain_semantics Other accessibilityValue)] + pub unsafe fn accessibilityValue(&self) -> Option>; + } +); + +extern_protocol!( + pub struct NSAccessibilityStaticText; + + unsafe impl NSAccessibilityStaticText { + #[method_id(@__retain_semantics Other accessibilityValue)] + pub unsafe fn accessibilityValue(&self) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other accessibilityAttributedStringForRange:)] + pub unsafe fn accessibilityAttributedStringForRange( + &self, + range: NSRange, + ) -> Option>; + + #[optional] + #[method(accessibilityVisibleCharacterRange)] + pub unsafe fn accessibilityVisibleCharacterRange(&self) -> NSRange; + } +); + +extern_protocol!( + pub struct NSAccessibilityNavigableStaticText; + + unsafe impl NSAccessibilityNavigableStaticText { + #[method_id(@__retain_semantics Other accessibilityStringForRange:)] + pub unsafe fn accessibilityStringForRange( + &self, + range: NSRange, + ) -> Option>; + + #[method(accessibilityLineForIndex:)] + pub unsafe fn accessibilityLineForIndex(&self, index: NSInteger) -> NSInteger; + + #[method(accessibilityRangeForLine:)] + pub unsafe fn accessibilityRangeForLine(&self, lineNumber: NSInteger) -> NSRange; + + #[method(accessibilityFrameForRange:)] + pub unsafe fn accessibilityFrameForRange(&self, range: NSRange) -> NSRect; + } +); + +extern_protocol!( + pub struct NSAccessibilityProgressIndicator; + + unsafe impl NSAccessibilityProgressIndicator { + #[method_id(@__retain_semantics Other accessibilityValue)] + pub unsafe fn accessibilityValue(&self) -> Option>; + } +); + +extern_protocol!( + pub struct NSAccessibilityStepper; + + unsafe impl NSAccessibilityStepper { + #[method_id(@__retain_semantics Other accessibilityLabel)] + pub unsafe fn accessibilityLabel(&self) -> Option>; + + #[method(accessibilityPerformIncrement)] + pub unsafe fn accessibilityPerformIncrement(&self) -> bool; + + #[method(accessibilityPerformDecrement)] + pub unsafe fn accessibilityPerformDecrement(&self) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other accessibilityValue)] + pub unsafe fn accessibilityValue(&self) -> Option>; + } +); + +extern_protocol!( + pub struct NSAccessibilitySlider; + + unsafe impl NSAccessibilitySlider { + #[method_id(@__retain_semantics Other accessibilityLabel)] + pub unsafe fn accessibilityLabel(&self) -> Option>; + + #[method_id(@__retain_semantics Other accessibilityValue)] + pub unsafe fn accessibilityValue(&self) -> Option>; + + #[method(accessibilityPerformIncrement)] + pub unsafe fn accessibilityPerformIncrement(&self) -> bool; + + #[method(accessibilityPerformDecrement)] + pub unsafe fn accessibilityPerformDecrement(&self) -> bool; + } +); + +extern_protocol!( + pub struct NSAccessibilityImage; + + unsafe impl NSAccessibilityImage { + #[method_id(@__retain_semantics Other accessibilityLabel)] + pub unsafe fn accessibilityLabel(&self) -> Option>; + } +); + +extern_protocol!( + pub struct NSAccessibilityContainsTransientUI; + + unsafe impl NSAccessibilityContainsTransientUI { + #[method(accessibilityPerformShowAlternateUI)] + pub unsafe fn accessibilityPerformShowAlternateUI(&self) -> bool; + + #[method(accessibilityPerformShowDefaultUI)] + pub unsafe fn accessibilityPerformShowDefaultUI(&self) -> bool; + + #[method(isAccessibilityAlternateUIVisible)] + pub unsafe fn isAccessibilityAlternateUIVisible(&self) -> bool; + } +); + +extern_protocol!( + pub struct NSAccessibilityTable; + + unsafe impl NSAccessibilityTable { + #[method_id(@__retain_semantics Other accessibilityLabel)] + pub unsafe fn accessibilityLabel(&self) -> Option>; + + #[method_id(@__retain_semantics Other accessibilityRows)] + pub unsafe fn accessibilityRows(&self) -> Option, Shared>>; + + #[optional] + #[method_id(@__retain_semantics Other accessibilitySelectedRows)] + pub unsafe fn accessibilitySelectedRows( + &self, + ) -> Option, Shared>>; + + #[optional] + #[method(setAccessibilitySelectedRows:)] + pub unsafe fn setAccessibilitySelectedRows( + &self, + selectedRows: &NSArray, + ); + + #[optional] + #[method_id(@__retain_semantics Other accessibilityVisibleRows)] + pub unsafe fn accessibilityVisibleRows( + &self, + ) -> Option, Shared>>; + + #[optional] + #[method_id(@__retain_semantics Other accessibilityColumns)] + pub unsafe fn accessibilityColumns(&self) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other accessibilityVisibleColumns)] + pub unsafe fn accessibilityVisibleColumns(&self) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other accessibilitySelectedColumns)] + pub unsafe fn accessibilitySelectedColumns(&self) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other accessibilityHeaderGroup)] + pub unsafe fn accessibilityHeaderGroup(&self) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other accessibilitySelectedCells)] + pub unsafe fn accessibilitySelectedCells(&self) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other accessibilityVisibleCells)] + pub unsafe fn accessibilityVisibleCells(&self) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other accessibilityRowHeaderUIElements)] + pub unsafe fn accessibilityRowHeaderUIElements(&self) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other accessibilityColumnHeaderUIElements)] + pub unsafe fn accessibilityColumnHeaderUIElements(&self) -> Option>; + } +); + +extern_protocol!( + pub struct NSAccessibilityOutline; + + unsafe impl NSAccessibilityOutline {} +); + +extern_protocol!( + pub struct NSAccessibilityList; + + unsafe impl NSAccessibilityList {} +); + +extern_protocol!( + pub struct NSAccessibilityRow; + + unsafe impl NSAccessibilityRow { + #[method(accessibilityIndex)] + pub unsafe fn accessibilityIndex(&self) -> NSInteger; + + #[optional] + #[method(accessibilityDisclosureLevel)] + pub unsafe fn accessibilityDisclosureLevel(&self) -> NSInteger; + } +); + +extern_protocol!( + pub struct NSAccessibilityLayoutArea; + + unsafe impl NSAccessibilityLayoutArea { + #[method_id(@__retain_semantics Other accessibilityLabel)] + pub unsafe fn accessibilityLabel(&self) -> Id; + + #[method_id(@__retain_semantics Other accessibilityChildren)] + pub unsafe fn accessibilityChildren(&self) -> Option>; + + #[method_id(@__retain_semantics Other accessibilitySelectedChildren)] + pub unsafe fn accessibilitySelectedChildren(&self) -> Option>; + + #[method_id(@__retain_semantics Other accessibilityFocusedUIElement)] + pub unsafe fn accessibilityFocusedUIElement(&self) -> Id; + } +); + +extern_protocol!( + pub struct NSAccessibilityLayoutItem; + + unsafe impl NSAccessibilityLayoutItem { + #[optional] + #[method(setAccessibilityFrame:)] + pub unsafe fn setAccessibilityFrame(&self, frame: NSRect); + } +); + +extern_protocol!( + pub struct NSAccessibilityElementLoading; + + unsafe impl NSAccessibilityElementLoading { + #[method_id(@__retain_semantics Other accessibilityElementWithToken:)] + pub unsafe fn accessibilityElementWithToken( + &self, + token: &NSAccessibilityLoadingToken, + ) -> Option>; + + #[optional] + #[method(accessibilityRangeInTargetElementWithToken:)] + pub unsafe fn accessibilityRangeInTargetElementWithToken( + &self, + token: &NSAccessibilityLoadingToken, + ) -> NSRange; + } +); + +extern_protocol!( + pub struct NSAccessibility; + + unsafe impl NSAccessibility { + #[method(isAccessibilityElement)] + pub unsafe fn isAccessibilityElement(&self) -> bool; + + #[method(setAccessibilityElement:)] + pub unsafe fn setAccessibilityElement(&self, accessibilityElement: bool); + + #[method(accessibilityFrame)] + pub unsafe fn accessibilityFrame(&self) -> NSRect; + + #[method(setAccessibilityFrame:)] + pub unsafe fn setAccessibilityFrame(&self, accessibilityFrame: NSRect); + + #[method(isAccessibilityFocused)] + pub unsafe fn isAccessibilityFocused(&self) -> bool; + + #[method(setAccessibilityFocused:)] + pub unsafe fn setAccessibilityFocused(&self, accessibilityFocused: bool); + + #[method(accessibilityActivationPoint)] + pub unsafe fn accessibilityActivationPoint(&self) -> NSPoint; + + #[method(setAccessibilityActivationPoint:)] + pub unsafe fn setAccessibilityActivationPoint(&self, accessibilityActivationPoint: NSPoint); + + #[method_id(@__retain_semantics Other accessibilityTopLevelUIElement)] + pub unsafe fn accessibilityTopLevelUIElement(&self) -> Option>; + + #[method(setAccessibilityTopLevelUIElement:)] + pub unsafe fn setAccessibilityTopLevelUIElement( + &self, + accessibilityTopLevelUIElement: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityURL)] + pub unsafe fn accessibilityURL(&self) -> Option>; + + #[method(setAccessibilityURL:)] + pub unsafe fn setAccessibilityURL(&self, accessibilityURL: Option<&NSURL>); + + #[method_id(@__retain_semantics Other accessibilityValue)] + pub unsafe fn accessibilityValue(&self) -> Option>; + + #[method(setAccessibilityValue:)] + pub unsafe fn setAccessibilityValue(&self, accessibilityValue: Option<&Object>); + + #[method_id(@__retain_semantics Other accessibilityValueDescription)] + pub unsafe fn accessibilityValueDescription(&self) -> Option>; + + #[method(setAccessibilityValueDescription:)] + pub unsafe fn setAccessibilityValueDescription( + &self, + accessibilityValueDescription: Option<&NSString>, + ); + + #[method_id(@__retain_semantics Other accessibilityVisibleChildren)] + pub unsafe fn accessibilityVisibleChildren(&self) -> Option>; + + #[method(setAccessibilityVisibleChildren:)] + pub unsafe fn setAccessibilityVisibleChildren( + &self, + accessibilityVisibleChildren: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilitySubrole)] + pub unsafe fn accessibilitySubrole(&self) -> Option>; + + #[method(setAccessibilitySubrole:)] + pub unsafe fn setAccessibilitySubrole( + &self, + accessibilitySubrole: Option<&NSAccessibilitySubrole>, + ); + + #[method_id(@__retain_semantics Other accessibilityTitle)] + pub unsafe fn accessibilityTitle(&self) -> Option>; + + #[method(setAccessibilityTitle:)] + pub unsafe fn setAccessibilityTitle(&self, accessibilityTitle: Option<&NSString>); + + #[method_id(@__retain_semantics Other accessibilityTitleUIElement)] + pub unsafe fn accessibilityTitleUIElement(&self) -> Option>; + + #[method(setAccessibilityTitleUIElement:)] + pub unsafe fn setAccessibilityTitleUIElement( + &self, + accessibilityTitleUIElement: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityNextContents)] + pub unsafe fn accessibilityNextContents(&self) -> Option>; + + #[method(setAccessibilityNextContents:)] + pub unsafe fn setAccessibilityNextContents( + &self, + accessibilityNextContents: Option<&NSArray>, + ); + + #[method(accessibilityOrientation)] + pub unsafe fn accessibilityOrientation(&self) -> NSAccessibilityOrientation; + + #[method(setAccessibilityOrientation:)] + pub unsafe fn setAccessibilityOrientation( + &self, + accessibilityOrientation: NSAccessibilityOrientation, + ); + + #[method_id(@__retain_semantics Other accessibilityOverflowButton)] + pub unsafe fn accessibilityOverflowButton(&self) -> Option>; + + #[method(setAccessibilityOverflowButton:)] + pub unsafe fn setAccessibilityOverflowButton( + &self, + accessibilityOverflowButton: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityParent)] + pub unsafe fn accessibilityParent(&self) -> Option>; + + #[method(setAccessibilityParent:)] + pub unsafe fn setAccessibilityParent(&self, accessibilityParent: Option<&Object>); + + #[method_id(@__retain_semantics Other accessibilityPlaceholderValue)] + pub unsafe fn accessibilityPlaceholderValue(&self) -> Option>; + + #[method(setAccessibilityPlaceholderValue:)] + pub unsafe fn setAccessibilityPlaceholderValue( + &self, + accessibilityPlaceholderValue: Option<&NSString>, + ); + + #[method_id(@__retain_semantics Other accessibilityPreviousContents)] + pub unsafe fn accessibilityPreviousContents(&self) -> Option>; + + #[method(setAccessibilityPreviousContents:)] + pub unsafe fn setAccessibilityPreviousContents( + &self, + accessibilityPreviousContents: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilityRole)] + pub unsafe fn accessibilityRole(&self) -> Option>; + + #[method(setAccessibilityRole:)] + pub unsafe fn setAccessibilityRole(&self, accessibilityRole: Option<&NSAccessibilityRole>); + + #[method_id(@__retain_semantics Other accessibilityRoleDescription)] + pub unsafe fn accessibilityRoleDescription(&self) -> Option>; + + #[method(setAccessibilityRoleDescription:)] + pub unsafe fn setAccessibilityRoleDescription( + &self, + accessibilityRoleDescription: Option<&NSString>, + ); + + #[method_id(@__retain_semantics Other accessibilitySearchButton)] + pub unsafe fn accessibilitySearchButton(&self) -> Option>; + + #[method(setAccessibilitySearchButton:)] + pub unsafe fn setAccessibilitySearchButton( + &self, + accessibilitySearchButton: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilitySearchMenu)] + pub unsafe fn accessibilitySearchMenu(&self) -> Option>; + + #[method(setAccessibilitySearchMenu:)] + pub unsafe fn setAccessibilitySearchMenu(&self, accessibilitySearchMenu: Option<&Object>); + + #[method(isAccessibilitySelected)] + pub unsafe fn isAccessibilitySelected(&self) -> bool; + + #[method(setAccessibilitySelected:)] + pub unsafe fn setAccessibilitySelected(&self, accessibilitySelected: bool); + + #[method_id(@__retain_semantics Other accessibilitySelectedChildren)] + pub unsafe fn accessibilitySelectedChildren(&self) -> Option>; + + #[method(setAccessibilitySelectedChildren:)] + pub unsafe fn setAccessibilitySelectedChildren( + &self, + accessibilitySelectedChildren: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilityServesAsTitleForUIElements)] + pub unsafe fn accessibilityServesAsTitleForUIElements(&self) + -> Option>; + + #[method(setAccessibilityServesAsTitleForUIElements:)] + pub unsafe fn setAccessibilityServesAsTitleForUIElements( + &self, + accessibilityServesAsTitleForUIElements: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilityShownMenu)] + pub unsafe fn accessibilityShownMenu(&self) -> Option>; + + #[method(setAccessibilityShownMenu:)] + pub unsafe fn setAccessibilityShownMenu(&self, accessibilityShownMenu: Option<&Object>); + + #[method_id(@__retain_semantics Other accessibilityMinValue)] + pub unsafe fn accessibilityMinValue(&self) -> Option>; + + #[method(setAccessibilityMinValue:)] + pub unsafe fn setAccessibilityMinValue(&self, accessibilityMinValue: Option<&Object>); + + #[method_id(@__retain_semantics Other accessibilityMaxValue)] + pub unsafe fn accessibilityMaxValue(&self) -> Option>; + + #[method(setAccessibilityMaxValue:)] + pub unsafe fn setAccessibilityMaxValue(&self, accessibilityMaxValue: Option<&Object>); + + #[method_id(@__retain_semantics Other accessibilityLinkedUIElements)] + pub unsafe fn accessibilityLinkedUIElements(&self) -> Option>; + + #[method(setAccessibilityLinkedUIElements:)] + pub unsafe fn setAccessibilityLinkedUIElements( + &self, + accessibilityLinkedUIElements: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilityWindow)] + pub unsafe fn accessibilityWindow(&self) -> Option>; + + #[method(setAccessibilityWindow:)] + pub unsafe fn setAccessibilityWindow(&self, accessibilityWindow: Option<&Object>); + + #[method_id(@__retain_semantics Other accessibilityIdentifier)] + pub unsafe fn accessibilityIdentifier(&self) -> Option>; + + #[method(setAccessibilityIdentifier:)] + pub unsafe fn setAccessibilityIdentifier(&self, accessibilityIdentifier: Option<&NSString>); + + #[method_id(@__retain_semantics Other accessibilityHelp)] + pub unsafe fn accessibilityHelp(&self) -> Option>; + + #[method(setAccessibilityHelp:)] + pub unsafe fn setAccessibilityHelp(&self, accessibilityHelp: Option<&NSString>); + + #[method_id(@__retain_semantics Other accessibilityFilename)] + pub unsafe fn accessibilityFilename(&self) -> Option>; + + #[method(setAccessibilityFilename:)] + pub unsafe fn setAccessibilityFilename(&self, accessibilityFilename: Option<&NSString>); + + #[method(isAccessibilityExpanded)] + pub unsafe fn isAccessibilityExpanded(&self) -> bool; + + #[method(setAccessibilityExpanded:)] + pub unsafe fn setAccessibilityExpanded(&self, accessibilityExpanded: bool); + + #[method(isAccessibilityEdited)] + pub unsafe fn isAccessibilityEdited(&self) -> bool; + + #[method(setAccessibilityEdited:)] + pub unsafe fn setAccessibilityEdited(&self, accessibilityEdited: bool); + + #[method(isAccessibilityEnabled)] + pub unsafe fn isAccessibilityEnabled(&self) -> bool; + + #[method(setAccessibilityEnabled:)] + pub unsafe fn setAccessibilityEnabled(&self, accessibilityEnabled: bool); + + #[method_id(@__retain_semantics Other accessibilityChildren)] + pub unsafe fn accessibilityChildren(&self) -> Option>; + + #[method(setAccessibilityChildren:)] + pub unsafe fn setAccessibilityChildren(&self, accessibilityChildren: Option<&NSArray>); + + #[method_id(@__retain_semantics Other accessibilityChildrenInNavigationOrder)] + pub unsafe fn accessibilityChildrenInNavigationOrder( + &self, + ) -> Option, Shared>>; + + #[method(setAccessibilityChildrenInNavigationOrder:)] + pub unsafe fn setAccessibilityChildrenInNavigationOrder( + &self, + accessibilityChildrenInNavigationOrder: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilityClearButton)] + pub unsafe fn accessibilityClearButton(&self) -> Option>; + + #[method(setAccessibilityClearButton:)] + pub unsafe fn setAccessibilityClearButton(&self, accessibilityClearButton: Option<&Object>); + + #[method_id(@__retain_semantics Other accessibilityCancelButton)] + pub unsafe fn accessibilityCancelButton(&self) -> Option>; + + #[method(setAccessibilityCancelButton:)] + pub unsafe fn setAccessibilityCancelButton( + &self, + accessibilityCancelButton: Option<&Object>, + ); + + #[method(isAccessibilityProtectedContent)] + pub unsafe fn isAccessibilityProtectedContent(&self) -> bool; + + #[method(setAccessibilityProtectedContent:)] + pub unsafe fn setAccessibilityProtectedContent(&self, accessibilityProtectedContent: bool); + + #[method_id(@__retain_semantics Other accessibilityContents)] + pub unsafe fn accessibilityContents(&self) -> Option>; + + #[method(setAccessibilityContents:)] + pub unsafe fn setAccessibilityContents(&self, accessibilityContents: Option<&NSArray>); + + #[method_id(@__retain_semantics Other accessibilityLabel)] + pub unsafe fn accessibilityLabel(&self) -> Option>; + + #[method(setAccessibilityLabel:)] + pub unsafe fn setAccessibilityLabel(&self, accessibilityLabel: Option<&NSString>); + + #[method(isAccessibilityAlternateUIVisible)] + pub unsafe fn isAccessibilityAlternateUIVisible(&self) -> bool; + + #[method(setAccessibilityAlternateUIVisible:)] + pub unsafe fn setAccessibilityAlternateUIVisible( + &self, + accessibilityAlternateUIVisible: bool, + ); + + #[method_id(@__retain_semantics Other accessibilitySharedFocusElements)] + pub unsafe fn accessibilitySharedFocusElements(&self) -> Option>; + + #[method(setAccessibilitySharedFocusElements:)] + pub unsafe fn setAccessibilitySharedFocusElements( + &self, + accessibilitySharedFocusElements: Option<&NSArray>, + ); + + #[method(isAccessibilityRequired)] + pub unsafe fn isAccessibilityRequired(&self) -> bool; + + #[method(setAccessibilityRequired:)] + pub unsafe fn setAccessibilityRequired(&self, accessibilityRequired: bool); + + #[method_id(@__retain_semantics Other accessibilityCustomRotors)] + pub unsafe fn accessibilityCustomRotors( + &self, + ) -> Id, Shared>; + + #[method(setAccessibilityCustomRotors:)] + pub unsafe fn setAccessibilityCustomRotors( + &self, + accessibilityCustomRotors: &NSArray, + ); + + #[method_id(@__retain_semantics Other accessibilityApplicationFocusedUIElement)] + pub unsafe fn accessibilityApplicationFocusedUIElement(&self) + -> Option>; + + #[method(setAccessibilityApplicationFocusedUIElement:)] + pub unsafe fn setAccessibilityApplicationFocusedUIElement( + &self, + accessibilityApplicationFocusedUIElement: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityMainWindow)] + pub unsafe fn accessibilityMainWindow(&self) -> Option>; + + #[method(setAccessibilityMainWindow:)] + pub unsafe fn setAccessibilityMainWindow(&self, accessibilityMainWindow: Option<&Object>); + + #[method(isAccessibilityHidden)] + pub unsafe fn isAccessibilityHidden(&self) -> bool; + + #[method(setAccessibilityHidden:)] + pub unsafe fn setAccessibilityHidden(&self, accessibilityHidden: bool); + + #[method(isAccessibilityFrontmost)] + pub unsafe fn isAccessibilityFrontmost(&self) -> bool; + + #[method(setAccessibilityFrontmost:)] + pub unsafe fn setAccessibilityFrontmost(&self, accessibilityFrontmost: bool); + + #[method_id(@__retain_semantics Other accessibilityFocusedWindow)] + pub unsafe fn accessibilityFocusedWindow(&self) -> Option>; + + #[method(setAccessibilityFocusedWindow:)] + pub unsafe fn setAccessibilityFocusedWindow( + &self, + accessibilityFocusedWindow: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityWindows)] + pub unsafe fn accessibilityWindows(&self) -> Option>; + + #[method(setAccessibilityWindows:)] + pub unsafe fn setAccessibilityWindows(&self, accessibilityWindows: Option<&NSArray>); + + #[method_id(@__retain_semantics Other accessibilityExtrasMenuBar)] + pub unsafe fn accessibilityExtrasMenuBar(&self) -> Option>; + + #[method(setAccessibilityExtrasMenuBar:)] + pub unsafe fn setAccessibilityExtrasMenuBar( + &self, + accessibilityExtrasMenuBar: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityMenuBar)] + pub unsafe fn accessibilityMenuBar(&self) -> Option>; + + #[method(setAccessibilityMenuBar:)] + pub unsafe fn setAccessibilityMenuBar(&self, accessibilityMenuBar: Option<&Object>); + + #[method_id(@__retain_semantics Other accessibilityColumnTitles)] + pub unsafe fn accessibilityColumnTitles(&self) -> Option>; + + #[method(setAccessibilityColumnTitles:)] + pub unsafe fn setAccessibilityColumnTitles( + &self, + accessibilityColumnTitles: Option<&NSArray>, + ); + + #[method(isAccessibilityOrderedByRow)] + pub unsafe fn isAccessibilityOrderedByRow(&self) -> bool; + + #[method(setAccessibilityOrderedByRow:)] + pub unsafe fn setAccessibilityOrderedByRow(&self, accessibilityOrderedByRow: bool); + + #[method(accessibilityHorizontalUnits)] + pub unsafe fn accessibilityHorizontalUnits(&self) -> NSAccessibilityUnits; + + #[method(setAccessibilityHorizontalUnits:)] + pub unsafe fn setAccessibilityHorizontalUnits( + &self, + accessibilityHorizontalUnits: NSAccessibilityUnits, + ); + + #[method(accessibilityVerticalUnits)] + pub unsafe fn accessibilityVerticalUnits(&self) -> NSAccessibilityUnits; + + #[method(setAccessibilityVerticalUnits:)] + pub unsafe fn setAccessibilityVerticalUnits( + &self, + accessibilityVerticalUnits: NSAccessibilityUnits, + ); + + #[method_id(@__retain_semantics Other accessibilityHorizontalUnitDescription)] + pub unsafe fn accessibilityHorizontalUnitDescription(&self) + -> Option>; + + #[method(setAccessibilityHorizontalUnitDescription:)] + pub unsafe fn setAccessibilityHorizontalUnitDescription( + &self, + accessibilityHorizontalUnitDescription: Option<&NSString>, + ); + + #[method_id(@__retain_semantics Other accessibilityVerticalUnitDescription)] + pub unsafe fn accessibilityVerticalUnitDescription(&self) -> Option>; + + #[method(setAccessibilityVerticalUnitDescription:)] + pub unsafe fn setAccessibilityVerticalUnitDescription( + &self, + accessibilityVerticalUnitDescription: Option<&NSString>, + ); + + #[method(accessibilityLayoutPointForScreenPoint:)] + pub unsafe fn accessibilityLayoutPointForScreenPoint(&self, point: NSPoint) -> NSPoint; + + #[method(accessibilityLayoutSizeForScreenSize:)] + pub unsafe fn accessibilityLayoutSizeForScreenSize(&self, size: NSSize) -> NSSize; + + #[method(accessibilityScreenPointForLayoutPoint:)] + pub unsafe fn accessibilityScreenPointForLayoutPoint(&self, point: NSPoint) -> NSPoint; + + #[method(accessibilityScreenSizeForLayoutSize:)] + pub unsafe fn accessibilityScreenSizeForLayoutSize(&self, size: NSSize) -> NSSize; + + #[method_id(@__retain_semantics Other accessibilityHandles)] + pub unsafe fn accessibilityHandles(&self) -> Option>; + + #[method(setAccessibilityHandles:)] + pub unsafe fn setAccessibilityHandles(&self, accessibilityHandles: Option<&NSArray>); + + #[method_id(@__retain_semantics Other accessibilityWarningValue)] + pub unsafe fn accessibilityWarningValue(&self) -> Option>; + + #[method(setAccessibilityWarningValue:)] + pub unsafe fn setAccessibilityWarningValue( + &self, + accessibilityWarningValue: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityCriticalValue)] + pub unsafe fn accessibilityCriticalValue(&self) -> Option>; + + #[method(setAccessibilityCriticalValue:)] + pub unsafe fn setAccessibilityCriticalValue( + &self, + accessibilityCriticalValue: Option<&Object>, + ); + + #[method(isAccessibilityDisclosed)] + pub unsafe fn isAccessibilityDisclosed(&self) -> bool; + + #[method(setAccessibilityDisclosed:)] + pub unsafe fn setAccessibilityDisclosed(&self, accessibilityDisclosed: bool); + + #[method_id(@__retain_semantics Other accessibilityDisclosedByRow)] + pub unsafe fn accessibilityDisclosedByRow(&self) -> Option>; + + #[method(setAccessibilityDisclosedByRow:)] + pub unsafe fn setAccessibilityDisclosedByRow( + &self, + accessibilityDisclosedByRow: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityDisclosedRows)] + pub unsafe fn accessibilityDisclosedRows(&self) -> Option>; + + #[method(setAccessibilityDisclosedRows:)] + pub unsafe fn setAccessibilityDisclosedRows( + &self, + accessibilityDisclosedRows: Option<&Object>, + ); + + #[method(accessibilityDisclosureLevel)] + pub unsafe fn accessibilityDisclosureLevel(&self) -> NSInteger; + + #[method(setAccessibilityDisclosureLevel:)] + pub unsafe fn setAccessibilityDisclosureLevel( + &self, + accessibilityDisclosureLevel: NSInteger, + ); + + #[method_id(@__retain_semantics Other accessibilityMarkerUIElements)] + pub unsafe fn accessibilityMarkerUIElements(&self) -> Option>; + + #[method(setAccessibilityMarkerUIElements:)] + pub unsafe fn setAccessibilityMarkerUIElements( + &self, + accessibilityMarkerUIElements: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilityMarkerValues)] + pub unsafe fn accessibilityMarkerValues(&self) -> Option>; + + #[method(setAccessibilityMarkerValues:)] + pub unsafe fn setAccessibilityMarkerValues( + &self, + accessibilityMarkerValues: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityMarkerGroupUIElement)] + pub unsafe fn accessibilityMarkerGroupUIElement(&self) -> Option>; + + #[method(setAccessibilityMarkerGroupUIElement:)] + pub unsafe fn setAccessibilityMarkerGroupUIElement( + &self, + accessibilityMarkerGroupUIElement: Option<&Object>, + ); + + #[method(accessibilityUnits)] + pub unsafe fn accessibilityUnits(&self) -> NSAccessibilityUnits; + + #[method(setAccessibilityUnits:)] + pub unsafe fn setAccessibilityUnits(&self, accessibilityUnits: NSAccessibilityUnits); + + #[method_id(@__retain_semantics Other accessibilityUnitDescription)] + pub unsafe fn accessibilityUnitDescription(&self) -> Option>; + + #[method(setAccessibilityUnitDescription:)] + pub unsafe fn setAccessibilityUnitDescription( + &self, + accessibilityUnitDescription: Option<&NSString>, + ); + + #[method(accessibilityRulerMarkerType)] + pub unsafe fn accessibilityRulerMarkerType(&self) -> NSAccessibilityRulerMarkerType; + + #[method(setAccessibilityRulerMarkerType:)] + pub unsafe fn setAccessibilityRulerMarkerType( + &self, + accessibilityRulerMarkerType: NSAccessibilityRulerMarkerType, + ); + + #[method_id(@__retain_semantics Other accessibilityMarkerTypeDescription)] + pub unsafe fn accessibilityMarkerTypeDescription(&self) -> Option>; + + #[method(setAccessibilityMarkerTypeDescription:)] + pub unsafe fn setAccessibilityMarkerTypeDescription( + &self, + accessibilityMarkerTypeDescription: Option<&NSString>, + ); + + #[method_id(@__retain_semantics Other accessibilityHorizontalScrollBar)] + pub unsafe fn accessibilityHorizontalScrollBar(&self) -> Option>; + + #[method(setAccessibilityHorizontalScrollBar:)] + pub unsafe fn setAccessibilityHorizontalScrollBar( + &self, + accessibilityHorizontalScrollBar: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityVerticalScrollBar)] + pub unsafe fn accessibilityVerticalScrollBar(&self) -> Option>; + + #[method(setAccessibilityVerticalScrollBar:)] + pub unsafe fn setAccessibilityVerticalScrollBar( + &self, + accessibilityVerticalScrollBar: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityAllowedValues)] + pub unsafe fn accessibilityAllowedValues(&self) -> Option, Shared>>; + + #[method(setAccessibilityAllowedValues:)] + pub unsafe fn setAccessibilityAllowedValues( + &self, + accessibilityAllowedValues: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilityLabelUIElements)] + pub unsafe fn accessibilityLabelUIElements(&self) -> Option>; + + #[method(setAccessibilityLabelUIElements:)] + pub unsafe fn setAccessibilityLabelUIElements( + &self, + accessibilityLabelUIElements: Option<&NSArray>, + ); + + #[method(accessibilityLabelValue)] + pub unsafe fn accessibilityLabelValue(&self) -> c_float; + + #[method(setAccessibilityLabelValue:)] + pub unsafe fn setAccessibilityLabelValue(&self, accessibilityLabelValue: c_float); + + #[method_id(@__retain_semantics Other accessibilitySplitters)] + pub unsafe fn accessibilitySplitters(&self) -> Option>; + + #[method(setAccessibilitySplitters:)] + pub unsafe fn setAccessibilitySplitters(&self, accessibilitySplitters: Option<&NSArray>); + + #[method_id(@__retain_semantics Other accessibilityDecrementButton)] + pub unsafe fn accessibilityDecrementButton(&self) -> Option>; + + #[method(setAccessibilityDecrementButton:)] + pub unsafe fn setAccessibilityDecrementButton( + &self, + accessibilityDecrementButton: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityIncrementButton)] + pub unsafe fn accessibilityIncrementButton(&self) -> Option>; + + #[method(setAccessibilityIncrementButton:)] + pub unsafe fn setAccessibilityIncrementButton( + &self, + accessibilityIncrementButton: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityTabs)] + pub unsafe fn accessibilityTabs(&self) -> Option>; + + #[method(setAccessibilityTabs:)] + pub unsafe fn setAccessibilityTabs(&self, accessibilityTabs: Option<&NSArray>); + + #[method_id(@__retain_semantics Other accessibilityHeader)] + pub unsafe fn accessibilityHeader(&self) -> Option>; + + #[method(setAccessibilityHeader:)] + pub unsafe fn setAccessibilityHeader(&self, accessibilityHeader: Option<&Object>); + + #[method(accessibilityColumnCount)] + pub unsafe fn accessibilityColumnCount(&self) -> NSInteger; + + #[method(setAccessibilityColumnCount:)] + pub unsafe fn setAccessibilityColumnCount(&self, accessibilityColumnCount: NSInteger); + + #[method(accessibilityRowCount)] + pub unsafe fn accessibilityRowCount(&self) -> NSInteger; + + #[method(setAccessibilityRowCount:)] + pub unsafe fn setAccessibilityRowCount(&self, accessibilityRowCount: NSInteger); + + #[method(accessibilityIndex)] + pub unsafe fn accessibilityIndex(&self) -> NSInteger; + + #[method(setAccessibilityIndex:)] + pub unsafe fn setAccessibilityIndex(&self, accessibilityIndex: NSInteger); + + #[method_id(@__retain_semantics Other accessibilityColumns)] + pub unsafe fn accessibilityColumns(&self) -> Option>; + + #[method(setAccessibilityColumns:)] + pub unsafe fn setAccessibilityColumns(&self, accessibilityColumns: Option<&NSArray>); + + #[method_id(@__retain_semantics Other accessibilityRows)] + pub unsafe fn accessibilityRows(&self) -> Option>; + + #[method(setAccessibilityRows:)] + pub unsafe fn setAccessibilityRows(&self, accessibilityRows: Option<&NSArray>); + + #[method_id(@__retain_semantics Other accessibilityVisibleRows)] + pub unsafe fn accessibilityVisibleRows(&self) -> Option>; + + #[method(setAccessibilityVisibleRows:)] + pub unsafe fn setAccessibilityVisibleRows( + &self, + accessibilityVisibleRows: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilitySelectedRows)] + pub unsafe fn accessibilitySelectedRows(&self) -> Option>; + + #[method(setAccessibilitySelectedRows:)] + pub unsafe fn setAccessibilitySelectedRows( + &self, + accessibilitySelectedRows: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilityVisibleColumns)] + pub unsafe fn accessibilityVisibleColumns(&self) -> Option>; + + #[method(setAccessibilityVisibleColumns:)] + pub unsafe fn setAccessibilityVisibleColumns( + &self, + accessibilityVisibleColumns: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilitySelectedColumns)] + pub unsafe fn accessibilitySelectedColumns(&self) -> Option>; + + #[method(setAccessibilitySelectedColumns:)] + pub unsafe fn setAccessibilitySelectedColumns( + &self, + accessibilitySelectedColumns: Option<&NSArray>, + ); + + #[method(accessibilitySortDirection)] + pub unsafe fn accessibilitySortDirection(&self) -> NSAccessibilitySortDirection; + + #[method(setAccessibilitySortDirection:)] + pub unsafe fn setAccessibilitySortDirection( + &self, + accessibilitySortDirection: NSAccessibilitySortDirection, + ); + + #[method_id(@__retain_semantics Other accessibilityRowHeaderUIElements)] + pub unsafe fn accessibilityRowHeaderUIElements(&self) -> Option>; + + #[method(setAccessibilityRowHeaderUIElements:)] + pub unsafe fn setAccessibilityRowHeaderUIElements( + &self, + accessibilityRowHeaderUIElements: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilitySelectedCells)] + pub unsafe fn accessibilitySelectedCells(&self) -> Option>; + + #[method(setAccessibilitySelectedCells:)] + pub unsafe fn setAccessibilitySelectedCells( + &self, + accessibilitySelectedCells: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilityVisibleCells)] + pub unsafe fn accessibilityVisibleCells(&self) -> Option>; + + #[method(setAccessibilityVisibleCells:)] + pub unsafe fn setAccessibilityVisibleCells( + &self, + accessibilityVisibleCells: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilityColumnHeaderUIElements)] + pub unsafe fn accessibilityColumnHeaderUIElements(&self) -> Option>; + + #[method(setAccessibilityColumnHeaderUIElements:)] + pub unsafe fn setAccessibilityColumnHeaderUIElements( + &self, + accessibilityColumnHeaderUIElements: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilityCellForColumn:row:)] + pub unsafe fn accessibilityCellForColumn_row( + &self, + column: NSInteger, + row: NSInteger, + ) -> Option>; + + #[method(accessibilityRowIndexRange)] + pub unsafe fn accessibilityRowIndexRange(&self) -> NSRange; + + #[method(setAccessibilityRowIndexRange:)] + pub unsafe fn setAccessibilityRowIndexRange(&self, accessibilityRowIndexRange: NSRange); + + #[method(accessibilityColumnIndexRange)] + pub unsafe fn accessibilityColumnIndexRange(&self) -> NSRange; + + #[method(setAccessibilityColumnIndexRange:)] + pub unsafe fn setAccessibilityColumnIndexRange( + &self, + accessibilityColumnIndexRange: NSRange, + ); + + #[method(accessibilityInsertionPointLineNumber)] + pub unsafe fn accessibilityInsertionPointLineNumber(&self) -> NSInteger; + + #[method(setAccessibilityInsertionPointLineNumber:)] + pub unsafe fn setAccessibilityInsertionPointLineNumber( + &self, + accessibilityInsertionPointLineNumber: NSInteger, + ); + + #[method(accessibilitySharedCharacterRange)] + pub unsafe fn accessibilitySharedCharacterRange(&self) -> NSRange; + + #[method(setAccessibilitySharedCharacterRange:)] + pub unsafe fn setAccessibilitySharedCharacterRange( + &self, + accessibilitySharedCharacterRange: NSRange, + ); + + #[method_id(@__retain_semantics Other accessibilitySharedTextUIElements)] + pub unsafe fn accessibilitySharedTextUIElements(&self) -> Option>; + + #[method(setAccessibilitySharedTextUIElements:)] + pub unsafe fn setAccessibilitySharedTextUIElements( + &self, + accessibilitySharedTextUIElements: Option<&NSArray>, + ); + + #[method(accessibilityVisibleCharacterRange)] + pub unsafe fn accessibilityVisibleCharacterRange(&self) -> NSRange; + + #[method(setAccessibilityVisibleCharacterRange:)] + pub unsafe fn setAccessibilityVisibleCharacterRange( + &self, + accessibilityVisibleCharacterRange: NSRange, + ); + + #[method(accessibilityNumberOfCharacters)] + pub unsafe fn accessibilityNumberOfCharacters(&self) -> NSInteger; + + #[method(setAccessibilityNumberOfCharacters:)] + pub unsafe fn setAccessibilityNumberOfCharacters( + &self, + accessibilityNumberOfCharacters: NSInteger, + ); + + #[method_id(@__retain_semantics Other accessibilitySelectedText)] + pub unsafe fn accessibilitySelectedText(&self) -> Option>; + + #[method(setAccessibilitySelectedText:)] + pub unsafe fn setAccessibilitySelectedText( + &self, + accessibilitySelectedText: Option<&NSString>, + ); + + #[method(accessibilitySelectedTextRange)] + pub unsafe fn accessibilitySelectedTextRange(&self) -> NSRange; + + #[method(setAccessibilitySelectedTextRange:)] + pub unsafe fn setAccessibilitySelectedTextRange( + &self, + accessibilitySelectedTextRange: NSRange, + ); + + #[method_id(@__retain_semantics Other accessibilitySelectedTextRanges)] + pub unsafe fn accessibilitySelectedTextRanges( + &self, + ) -> Option, Shared>>; + + #[method(setAccessibilitySelectedTextRanges:)] + pub unsafe fn setAccessibilitySelectedTextRanges( + &self, + accessibilitySelectedTextRanges: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other accessibilityAttributedStringForRange:)] + pub unsafe fn accessibilityAttributedStringForRange( + &self, + range: NSRange, + ) -> Option>; + + #[method(accessibilityRangeForLine:)] + pub unsafe fn accessibilityRangeForLine(&self, line: NSInteger) -> NSRange; + + #[method_id(@__retain_semantics Other accessibilityStringForRange:)] + pub unsafe fn accessibilityStringForRange( + &self, + range: NSRange, + ) -> Option>; + + #[method(accessibilityRangeForPosition:)] + pub unsafe fn accessibilityRangeForPosition(&self, point: NSPoint) -> NSRange; + + #[method(accessibilityRangeForIndex:)] + pub unsafe fn accessibilityRangeForIndex(&self, index: NSInteger) -> NSRange; + + #[method(accessibilityFrameForRange:)] + pub unsafe fn accessibilityFrameForRange(&self, range: NSRange) -> NSRect; + + #[method_id(@__retain_semantics Other accessibilityRTFForRange:)] + pub unsafe fn accessibilityRTFForRange(&self, range: NSRange) + -> Option>; + + #[method(accessibilityStyleRangeForIndex:)] + pub unsafe fn accessibilityStyleRangeForIndex(&self, index: NSInteger) -> NSRange; + + #[method(accessibilityLineForIndex:)] + pub unsafe fn accessibilityLineForIndex(&self, index: NSInteger) -> NSInteger; + + #[method_id(@__retain_semantics Other accessibilityToolbarButton)] + pub unsafe fn accessibilityToolbarButton(&self) -> Option>; + + #[method(setAccessibilityToolbarButton:)] + pub unsafe fn setAccessibilityToolbarButton( + &self, + accessibilityToolbarButton: Option<&Object>, + ); + + #[method(isAccessibilityModal)] + pub unsafe fn isAccessibilityModal(&self) -> bool; + + #[method(setAccessibilityModal:)] + pub unsafe fn setAccessibilityModal(&self, accessibilityModal: bool); + + #[method_id(@__retain_semantics Other accessibilityProxy)] + pub unsafe fn accessibilityProxy(&self) -> Option>; + + #[method(setAccessibilityProxy:)] + pub unsafe fn setAccessibilityProxy(&self, accessibilityProxy: Option<&Object>); + + #[method(isAccessibilityMain)] + pub unsafe fn isAccessibilityMain(&self) -> bool; + + #[method(setAccessibilityMain:)] + pub unsafe fn setAccessibilityMain(&self, accessibilityMain: bool); + + #[method_id(@__retain_semantics Other accessibilityFullScreenButton)] + pub unsafe fn accessibilityFullScreenButton(&self) -> Option>; + + #[method(setAccessibilityFullScreenButton:)] + pub unsafe fn setAccessibilityFullScreenButton( + &self, + accessibilityFullScreenButton: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityGrowArea)] + pub unsafe fn accessibilityGrowArea(&self) -> Option>; + + #[method(setAccessibilityGrowArea:)] + pub unsafe fn setAccessibilityGrowArea(&self, accessibilityGrowArea: Option<&Object>); + + #[method_id(@__retain_semantics Other accessibilityDocument)] + pub unsafe fn accessibilityDocument(&self) -> Option>; + + #[method(setAccessibilityDocument:)] + pub unsafe fn setAccessibilityDocument(&self, accessibilityDocument: Option<&NSString>); + + #[method_id(@__retain_semantics Other accessibilityDefaultButton)] + pub unsafe fn accessibilityDefaultButton(&self) -> Option>; + + #[method(setAccessibilityDefaultButton:)] + pub unsafe fn setAccessibilityDefaultButton( + &self, + accessibilityDefaultButton: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other accessibilityCloseButton)] + pub unsafe fn accessibilityCloseButton(&self) -> Option>; + + #[method(setAccessibilityCloseButton:)] + pub unsafe fn setAccessibilityCloseButton(&self, accessibilityCloseButton: Option<&Object>); + + #[method_id(@__retain_semantics Other accessibilityZoomButton)] + pub unsafe fn accessibilityZoomButton(&self) -> Option>; + + #[method(setAccessibilityZoomButton:)] + pub unsafe fn setAccessibilityZoomButton(&self, accessibilityZoomButton: Option<&Object>); + + #[method_id(@__retain_semantics Other accessibilityMinimizeButton)] + pub unsafe fn accessibilityMinimizeButton(&self) -> Option>; + + #[method(setAccessibilityMinimizeButton:)] + pub unsafe fn setAccessibilityMinimizeButton( + &self, + accessibilityMinimizeButton: Option<&Object>, + ); + + #[method(isAccessibilityMinimized)] + pub unsafe fn isAccessibilityMinimized(&self) -> bool; + + #[method(setAccessibilityMinimized:)] + pub unsafe fn setAccessibilityMinimized(&self, accessibilityMinimized: bool); + + #[method_id(@__retain_semantics Other accessibilityCustomActions)] + pub unsafe fn accessibilityCustomActions( + &self, + ) -> Option, Shared>>; + + #[method(setAccessibilityCustomActions:)] + pub unsafe fn setAccessibilityCustomActions( + &self, + accessibilityCustomActions: Option<&NSArray>, + ); + + #[method(accessibilityPerformCancel)] + pub unsafe fn accessibilityPerformCancel(&self) -> bool; + + #[method(accessibilityPerformConfirm)] + pub unsafe fn accessibilityPerformConfirm(&self) -> bool; + + #[method(accessibilityPerformDecrement)] + pub unsafe fn accessibilityPerformDecrement(&self) -> bool; + + #[method(accessibilityPerformDelete)] + pub unsafe fn accessibilityPerformDelete(&self) -> bool; + + #[method(accessibilityPerformIncrement)] + pub unsafe fn accessibilityPerformIncrement(&self) -> bool; + + #[method(accessibilityPerformPick)] + pub unsafe fn accessibilityPerformPick(&self) -> bool; + + #[method(accessibilityPerformPress)] + pub unsafe fn accessibilityPerformPress(&self) -> bool; + + #[method(accessibilityPerformRaise)] + pub unsafe fn accessibilityPerformRaise(&self) -> bool; + + #[method(accessibilityPerformShowAlternateUI)] + pub unsafe fn accessibilityPerformShowAlternateUI(&self) -> bool; + + #[method(accessibilityPerformShowDefaultUI)] + pub unsafe fn accessibilityPerformShowDefaultUI(&self) -> bool; + + #[method(accessibilityPerformShowMenu)] + pub unsafe fn accessibilityPerformShowMenu(&self) -> bool; + + #[method(isAccessibilitySelectorAllowed:)] + pub unsafe fn isAccessibilitySelectorAllowed(&self, selector: Sel) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSActionCell.rs b/crates/icrate/src/generated/AppKit/NSActionCell.rs new file mode 100644 index 000000000..116b7a406 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSActionCell.rs @@ -0,0 +1,37 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSActionCell; + + unsafe impl ClassType for NSActionCell { + type Super = NSCell; + } +); + +extern_methods!( + unsafe impl NSActionCell { + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: OptionSel); + + #[method(tag)] + pub unsafe fn tag(&self) -> NSInteger; + + #[method(setTag:)] + pub unsafe fn setTag(&self, tag: NSInteger); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSAffineTransform.rs b/crates/icrate/src/generated/AppKit/NSAffineTransform.rs new file mode 100644 index 000000000..2ba45c937 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAffineTransform.rs @@ -0,0 +1,20 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_methods!( + /// NSAppKitAdditions + unsafe impl NSAffineTransform { + #[method_id(@__retain_semantics Other transformBezierPath:)] + pub unsafe fn transformBezierPath(&self, path: &NSBezierPath) -> Id; + + #[method(set)] + pub unsafe fn set(&self); + + #[method(concat)] + pub unsafe fn concat(&self); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSAlert.rs b/crates/icrate/src/generated/AppKit/NSAlert.rs new file mode 100644 index 000000000..5ccc709a4 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAlert.rs @@ -0,0 +1,146 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSAlertStyle { + NSAlertStyleWarning = 0, + NSAlertStyleInformational = 1, + NSAlertStyleCritical = 2, + } +); + +extern_static!(NSAlertFirstButtonReturn: NSModalResponse = 1000); + +extern_static!(NSAlertSecondButtonReturn: NSModalResponse = 1001); + +extern_static!(NSAlertThirdButtonReturn: NSModalResponse = 1002); + +extern_class!( + #[derive(Debug)] + pub struct NSAlert; + + unsafe impl ClassType for NSAlert { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAlert { + #[method_id(@__retain_semantics Other alertWithError:)] + pub unsafe fn alertWithError(error: &NSError) -> Id; + + #[method_id(@__retain_semantics Other messageText)] + pub unsafe fn messageText(&self) -> Id; + + #[method(setMessageText:)] + pub unsafe fn setMessageText(&self, messageText: &NSString); + + #[method_id(@__retain_semantics Other informativeText)] + pub unsafe fn informativeText(&self) -> Id; + + #[method(setInformativeText:)] + pub unsafe fn setInformativeText(&self, informativeText: &NSString); + + #[method_id(@__retain_semantics Other icon)] + pub unsafe fn icon(&self) -> Option>; + + #[method(setIcon:)] + pub unsafe fn setIcon(&self, icon: Option<&NSImage>); + + #[method_id(@__retain_semantics Other addButtonWithTitle:)] + pub unsafe fn addButtonWithTitle(&self, title: &NSString) -> Id; + + #[method_id(@__retain_semantics Other buttons)] + pub unsafe fn buttons(&self) -> Id, Shared>; + + #[method(showsHelp)] + pub unsafe fn showsHelp(&self) -> bool; + + #[method(setShowsHelp:)] + pub unsafe fn setShowsHelp(&self, showsHelp: bool); + + #[method_id(@__retain_semantics Other helpAnchor)] + pub unsafe fn helpAnchor(&self) -> Option>; + + #[method(setHelpAnchor:)] + pub unsafe fn setHelpAnchor(&self, helpAnchor: Option<&NSHelpAnchorName>); + + #[method(alertStyle)] + pub unsafe fn alertStyle(&self) -> NSAlertStyle; + + #[method(setAlertStyle:)] + pub unsafe fn setAlertStyle(&self, alertStyle: NSAlertStyle); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSAlertDelegate>); + + #[method(showsSuppressionButton)] + pub unsafe fn showsSuppressionButton(&self) -> bool; + + #[method(setShowsSuppressionButton:)] + pub unsafe fn setShowsSuppressionButton(&self, showsSuppressionButton: bool); + + #[method_id(@__retain_semantics Other suppressionButton)] + pub unsafe fn suppressionButton(&self) -> Option>; + + #[method_id(@__retain_semantics Other accessoryView)] + pub unsafe fn accessoryView(&self) -> Option>; + + #[method(setAccessoryView:)] + pub unsafe fn setAccessoryView(&self, accessoryView: Option<&NSView>); + + #[method(layout)] + pub unsafe fn layout(&self); + + #[method(runModal)] + pub unsafe fn runModal(&self) -> NSModalResponse; + + #[method(beginSheetModalForWindow:completionHandler:)] + pub unsafe fn beginSheetModalForWindow_completionHandler( + &self, + sheetWindow: &NSWindow, + handler: Option<&Block<(NSModalResponse,), ()>>, + ); + + #[method_id(@__retain_semantics Other window)] + pub unsafe fn window(&self) -> Id; + } +); + +extern_protocol!( + pub struct NSAlertDelegate; + + unsafe impl NSAlertDelegate { + #[optional] + #[method(alertShowHelp:)] + pub unsafe fn alertShowHelp(&self, alert: &NSAlert) -> bool; + } +); + +extern_methods!( + /// NSAlertDeprecated + unsafe impl NSAlert { + #[method(beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:)] + pub unsafe fn beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo( + &self, + window: &NSWindow, + delegate: Option<&Object>, + didEndSelector: OptionSel, + contextInfo: *mut c_void, + ); + } +); + +extern_static!(NSWarningAlertStyle: NSAlertStyle = NSAlertStyleWarning); + +extern_static!(NSInformationalAlertStyle: NSAlertStyle = NSAlertStyleInformational); + +extern_static!(NSCriticalAlertStyle: NSAlertStyle = NSAlertStyleCritical); diff --git a/crates/icrate/src/generated/AppKit/NSAlignmentFeedbackFilter.rs b/crates/icrate/src/generated/AppKit/NSAlignmentFeedbackFilter.rs new file mode 100644 index 000000000..b60f56368 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAlignmentFeedbackFilter.rs @@ -0,0 +1,68 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSAlignmentFeedbackToken; + + unsafe impl NSAlignmentFeedbackToken {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSAlignmentFeedbackFilter; + + unsafe impl ClassType for NSAlignmentFeedbackFilter { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAlignmentFeedbackFilter { + #[method(inputEventMask)] + pub unsafe fn inputEventMask() -> NSEventMask; + + #[method(updateWithEvent:)] + pub unsafe fn updateWithEvent(&self, event: &NSEvent); + + #[method(updateWithPanRecognizer:)] + pub unsafe fn updateWithPanRecognizer(&self, panRecognizer: &NSPanGestureRecognizer); + + #[method_id(@__retain_semantics Other alignmentFeedbackTokenForMovementInView:previousPoint:alignedPoint:defaultPoint:)] + pub unsafe fn alignmentFeedbackTokenForMovementInView_previousPoint_alignedPoint_defaultPoint( + &self, + view: Option<&NSView>, + previousPoint: NSPoint, + alignedPoint: NSPoint, + defaultPoint: NSPoint, + ) -> Option>; + + #[method_id(@__retain_semantics Other alignmentFeedbackTokenForHorizontalMovementInView:previousX:alignedX:defaultX:)] + pub unsafe fn alignmentFeedbackTokenForHorizontalMovementInView_previousX_alignedX_defaultX( + &self, + view: Option<&NSView>, + previousX: CGFloat, + alignedX: CGFloat, + defaultX: CGFloat, + ) -> Option>; + + #[method_id(@__retain_semantics Other alignmentFeedbackTokenForVerticalMovementInView:previousY:alignedY:defaultY:)] + pub unsafe fn alignmentFeedbackTokenForVerticalMovementInView_previousY_alignedY_defaultY( + &self, + view: Option<&NSView>, + previousY: CGFloat, + alignedY: CGFloat, + defaultY: CGFloat, + ) -> Option>; + + #[method(performFeedback:performanceTime:)] + pub unsafe fn performFeedback_performanceTime( + &self, + alignmentFeedbackTokens: &NSArray, + performanceTime: NSHapticFeedbackPerformanceTime, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSAnimation.rs b/crates/icrate/src/generated/AppKit/NSAnimation.rs new file mode 100644 index 000000000..52f470258 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAnimation.rs @@ -0,0 +1,261 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSAnimationCurve { + NSAnimationEaseInOut = 0, + NSAnimationEaseIn = 1, + NSAnimationEaseOut = 2, + NSAnimationLinear = 3, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSAnimationBlockingMode { + NSAnimationBlocking = 0, + NSAnimationNonblocking = 1, + NSAnimationNonblockingThreaded = 2, + } +); + +pub type NSAnimationProgress = c_float; + +extern_static!(NSAnimationProgressMarkNotification: &'static NSNotificationName); + +extern_static!(NSAnimationProgressMark: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSAnimation; + + unsafe impl ClassType for NSAnimation { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAnimation { + #[method_id(@__retain_semantics Init initWithDuration:animationCurve:)] + pub unsafe fn initWithDuration_animationCurve( + this: Option>, + duration: NSTimeInterval, + animationCurve: NSAnimationCurve, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method(startAnimation)] + pub unsafe fn startAnimation(&self); + + #[method(stopAnimation)] + pub unsafe fn stopAnimation(&self); + + #[method(isAnimating)] + pub unsafe fn isAnimating(&self) -> bool; + + #[method(currentProgress)] + pub unsafe fn currentProgress(&self) -> NSAnimationProgress; + + #[method(setCurrentProgress:)] + pub unsafe fn setCurrentProgress(&self, currentProgress: NSAnimationProgress); + + #[method(duration)] + pub unsafe fn duration(&self) -> NSTimeInterval; + + #[method(setDuration:)] + pub unsafe fn setDuration(&self, duration: NSTimeInterval); + + #[method(animationBlockingMode)] + pub unsafe fn animationBlockingMode(&self) -> NSAnimationBlockingMode; + + #[method(setAnimationBlockingMode:)] + pub unsafe fn setAnimationBlockingMode( + &self, + animationBlockingMode: NSAnimationBlockingMode, + ); + + #[method(frameRate)] + pub unsafe fn frameRate(&self) -> c_float; + + #[method(setFrameRate:)] + pub unsafe fn setFrameRate(&self, frameRate: c_float); + + #[method(animationCurve)] + pub unsafe fn animationCurve(&self) -> NSAnimationCurve; + + #[method(setAnimationCurve:)] + pub unsafe fn setAnimationCurve(&self, animationCurve: NSAnimationCurve); + + #[method(currentValue)] + pub unsafe fn currentValue(&self) -> c_float; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSAnimationDelegate>); + + #[method_id(@__retain_semantics Other progressMarks)] + pub unsafe fn progressMarks(&self) -> Id, Shared>; + + #[method(setProgressMarks:)] + pub unsafe fn setProgressMarks(&self, progressMarks: &NSArray); + + #[method(addProgressMark:)] + pub unsafe fn addProgressMark(&self, progressMark: NSAnimationProgress); + + #[method(removeProgressMark:)] + pub unsafe fn removeProgressMark(&self, progressMark: NSAnimationProgress); + + #[method(startWhenAnimation:reachesProgress:)] + pub unsafe fn startWhenAnimation_reachesProgress( + &self, + animation: &NSAnimation, + startProgress: NSAnimationProgress, + ); + + #[method(stopWhenAnimation:reachesProgress:)] + pub unsafe fn stopWhenAnimation_reachesProgress( + &self, + animation: &NSAnimation, + stopProgress: NSAnimationProgress, + ); + + #[method(clearStartAnimation)] + pub unsafe fn clearStartAnimation(&self); + + #[method(clearStopAnimation)] + pub unsafe fn clearStopAnimation(&self); + + #[method_id(@__retain_semantics Other runLoopModesForAnimating)] + pub unsafe fn runLoopModesForAnimating(&self) + -> Option, Shared>>; + } +); + +extern_protocol!( + pub struct NSAnimationDelegate; + + unsafe impl NSAnimationDelegate { + #[optional] + #[method(animationShouldStart:)] + pub unsafe fn animationShouldStart(&self, animation: &NSAnimation) -> bool; + + #[optional] + #[method(animationDidStop:)] + pub unsafe fn animationDidStop(&self, animation: &NSAnimation); + + #[optional] + #[method(animationDidEnd:)] + pub unsafe fn animationDidEnd(&self, animation: &NSAnimation); + + #[optional] + #[method(animation:valueForProgress:)] + pub unsafe fn animation_valueForProgress( + &self, + animation: &NSAnimation, + progress: NSAnimationProgress, + ) -> c_float; + + #[optional] + #[method(animation:didReachProgressMark:)] + pub unsafe fn animation_didReachProgressMark( + &self, + animation: &NSAnimation, + progress: NSAnimationProgress, + ); + } +); + +pub type NSViewAnimationKey = NSString; + +extern_static!(NSViewAnimationTargetKey: &'static NSViewAnimationKey); + +extern_static!(NSViewAnimationStartFrameKey: &'static NSViewAnimationKey); + +extern_static!(NSViewAnimationEndFrameKey: &'static NSViewAnimationKey); + +extern_static!(NSViewAnimationEffectKey: &'static NSViewAnimationKey); + +pub type NSViewAnimationEffectName = NSString; + +extern_static!(NSViewAnimationFadeInEffect: &'static NSViewAnimationEffectName); + +extern_static!(NSViewAnimationFadeOutEffect: &'static NSViewAnimationEffectName); + +extern_class!( + #[derive(Debug)] + pub struct NSViewAnimation; + + unsafe impl ClassType for NSViewAnimation { + type Super = NSAnimation; + } +); + +extern_methods!( + unsafe impl NSViewAnimation { + #[method_id(@__retain_semantics Init initWithViewAnimations:)] + pub unsafe fn initWithViewAnimations( + this: Option>, + viewAnimations: &NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Other viewAnimations)] + pub unsafe fn viewAnimations( + &self, + ) -> Id>, Shared>; + + #[method(setViewAnimations:)] + pub unsafe fn setViewAnimations( + &self, + viewAnimations: &NSArray>, + ); + } +); + +pub type NSAnimatablePropertyKey = NSString; + +extern_protocol!( + pub struct NSAnimatablePropertyContainer; + + unsafe impl NSAnimatablePropertyContainer { + #[method_id(@__retain_semantics Other animator)] + pub unsafe fn animator(&self) -> Id; + + #[method_id(@__retain_semantics Other animations)] + pub unsafe fn animations( + &self, + ) -> Id, Shared>; + + #[method(setAnimations:)] + pub unsafe fn setAnimations( + &self, + animations: &NSDictionary, + ); + + #[method_id(@__retain_semantics Other animationForKey:)] + pub unsafe fn animationForKey( + &self, + key: &NSAnimatablePropertyKey, + ) -> Option>; + + #[method_id(@__retain_semantics Other defaultAnimationForKey:)] + pub unsafe fn defaultAnimationForKey( + key: &NSAnimatablePropertyKey, + ) -> Option>; + } +); + +extern_static!(NSAnimationTriggerOrderIn: &'static NSAnimatablePropertyKey); + +extern_static!(NSAnimationTriggerOrderOut: &'static NSAnimatablePropertyKey); diff --git a/crates/icrate/src/generated/AppKit/NSAnimationContext.rs b/crates/icrate/src/generated/AppKit/NSAnimationContext.rs new file mode 100644 index 000000000..61616be31 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAnimationContext.rs @@ -0,0 +1,55 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSAnimationContext; + + unsafe impl ClassType for NSAnimationContext { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAnimationContext { + #[method(runAnimationGroup:completionHandler:)] + pub unsafe fn runAnimationGroup_completionHandler( + changes: &Block<(NonNull,), ()>, + completionHandler: Option<&Block<(), ()>>, + ); + + #[method(runAnimationGroup:)] + pub unsafe fn runAnimationGroup(changes: &Block<(NonNull,), ()>); + + #[method(beginGrouping)] + pub unsafe fn beginGrouping(); + + #[method(endGrouping)] + pub unsafe fn endGrouping(); + + #[method_id(@__retain_semantics Other currentContext)] + pub unsafe fn currentContext() -> Id; + + #[method(duration)] + pub unsafe fn duration(&self) -> NSTimeInterval; + + #[method(setDuration:)] + pub unsafe fn setDuration(&self, duration: NSTimeInterval); + + #[method(completionHandler)] + pub unsafe fn completionHandler(&self) -> *mut Block<(), ()>; + + #[method(setCompletionHandler:)] + pub unsafe fn setCompletionHandler(&self, completionHandler: Option<&Block<(), ()>>); + + #[method(allowsImplicitAnimation)] + pub unsafe fn allowsImplicitAnimation(&self) -> bool; + + #[method(setAllowsImplicitAnimation:)] + pub unsafe fn setAllowsImplicitAnimation(&self, allowsImplicitAnimation: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSAppearance.rs b/crates/icrate/src/generated/AppKit/NSAppearance.rs new file mode 100644 index 000000000..d7fb4a81d --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAppearance.rs @@ -0,0 +1,94 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSAppearanceName = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSAppearance; + + unsafe impl ClassType for NSAppearance { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAppearance { + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other currentAppearance)] + pub unsafe fn currentAppearance() -> Option>; + + #[method(setCurrentAppearance:)] + pub unsafe fn setCurrentAppearance(currentAppearance: Option<&NSAppearance>); + + #[method_id(@__retain_semantics Other currentDrawingAppearance)] + pub unsafe fn currentDrawingAppearance() -> Id; + + #[method(performAsCurrentDrawingAppearance:)] + pub unsafe fn performAsCurrentDrawingAppearance(&self, block: &Block<(), ()>); + + #[method_id(@__retain_semantics Other appearanceNamed:)] + pub unsafe fn appearanceNamed(name: &NSAppearanceName) -> Option>; + + #[method_id(@__retain_semantics Init initWithAppearanceNamed:bundle:)] + pub unsafe fn initWithAppearanceNamed_bundle( + this: Option>, + name: &NSAppearanceName, + bundle: Option<&NSBundle>, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method(allowsVibrancy)] + pub unsafe fn allowsVibrancy(&self) -> bool; + + #[method_id(@__retain_semantics Other bestMatchFromAppearancesWithNames:)] + pub unsafe fn bestMatchFromAppearancesWithNames( + &self, + appearances: &NSArray, + ) -> Option>; + } +); + +extern_static!(NSAppearanceNameAqua: &'static NSAppearanceName); + +extern_static!(NSAppearanceNameDarkAqua: &'static NSAppearanceName); + +extern_static!(NSAppearanceNameLightContent: &'static NSAppearanceName); + +extern_static!(NSAppearanceNameVibrantDark: &'static NSAppearanceName); + +extern_static!(NSAppearanceNameVibrantLight: &'static NSAppearanceName); + +extern_static!(NSAppearanceNameAccessibilityHighContrastAqua: &'static NSAppearanceName); + +extern_static!(NSAppearanceNameAccessibilityHighContrastDarkAqua: &'static NSAppearanceName); + +extern_static!(NSAppearanceNameAccessibilityHighContrastVibrantLight: &'static NSAppearanceName); + +extern_static!(NSAppearanceNameAccessibilityHighContrastVibrantDark: &'static NSAppearanceName); + +extern_protocol!( + pub struct NSAppearanceCustomization; + + unsafe impl NSAppearanceCustomization { + #[method_id(@__retain_semantics Other appearance)] + pub unsafe fn appearance(&self) -> Option>; + + #[method(setAppearance:)] + pub unsafe fn setAppearance(&self, appearance: Option<&NSAppearance>); + + #[method_id(@__retain_semantics Other effectiveAppearance)] + pub unsafe fn effectiveAppearance(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSAppleScriptExtensions.rs b/crates/icrate/src/generated/AppKit/NSAppleScriptExtensions.rs new file mode 100644 index 000000000..8189b16ed --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAppleScriptExtensions.rs @@ -0,0 +1,14 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_methods!( + /// NSExtensions + unsafe impl NSAppleScript { + #[method_id(@__retain_semantics Other richTextSource)] + pub unsafe fn richTextSource(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSApplication.rs b/crates/icrate/src/generated/AppKit/NSApplication.rs new file mode 100644 index 000000000..75f1fdcce --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSApplication.rs @@ -0,0 +1,1099 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSAppKitVersion = c_double; + +extern_static!(NSAppKitVersionNumber: NSAppKitVersion); + +extern_static!(NSAppKitVersionNumber10_0: NSAppKitVersion = 577); + +extern_static!(NSAppKitVersionNumber10_1: NSAppKitVersion = 620); + +extern_static!(NSAppKitVersionNumber10_2: NSAppKitVersion = 663); + +extern_static!(NSAppKitVersionNumber10_2_3: NSAppKitVersion = 663.6); + +extern_static!(NSAppKitVersionNumber10_3: NSAppKitVersion = 743); + +extern_static!(NSAppKitVersionNumber10_3_2: NSAppKitVersion = 743.14); + +extern_static!(NSAppKitVersionNumber10_3_3: NSAppKitVersion = 743.2); + +extern_static!(NSAppKitVersionNumber10_3_5: NSAppKitVersion = 743.24); + +extern_static!(NSAppKitVersionNumber10_3_7: NSAppKitVersion = 743.33); + +extern_static!(NSAppKitVersionNumber10_3_9: NSAppKitVersion = 743.36); + +extern_static!(NSAppKitVersionNumber10_4: NSAppKitVersion = 824); + +extern_static!(NSAppKitVersionNumber10_4_1: NSAppKitVersion = 824.1); + +extern_static!(NSAppKitVersionNumber10_4_3: NSAppKitVersion = 824.23); + +extern_static!(NSAppKitVersionNumber10_4_4: NSAppKitVersion = 824.33); + +extern_static!(NSAppKitVersionNumber10_4_7: NSAppKitVersion = 824.41); + +extern_static!(NSAppKitVersionNumber10_5: NSAppKitVersion = 949); + +extern_static!(NSAppKitVersionNumber10_5_2: NSAppKitVersion = 949.27); + +extern_static!(NSAppKitVersionNumber10_5_3: NSAppKitVersion = 949.33); + +extern_static!(NSAppKitVersionNumber10_6: NSAppKitVersion = 1038); + +extern_static!(NSAppKitVersionNumber10_7: NSAppKitVersion = 1138); + +extern_static!(NSAppKitVersionNumber10_7_2: NSAppKitVersion = 1138.23); + +extern_static!(NSAppKitVersionNumber10_7_3: NSAppKitVersion = 1138.32); + +extern_static!(NSAppKitVersionNumber10_7_4: NSAppKitVersion = 1138.47); + +extern_static!(NSAppKitVersionNumber10_8: NSAppKitVersion = 1187); + +extern_static!(NSAppKitVersionNumber10_9: NSAppKitVersion = 1265); + +extern_static!(NSAppKitVersionNumber10_10: NSAppKitVersion = 1343); + +extern_static!(NSAppKitVersionNumber10_10_2: NSAppKitVersion = 1344); + +extern_static!(NSAppKitVersionNumber10_10_3: NSAppKitVersion = 1347); + +extern_static!(NSAppKitVersionNumber10_10_4: NSAppKitVersion = 1348); + +extern_static!(NSAppKitVersionNumber10_10_5: NSAppKitVersion = 1348); + +extern_static!(NSAppKitVersionNumber10_10_Max: NSAppKitVersion = 1349); + +extern_static!(NSAppKitVersionNumber10_11: NSAppKitVersion = 1404); + +extern_static!(NSAppKitVersionNumber10_11_1: NSAppKitVersion = 1404.13); + +extern_static!(NSAppKitVersionNumber10_11_2: NSAppKitVersion = 1404.34); + +extern_static!(NSAppKitVersionNumber10_11_3: NSAppKitVersion = 1404.34); + +extern_static!(NSAppKitVersionNumber10_12: NSAppKitVersion = 1504); + +extern_static!(NSAppKitVersionNumber10_12_1: NSAppKitVersion = 1504.60); + +extern_static!(NSAppKitVersionNumber10_12_2: NSAppKitVersion = 1504.76); + +extern_static!(NSAppKitVersionNumber10_13: NSAppKitVersion = 1561); + +extern_static!(NSAppKitVersionNumber10_13_1: NSAppKitVersion = 1561.1); + +extern_static!(NSAppKitVersionNumber10_13_2: NSAppKitVersion = 1561.2); + +extern_static!(NSAppKitVersionNumber10_13_4: NSAppKitVersion = 1561.4); + +extern_static!(NSAppKitVersionNumber10_14: NSAppKitVersion = 1671); + +extern_static!(NSAppKitVersionNumber10_14_1: NSAppKitVersion = 1671.1); + +extern_static!(NSAppKitVersionNumber10_14_2: NSAppKitVersion = 1671.2); + +extern_static!(NSAppKitVersionNumber10_14_3: NSAppKitVersion = 1671.3); + +extern_static!(NSAppKitVersionNumber10_14_4: NSAppKitVersion = 1671.4); + +extern_static!(NSAppKitVersionNumber10_14_5: NSAppKitVersion = 1671.5); + +extern_static!(NSAppKitVersionNumber10_15: NSAppKitVersion = 1894); + +extern_static!(NSAppKitVersionNumber10_15_1: NSAppKitVersion = 1894.1); + +extern_static!(NSAppKitVersionNumber10_15_2: NSAppKitVersion = 1894.2); + +extern_static!(NSAppKitVersionNumber10_15_3: NSAppKitVersion = 1894.3); + +extern_static!(NSAppKitVersionNumber10_15_4: NSAppKitVersion = 1894.4); + +extern_static!(NSAppKitVersionNumber10_15_5: NSAppKitVersion = 1894.5); + +extern_static!(NSAppKitVersionNumber10_15_6: NSAppKitVersion = 1894.6); + +extern_static!(NSAppKitVersionNumber11_0: NSAppKitVersion = 2022); + +extern_static!(NSAppKitVersionNumber11_1: NSAppKitVersion = 2022.2); + +extern_static!(NSAppKitVersionNumber11_2: NSAppKitVersion = 2022.3); + +extern_static!(NSAppKitVersionNumber11_3: NSAppKitVersion = 2022.4); + +extern_static!(NSAppKitVersionNumber11_4: NSAppKitVersion = 2022.5); + +extern_static!(NSModalPanelRunLoopMode: &'static NSRunLoopMode); + +extern_static!(NSEventTrackingRunLoopMode: &'static NSRunLoopMode); + +pub type NSModalResponse = NSInteger; + +extern_static!(NSModalResponseStop: NSModalResponse = -1000); + +extern_static!(NSModalResponseAbort: NSModalResponse = -1001); + +extern_static!(NSModalResponseContinue: NSModalResponse = -1002); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSUpdateWindowsRunLoopOrdering = 500000, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSApplicationPresentationOptions { + NSApplicationPresentationDefault = 0, + NSApplicationPresentationAutoHideDock = 1 << 0, + NSApplicationPresentationHideDock = 1 << 1, + NSApplicationPresentationAutoHideMenuBar = 1 << 2, + NSApplicationPresentationHideMenuBar = 1 << 3, + NSApplicationPresentationDisableAppleMenu = 1 << 4, + NSApplicationPresentationDisableProcessSwitching = 1 << 5, + NSApplicationPresentationDisableForceQuit = 1 << 6, + NSApplicationPresentationDisableSessionTermination = 1 << 7, + NSApplicationPresentationDisableHideApplication = 1 << 8, + NSApplicationPresentationDisableMenuBarTransparency = 1 << 9, + NSApplicationPresentationFullScreen = 1 << 10, + NSApplicationPresentationAutoHideToolbar = 1 << 11, + NSApplicationPresentationDisableCursorLocationAssistance = 1 << 12, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSApplicationOcclusionState { + NSApplicationOcclusionStateVisible = 1 << 1, + } +); + +ns_options!( + #[underlying(NSInteger)] + pub enum NSWindowListOptions { + NSWindowListOrderedFrontToBack = 1 << 0, + } +); + +pub type NSModalSession = *mut c_void; + +extern_static!(NSApp: Option<&'static NSApplication>); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSRequestUserAttentionType { + NSCriticalRequest = 0, + NSInformationalRequest = 10, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSApplicationDelegateReply { + NSApplicationDelegateReplySuccess = 0, + NSApplicationDelegateReplyCancel = 1, + NSApplicationDelegateReplyFailure = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSApplication; + + unsafe impl ClassType for NSApplication { + type Super = NSResponder; + } +); + +extern_methods!( + unsafe impl NSApplication { + #[method_id(@__retain_semantics Other sharedApplication)] + pub unsafe fn sharedApplication() -> Id; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSApplicationDelegate>); + + #[method(hide:)] + pub unsafe fn hide(&self, sender: Option<&Object>); + + #[method(unhide:)] + pub unsafe fn unhide(&self, sender: Option<&Object>); + + #[method(unhideWithoutActivation)] + pub unsafe fn unhideWithoutActivation(&self); + + #[method_id(@__retain_semantics Other windowWithWindowNumber:)] + pub unsafe fn windowWithWindowNumber( + &self, + windowNum: NSInteger, + ) -> Option>; + + #[method_id(@__retain_semantics Other mainWindow)] + pub unsafe fn mainWindow(&self) -> Option>; + + #[method_id(@__retain_semantics Other keyWindow)] + pub unsafe fn keyWindow(&self) -> Option>; + + #[method(isActive)] + pub unsafe fn isActive(&self) -> bool; + + #[method(isHidden)] + pub unsafe fn isHidden(&self) -> bool; + + #[method(isRunning)] + pub unsafe fn isRunning(&self) -> bool; + + #[method(deactivate)] + pub unsafe fn deactivate(&self); + + #[method(activateIgnoringOtherApps:)] + pub unsafe fn activateIgnoringOtherApps(&self, flag: bool); + + #[method(hideOtherApplications:)] + pub unsafe fn hideOtherApplications(&self, sender: Option<&Object>); + + #[method(unhideAllApplications:)] + pub unsafe fn unhideAllApplications(&self, sender: Option<&Object>); + + #[method(finishLaunching)] + pub unsafe fn finishLaunching(&self); + + #[method(run)] + pub unsafe fn run(&self); + + #[method(runModalForWindow:)] + pub unsafe fn runModalForWindow(&self, window: &NSWindow) -> NSModalResponse; + + #[method(stop:)] + pub unsafe fn stop(&self, sender: Option<&Object>); + + #[method(stopModal)] + pub unsafe fn stopModal(&self); + + #[method(stopModalWithCode:)] + pub unsafe fn stopModalWithCode(&self, returnCode: NSModalResponse); + + #[method(abortModal)] + pub unsafe fn abortModal(&self); + + #[method_id(@__retain_semantics Other modalWindow)] + pub unsafe fn modalWindow(&self) -> Option>; + + #[method(beginModalSessionForWindow:)] + pub unsafe fn beginModalSessionForWindow(&self, window: &NSWindow) -> NSModalSession; + + #[method(runModalSession:)] + pub unsafe fn runModalSession(&self, session: NSModalSession) -> NSModalResponse; + + #[method(endModalSession:)] + pub unsafe fn endModalSession(&self, session: NSModalSession); + + #[method(terminate:)] + pub unsafe fn terminate(&self, sender: Option<&Object>); + + #[method(requestUserAttention:)] + pub unsafe fn requestUserAttention( + &self, + requestType: NSRequestUserAttentionType, + ) -> NSInteger; + + #[method(cancelUserAttentionRequest:)] + pub unsafe fn cancelUserAttentionRequest(&self, request: NSInteger); + + #[method(enumerateWindowsWithOptions:usingBlock:)] + pub unsafe fn enumerateWindowsWithOptions_usingBlock( + &self, + options: NSWindowListOptions, + block: &Block<(NonNull, NonNull), ()>, + ); + + #[method(preventWindowOrdering)] + pub unsafe fn preventWindowOrdering(&self); + + #[method_id(@__retain_semantics Other windows)] + pub unsafe fn windows(&self) -> Id, Shared>; + + #[method(setWindowsNeedUpdate:)] + pub unsafe fn setWindowsNeedUpdate(&self, needUpdate: bool); + + #[method(updateWindows)] + pub unsafe fn updateWindows(&self); + + #[method_id(@__retain_semantics Other mainMenu)] + pub unsafe fn mainMenu(&self) -> Option>; + + #[method(setMainMenu:)] + pub unsafe fn setMainMenu(&self, mainMenu: Option<&NSMenu>); + + #[method_id(@__retain_semantics Other helpMenu)] + pub unsafe fn helpMenu(&self) -> Option>; + + #[method(setHelpMenu:)] + pub unsafe fn setHelpMenu(&self, helpMenu: Option<&NSMenu>); + + #[method_id(@__retain_semantics Other applicationIconImage)] + pub unsafe fn applicationIconImage(&self) -> Option>; + + #[method(setApplicationIconImage:)] + pub unsafe fn setApplicationIconImage(&self, applicationIconImage: Option<&NSImage>); + + #[method(activationPolicy)] + pub unsafe fn activationPolicy(&self) -> NSApplicationActivationPolicy; + + #[method(setActivationPolicy:)] + pub unsafe fn setActivationPolicy( + &self, + activationPolicy: NSApplicationActivationPolicy, + ) -> bool; + + #[method_id(@__retain_semantics Other dockTile)] + pub unsafe fn dockTile(&self) -> Id; + + #[method(reportException:)] + pub unsafe fn reportException(&self, exception: &NSException); + + #[method(detachDrawingThread:toTarget:withObject:)] + pub unsafe fn detachDrawingThread_toTarget_withObject( + selector: Sel, + target: &Object, + argument: Option<&Object>, + ); + + #[method(replyToApplicationShouldTerminate:)] + pub unsafe fn replyToApplicationShouldTerminate(&self, shouldTerminate: bool); + + #[method(replyToOpenOrPrint:)] + pub unsafe fn replyToOpenOrPrint(&self, reply: NSApplicationDelegateReply); + + #[method(orderFrontCharacterPalette:)] + pub unsafe fn orderFrontCharacterPalette(&self, sender: Option<&Object>); + + #[method(presentationOptions)] + pub unsafe fn presentationOptions(&self) -> NSApplicationPresentationOptions; + + #[method(setPresentationOptions:)] + pub unsafe fn setPresentationOptions( + &self, + presentationOptions: NSApplicationPresentationOptions, + ); + + #[method(currentSystemPresentationOptions)] + pub unsafe fn currentSystemPresentationOptions(&self) -> NSApplicationPresentationOptions; + + #[method(occlusionState)] + pub unsafe fn occlusionState(&self) -> NSApplicationOcclusionState; + + #[method(isProtectedDataAvailable)] + pub unsafe fn isProtectedDataAvailable(&self) -> bool; + } +); + +extern_methods!( + /// NSAppearanceCustomization + unsafe impl NSApplication { + #[method_id(@__retain_semantics Other appearance)] + pub unsafe fn appearance(&self) -> Option>; + + #[method(setAppearance:)] + pub unsafe fn setAppearance(&self, appearance: Option<&NSAppearance>); + + #[method_id(@__retain_semantics Other effectiveAppearance)] + pub unsafe fn effectiveAppearance(&self) -> Id; + } +); + +extern_methods!( + /// NSEvent + unsafe impl NSApplication { + #[method(sendEvent:)] + pub unsafe fn sendEvent(&self, event: &NSEvent); + + #[method(postEvent:atStart:)] + pub unsafe fn postEvent_atStart(&self, event: &NSEvent, flag: bool); + + #[method_id(@__retain_semantics Other currentEvent)] + pub unsafe fn currentEvent(&self) -> Option>; + + #[method_id(@__retain_semantics Other nextEventMatchingMask:untilDate:inMode:dequeue:)] + pub unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue( + &self, + mask: NSEventMask, + expiration: Option<&NSDate>, + mode: &NSRunLoopMode, + deqFlag: bool, + ) -> Option>; + + #[method(discardEventsMatchingMask:beforeEvent:)] + pub unsafe fn discardEventsMatchingMask_beforeEvent( + &self, + mask: NSEventMask, + lastEvent: Option<&NSEvent>, + ); + } +); + +extern_methods!( + /// NSResponder + unsafe impl NSApplication { + #[method(sendAction:to:from:)] + pub unsafe fn sendAction_to_from( + &self, + action: Sel, + target: Option<&Object>, + sender: Option<&Object>, + ) -> bool; + + #[method_id(@__retain_semantics Other targetForAction:)] + pub unsafe fn targetForAction(&self, action: Sel) -> Option>; + + #[method_id(@__retain_semantics Other targetForAction:to:from:)] + pub unsafe fn targetForAction_to_from( + &self, + action: Sel, + target: Option<&Object>, + sender: Option<&Object>, + ) -> Option>; + + #[method(tryToPerform:with:)] + pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&Object>) -> bool; + + #[method_id(@__retain_semantics Other validRequestorForSendType:returnType:)] + pub unsafe fn validRequestorForSendType_returnType( + &self, + sendType: Option<&NSPasteboardType>, + returnType: Option<&NSPasteboardType>, + ) -> Option>; + } +); + +extern_methods!( + /// NSWindowsMenu + unsafe impl NSApplication { + #[method_id(@__retain_semantics Other windowsMenu)] + pub unsafe fn windowsMenu(&self) -> Option>; + + #[method(setWindowsMenu:)] + pub unsafe fn setWindowsMenu(&self, windowsMenu: Option<&NSMenu>); + + #[method(arrangeInFront:)] + pub unsafe fn arrangeInFront(&self, sender: Option<&Object>); + + #[method(removeWindowsItem:)] + pub unsafe fn removeWindowsItem(&self, win: &NSWindow); + + #[method(addWindowsItem:title:filename:)] + pub unsafe fn addWindowsItem_title_filename( + &self, + win: &NSWindow, + string: &NSString, + isFilename: bool, + ); + + #[method(changeWindowsItem:title:filename:)] + pub unsafe fn changeWindowsItem_title_filename( + &self, + win: &NSWindow, + string: &NSString, + isFilename: bool, + ); + + #[method(updateWindowsItem:)] + pub unsafe fn updateWindowsItem(&self, win: &NSWindow); + + #[method(miniaturizeAll:)] + pub unsafe fn miniaturizeAll(&self, sender: Option<&Object>); + } +); + +extern_methods!( + /// NSFullKeyboardAccess + unsafe impl NSApplication { + #[method(isFullKeyboardAccessEnabled)] + pub unsafe fn isFullKeyboardAccessEnabled(&self) -> bool; + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSApplicationTerminateReply { + NSTerminateCancel = 0, + NSTerminateNow = 1, + NSTerminateLater = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSApplicationPrintReply { + NSPrintingCancelled = 0, + NSPrintingSuccess = 1, + NSPrintingFailure = 3, + NSPrintingReplyLater = 2, + } +); + +extern_protocol!( + pub struct NSApplicationDelegate; + + unsafe impl NSApplicationDelegate { + #[optional] + #[method(applicationShouldTerminate:)] + pub unsafe fn applicationShouldTerminate( + &self, + sender: &NSApplication, + ) -> NSApplicationTerminateReply; + + #[optional] + #[method(application:openURLs:)] + pub unsafe fn application_openURLs( + &self, + application: &NSApplication, + urls: &NSArray, + ); + + #[optional] + #[method(application:openFile:)] + pub unsafe fn application_openFile( + &self, + sender: &NSApplication, + filename: &NSString, + ) -> bool; + + #[optional] + #[method(application:openFiles:)] + pub unsafe fn application_openFiles( + &self, + sender: &NSApplication, + filenames: &NSArray, + ); + + #[optional] + #[method(application:openTempFile:)] + pub unsafe fn application_openTempFile( + &self, + sender: &NSApplication, + filename: &NSString, + ) -> bool; + + #[optional] + #[method(applicationShouldOpenUntitledFile:)] + pub unsafe fn applicationShouldOpenUntitledFile(&self, sender: &NSApplication) -> bool; + + #[optional] + #[method(applicationOpenUntitledFile:)] + pub unsafe fn applicationOpenUntitledFile(&self, sender: &NSApplication) -> bool; + + #[optional] + #[method(application:openFileWithoutUI:)] + pub unsafe fn application_openFileWithoutUI( + &self, + sender: &Object, + filename: &NSString, + ) -> bool; + + #[optional] + #[method(application:printFile:)] + pub unsafe fn application_printFile( + &self, + sender: &NSApplication, + filename: &NSString, + ) -> bool; + + #[optional] + #[method(application:printFiles:withSettings:showPrintPanels:)] + pub unsafe fn application_printFiles_withSettings_showPrintPanels( + &self, + application: &NSApplication, + fileNames: &NSArray, + printSettings: &NSDictionary, + showPrintPanels: bool, + ) -> NSApplicationPrintReply; + + #[optional] + #[method(applicationShouldTerminateAfterLastWindowClosed:)] + pub unsafe fn applicationShouldTerminateAfterLastWindowClosed( + &self, + sender: &NSApplication, + ) -> bool; + + #[optional] + #[method(applicationShouldHandleReopen:hasVisibleWindows:)] + pub unsafe fn applicationShouldHandleReopen_hasVisibleWindows( + &self, + sender: &NSApplication, + flag: bool, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other applicationDockMenu:)] + pub unsafe fn applicationDockMenu( + &self, + sender: &NSApplication, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other application:willPresentError:)] + pub unsafe fn application_willPresentError( + &self, + application: &NSApplication, + error: &NSError, + ) -> Id; + + #[optional] + #[method(application:didRegisterForRemoteNotificationsWithDeviceToken:)] + pub unsafe fn application_didRegisterForRemoteNotificationsWithDeviceToken( + &self, + application: &NSApplication, + deviceToken: &NSData, + ); + + #[optional] + #[method(application:didFailToRegisterForRemoteNotificationsWithError:)] + pub unsafe fn application_didFailToRegisterForRemoteNotificationsWithError( + &self, + application: &NSApplication, + error: &NSError, + ); + + #[optional] + #[method(application:didReceiveRemoteNotification:)] + pub unsafe fn application_didReceiveRemoteNotification( + &self, + application: &NSApplication, + userInfo: &NSDictionary, + ); + + #[optional] + #[method(applicationSupportsSecureRestorableState:)] + pub unsafe fn applicationSupportsSecureRestorableState(&self, app: &NSApplication) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other application:handlerForIntent:)] + pub unsafe fn application_handlerForIntent( + &self, + application: &NSApplication, + intent: &INIntent, + ) -> Option>; + + #[optional] + #[method(application:willEncodeRestorableState:)] + pub unsafe fn application_willEncodeRestorableState( + &self, + app: &NSApplication, + coder: &NSCoder, + ); + + #[optional] + #[method(application:didDecodeRestorableState:)] + pub unsafe fn application_didDecodeRestorableState( + &self, + app: &NSApplication, + coder: &NSCoder, + ); + + #[optional] + #[method(application:willContinueUserActivityWithType:)] + pub unsafe fn application_willContinueUserActivityWithType( + &self, + application: &NSApplication, + userActivityType: &NSString, + ) -> bool; + + #[optional] + #[method(application:continueUserActivity:restorationHandler:)] + pub unsafe fn application_continueUserActivity_restorationHandler( + &self, + application: &NSApplication, + userActivity: &NSUserActivity, + restorationHandler: &Block<(NonNull>,), ()>, + ) -> bool; + + #[optional] + #[method(application:didFailToContinueUserActivityWithType:error:)] + pub unsafe fn application_didFailToContinueUserActivityWithType_error( + &self, + application: &NSApplication, + userActivityType: &NSString, + error: &NSError, + ); + + #[optional] + #[method(application:didUpdateUserActivity:)] + pub unsafe fn application_didUpdateUserActivity( + &self, + application: &NSApplication, + userActivity: &NSUserActivity, + ); + + #[optional] + #[method(application:userDidAcceptCloudKitShareWithMetadata:)] + pub unsafe fn application_userDidAcceptCloudKitShareWithMetadata( + &self, + application: &NSApplication, + metadata: &CKShareMetadata, + ); + + #[optional] + #[method(application:delegateHandlesKey:)] + pub unsafe fn application_delegateHandlesKey( + &self, + sender: &NSApplication, + key: &NSString, + ) -> bool; + + #[optional] + #[method(applicationShouldAutomaticallyLocalizeKeyEquivalents:)] + pub unsafe fn applicationShouldAutomaticallyLocalizeKeyEquivalents( + &self, + application: &NSApplication, + ) -> bool; + + #[optional] + #[method(applicationWillFinishLaunching:)] + pub unsafe fn applicationWillFinishLaunching(&self, notification: &NSNotification); + + #[optional] + #[method(applicationDidFinishLaunching:)] + pub unsafe fn applicationDidFinishLaunching(&self, notification: &NSNotification); + + #[optional] + #[method(applicationWillHide:)] + pub unsafe fn applicationWillHide(&self, notification: &NSNotification); + + #[optional] + #[method(applicationDidHide:)] + pub unsafe fn applicationDidHide(&self, notification: &NSNotification); + + #[optional] + #[method(applicationWillUnhide:)] + pub unsafe fn applicationWillUnhide(&self, notification: &NSNotification); + + #[optional] + #[method(applicationDidUnhide:)] + pub unsafe fn applicationDidUnhide(&self, notification: &NSNotification); + + #[optional] + #[method(applicationWillBecomeActive:)] + pub unsafe fn applicationWillBecomeActive(&self, notification: &NSNotification); + + #[optional] + #[method(applicationDidBecomeActive:)] + pub unsafe fn applicationDidBecomeActive(&self, notification: &NSNotification); + + #[optional] + #[method(applicationWillResignActive:)] + pub unsafe fn applicationWillResignActive(&self, notification: &NSNotification); + + #[optional] + #[method(applicationDidResignActive:)] + pub unsafe fn applicationDidResignActive(&self, notification: &NSNotification); + + #[optional] + #[method(applicationWillUpdate:)] + pub unsafe fn applicationWillUpdate(&self, notification: &NSNotification); + + #[optional] + #[method(applicationDidUpdate:)] + pub unsafe fn applicationDidUpdate(&self, notification: &NSNotification); + + #[optional] + #[method(applicationWillTerminate:)] + pub unsafe fn applicationWillTerminate(&self, notification: &NSNotification); + + #[optional] + #[method(applicationDidChangeScreenParameters:)] + pub unsafe fn applicationDidChangeScreenParameters(&self, notification: &NSNotification); + + #[optional] + #[method(applicationDidChangeOcclusionState:)] + pub unsafe fn applicationDidChangeOcclusionState(&self, notification: &NSNotification); + + #[optional] + #[method(applicationProtectedDataWillBecomeUnavailable:)] + pub unsafe fn applicationProtectedDataWillBecomeUnavailable( + &self, + notification: &NSNotification, + ); + + #[optional] + #[method(applicationProtectedDataDidBecomeAvailable:)] + pub unsafe fn applicationProtectedDataDidBecomeAvailable( + &self, + notification: &NSNotification, + ); + } +); + +extern_methods!( + /// NSServicesMenu + unsafe impl NSApplication { + #[method_id(@__retain_semantics Other servicesMenu)] + pub unsafe fn servicesMenu(&self) -> Option>; + + #[method(setServicesMenu:)] + pub unsafe fn setServicesMenu(&self, servicesMenu: Option<&NSMenu>); + + #[method(registerServicesMenuSendTypes:returnTypes:)] + pub unsafe fn registerServicesMenuSendTypes_returnTypes( + &self, + sendTypes: &NSArray, + returnTypes: &NSArray, + ); + } +); + +extern_protocol!( + pub struct NSServicesMenuRequestor; + + unsafe impl NSServicesMenuRequestor { + #[optional] + #[method(writeSelectionToPasteboard:types:)] + pub unsafe fn writeSelectionToPasteboard_types( + &self, + pboard: &NSPasteboard, + types: &NSArray, + ) -> bool; + + #[optional] + #[method(readSelectionFromPasteboard:)] + pub unsafe fn readSelectionFromPasteboard(&self, pboard: &NSPasteboard) -> bool; + } +); + +extern_methods!( + /// NSServicesHandling + unsafe impl NSApplication { + #[method_id(@__retain_semantics Other servicesProvider)] + pub unsafe fn servicesProvider(&self) -> Option>; + + #[method(setServicesProvider:)] + pub unsafe fn setServicesProvider(&self, servicesProvider: Option<&Object>); + } +); + +pub type NSAboutPanelOptionKey = NSString; + +extern_static!(NSAboutPanelOptionCredits: &'static NSAboutPanelOptionKey); + +extern_static!(NSAboutPanelOptionApplicationName: &'static NSAboutPanelOptionKey); + +extern_static!(NSAboutPanelOptionApplicationIcon: &'static NSAboutPanelOptionKey); + +extern_static!(NSAboutPanelOptionVersion: &'static NSAboutPanelOptionKey); + +extern_static!(NSAboutPanelOptionApplicationVersion: &'static NSAboutPanelOptionKey); + +extern_methods!( + /// NSStandardAboutPanel + unsafe impl NSApplication { + #[method(orderFrontStandardAboutPanel:)] + pub unsafe fn orderFrontStandardAboutPanel(&self, sender: Option<&Object>); + + #[method(orderFrontStandardAboutPanelWithOptions:)] + pub unsafe fn orderFrontStandardAboutPanelWithOptions( + &self, + optionsDictionary: &NSDictionary, + ); + } +); + +extern_methods!( + /// NSApplicationLayoutDirection + unsafe impl NSApplication { + #[method(userInterfaceLayoutDirection)] + pub unsafe fn userInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection; + } +); + +extern_methods!( + /// NSRestorableUserInterface + unsafe impl NSApplication { + #[method(disableRelaunchOnLogin)] + pub unsafe fn disableRelaunchOnLogin(&self); + + #[method(enableRelaunchOnLogin)] + pub unsafe fn enableRelaunchOnLogin(&self); + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSRemoteNotificationType { + NSRemoteNotificationTypeNone = 0, + NSRemoteNotificationTypeBadge = 1 << 0, + NSRemoteNotificationTypeSound = 1 << 1, + NSRemoteNotificationTypeAlert = 1 << 2, + } +); + +extern_methods!( + /// NSRemoteNotifications + unsafe impl NSApplication { + #[method(registerForRemoteNotifications)] + pub unsafe fn registerForRemoteNotifications(&self); + + #[method(unregisterForRemoteNotifications)] + pub unsafe fn unregisterForRemoteNotifications(&self); + + #[method(isRegisteredForRemoteNotifications)] + pub unsafe fn isRegisteredForRemoteNotifications(&self) -> bool; + + #[method(registerForRemoteNotificationTypes:)] + pub unsafe fn registerForRemoteNotificationTypes(&self, types: NSRemoteNotificationType); + + #[method(enabledRemoteNotificationTypes)] + pub unsafe fn enabledRemoteNotificationTypes(&self) -> NSRemoteNotificationType; + } +); + +extern_fn!( + pub unsafe fn NSApplicationMain(argc: c_int, argv: NonNull>) -> c_int; +); + +extern_fn!( + pub unsafe fn NSApplicationLoad() -> Bool; +); + +extern_fn!( + pub unsafe fn NSShowsServicesMenuItem(itemName: &NSString) -> Bool; +); + +extern_fn!( + pub unsafe fn NSSetShowsServicesMenuItem(itemName: &NSString, enabled: Bool) -> NSInteger; +); + +extern_fn!( + pub unsafe fn NSUpdateDynamicServices(); +); + +extern_fn!( + pub unsafe fn NSPerformService(itemName: &NSString, pboard: Option<&NSPasteboard>) -> Bool; +); + +pub type NSServiceProviderName = NSString; + +extern_fn!( + pub unsafe fn NSRegisterServicesProvider( + provider: Option<&Object>, + name: &NSServiceProviderName, + ); +); + +extern_fn!( + pub unsafe fn NSUnregisterServicesProvider(name: &NSServiceProviderName); +); + +extern_static!(NSApplicationDidBecomeActiveNotification: &'static NSNotificationName); + +extern_static!(NSApplicationDidHideNotification: &'static NSNotificationName); + +extern_static!(NSApplicationDidFinishLaunchingNotification: &'static NSNotificationName); + +extern_static!(NSApplicationDidResignActiveNotification: &'static NSNotificationName); + +extern_static!(NSApplicationDidUnhideNotification: &'static NSNotificationName); + +extern_static!(NSApplicationDidUpdateNotification: &'static NSNotificationName); + +extern_static!(NSApplicationWillBecomeActiveNotification: &'static NSNotificationName); + +extern_static!(NSApplicationWillHideNotification: &'static NSNotificationName); + +extern_static!(NSApplicationWillFinishLaunchingNotification: &'static NSNotificationName); + +extern_static!(NSApplicationWillResignActiveNotification: &'static NSNotificationName); + +extern_static!(NSApplicationWillUnhideNotification: &'static NSNotificationName); + +extern_static!(NSApplicationWillUpdateNotification: &'static NSNotificationName); + +extern_static!(NSApplicationWillTerminateNotification: &'static NSNotificationName); + +extern_static!(NSApplicationDidChangeScreenParametersNotification: &'static NSNotificationName); + +extern_static!( + NSApplicationProtectedDataWillBecomeUnavailableNotification: &'static NSNotificationName +); + +extern_static!( + NSApplicationProtectedDataDidBecomeAvailableNotification: &'static NSNotificationName +); + +extern_static!(NSApplicationLaunchIsDefaultLaunchKey: &'static NSString); + +extern_static!(NSApplicationLaunchUserNotificationKey: &'static NSString); + +extern_static!(NSApplicationLaunchRemoteNotificationKey: &'static NSString); + +extern_static!(NSApplicationDidChangeOcclusionStateNotification: &'static NSNotificationName); + +extern_enum!( + #[underlying(c_int)] + pub enum { + NSRunStoppedResponse = -1000, + NSRunAbortedResponse = -1001, + NSRunContinuesResponse = -1002, + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSApplication { + #[method(runModalForWindow:relativeToWindow:)] + pub unsafe fn runModalForWindow_relativeToWindow( + &self, + window: Option<&NSWindow>, + docWindow: Option<&NSWindow>, + ) -> NSInteger; + + #[method(beginModalSessionForWindow:relativeToWindow:)] + pub unsafe fn beginModalSessionForWindow_relativeToWindow( + &self, + window: Option<&NSWindow>, + docWindow: Option<&NSWindow>, + ) -> NSModalSession; + + #[method(application:printFiles:)] + pub unsafe fn application_printFiles( + &self, + sender: Option<&NSApplication>, + filenames: Option<&NSArray>, + ); + + #[method(beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:)] + pub unsafe fn beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo( + &self, + sheet: &NSWindow, + docWindow: &NSWindow, + modalDelegate: Option<&Object>, + didEndSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(endSheet:)] + pub unsafe fn endSheet(&self, sheet: &NSWindow); + + #[method(endSheet:returnCode:)] + pub unsafe fn endSheet_returnCode(&self, sheet: &NSWindow, returnCode: NSInteger); + + #[method_id(@__retain_semantics Other makeWindowsPerform:inOrder:)] + pub unsafe fn makeWindowsPerform_inOrder( + &self, + selector: Sel, + flag: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other context)] + pub unsafe fn context(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSApplicationScripting.rs b/crates/icrate/src/generated/AppKit/NSApplicationScripting.rs new file mode 100644 index 000000000..9d607f505 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSApplicationScripting.rs @@ -0,0 +1,29 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_methods!( + /// NSScripting + unsafe impl NSApplication { + #[method_id(@__retain_semantics Other orderedDocuments)] + pub unsafe fn orderedDocuments(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other orderedWindows)] + pub unsafe fn orderedWindows(&self) -> Id, Shared>; + } +); + +extern_methods!( + /// NSApplicationScriptingDelegation + unsafe impl NSObject { + #[method(application:delegateHandlesKey:)] + pub unsafe fn application_delegateHandlesKey( + &self, + sender: &NSApplication, + key: &NSString, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSArrayController.rs b/crates/icrate/src/generated/AppKit/NSArrayController.rs new file mode 100644 index 000000000..dccb29803 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSArrayController.rs @@ -0,0 +1,175 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSArrayController; + + unsafe impl ClassType for NSArrayController { + type Super = NSObjectController; + } +); + +extern_methods!( + unsafe impl NSArrayController { + #[method(rearrangeObjects)] + pub unsafe fn rearrangeObjects(&self); + + #[method(automaticallyRearrangesObjects)] + pub unsafe fn automaticallyRearrangesObjects(&self) -> bool; + + #[method(setAutomaticallyRearrangesObjects:)] + pub unsafe fn setAutomaticallyRearrangesObjects( + &self, + automaticallyRearrangesObjects: bool, + ); + + #[method_id(@__retain_semantics Other automaticRearrangementKeyPaths)] + pub unsafe fn automaticRearrangementKeyPaths( + &self, + ) -> Option, Shared>>; + + #[method(didChangeArrangementCriteria)] + pub unsafe fn didChangeArrangementCriteria(&self); + + #[method_id(@__retain_semantics Other sortDescriptors)] + pub unsafe fn sortDescriptors(&self) -> Id, Shared>; + + #[method(setSortDescriptors:)] + pub unsafe fn setSortDescriptors(&self, sortDescriptors: &NSArray); + + #[method_id(@__retain_semantics Other filterPredicate)] + pub unsafe fn filterPredicate(&self) -> Option>; + + #[method(setFilterPredicate:)] + pub unsafe fn setFilterPredicate(&self, filterPredicate: Option<&NSPredicate>); + + #[method(clearsFilterPredicateOnInsertion)] + pub unsafe fn clearsFilterPredicateOnInsertion(&self) -> bool; + + #[method(setClearsFilterPredicateOnInsertion:)] + pub unsafe fn setClearsFilterPredicateOnInsertion( + &self, + clearsFilterPredicateOnInsertion: bool, + ); + + #[method_id(@__retain_semantics Other arrangeObjects:)] + pub unsafe fn arrangeObjects(&self, objects: &NSArray) -> Id; + + #[method_id(@__retain_semantics Other arrangedObjects)] + pub unsafe fn arrangedObjects(&self) -> Id; + + #[method(avoidsEmptySelection)] + pub unsafe fn avoidsEmptySelection(&self) -> bool; + + #[method(setAvoidsEmptySelection:)] + pub unsafe fn setAvoidsEmptySelection(&self, avoidsEmptySelection: bool); + + #[method(preservesSelection)] + pub unsafe fn preservesSelection(&self) -> bool; + + #[method(setPreservesSelection:)] + pub unsafe fn setPreservesSelection(&self, preservesSelection: bool); + + #[method(selectsInsertedObjects)] + pub unsafe fn selectsInsertedObjects(&self) -> bool; + + #[method(setSelectsInsertedObjects:)] + pub unsafe fn setSelectsInsertedObjects(&self, selectsInsertedObjects: bool); + + #[method(alwaysUsesMultipleValuesMarker)] + pub unsafe fn alwaysUsesMultipleValuesMarker(&self) -> bool; + + #[method(setAlwaysUsesMultipleValuesMarker:)] + pub unsafe fn setAlwaysUsesMultipleValuesMarker( + &self, + alwaysUsesMultipleValuesMarker: bool, + ); + + #[method(setSelectionIndexes:)] + pub unsafe fn setSelectionIndexes(&self, indexes: &NSIndexSet) -> bool; + + #[method_id(@__retain_semantics Other selectionIndexes)] + pub unsafe fn selectionIndexes(&self) -> Id; + + #[method(setSelectionIndex:)] + pub unsafe fn setSelectionIndex(&self, index: NSUInteger) -> bool; + + #[method(selectionIndex)] + pub unsafe fn selectionIndex(&self) -> NSUInteger; + + #[method(addSelectionIndexes:)] + pub unsafe fn addSelectionIndexes(&self, indexes: &NSIndexSet) -> bool; + + #[method(removeSelectionIndexes:)] + pub unsafe fn removeSelectionIndexes(&self, indexes: &NSIndexSet) -> bool; + + #[method(setSelectedObjects:)] + pub unsafe fn setSelectedObjects(&self, objects: &NSArray) -> bool; + + #[method_id(@__retain_semantics Other selectedObjects)] + pub unsafe fn selectedObjects(&self) -> Id; + + #[method(addSelectedObjects:)] + pub unsafe fn addSelectedObjects(&self, objects: &NSArray) -> bool; + + #[method(removeSelectedObjects:)] + pub unsafe fn removeSelectedObjects(&self, objects: &NSArray) -> bool; + + #[method(add:)] + pub unsafe fn add(&self, sender: Option<&Object>); + + #[method(remove:)] + pub unsafe fn remove(&self, sender: Option<&Object>); + + #[method(insert:)] + pub unsafe fn insert(&self, sender: Option<&Object>); + + #[method(canInsert)] + pub unsafe fn canInsert(&self) -> bool; + + #[method(selectNext:)] + pub unsafe fn selectNext(&self, sender: Option<&Object>); + + #[method(selectPrevious:)] + pub unsafe fn selectPrevious(&self, sender: Option<&Object>); + + #[method(canSelectNext)] + pub unsafe fn canSelectNext(&self) -> bool; + + #[method(canSelectPrevious)] + pub unsafe fn canSelectPrevious(&self) -> bool; + + #[method(addObject:)] + pub unsafe fn addObject(&self, object: &Object); + + #[method(addObjects:)] + pub unsafe fn addObjects(&self, objects: &NSArray); + + #[method(insertObject:atArrangedObjectIndex:)] + pub unsafe fn insertObject_atArrangedObjectIndex(&self, object: &Object, index: NSUInteger); + + #[method(insertObjects:atArrangedObjectIndexes:)] + pub unsafe fn insertObjects_atArrangedObjectIndexes( + &self, + objects: &NSArray, + indexes: &NSIndexSet, + ); + + #[method(removeObjectAtArrangedObjectIndex:)] + pub unsafe fn removeObjectAtArrangedObjectIndex(&self, index: NSUInteger); + + #[method(removeObjectsAtArrangedObjectIndexes:)] + pub unsafe fn removeObjectsAtArrangedObjectIndexes(&self, indexes: &NSIndexSet); + + #[method(removeObject:)] + pub unsafe fn removeObject(&self, object: &Object); + + #[method(removeObjects:)] + pub unsafe fn removeObjects(&self, objects: &NSArray); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSAttributedString.rs b/crates/icrate/src/generated/AppKit/NSAttributedString.rs new file mode 100644 index 000000000..802b72ccf --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSAttributedString.rs @@ -0,0 +1,620 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSFontAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSParagraphStyleAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSForegroundColorAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSBackgroundColorAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSLigatureAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSKernAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSTrackingAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSStrikethroughStyleAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSUnderlineStyleAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSStrokeColorAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSStrokeWidthAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSShadowAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSTextEffectAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSAttachmentAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSLinkAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSBaselineOffsetAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSUnderlineColorAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSStrikethroughColorAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSObliquenessAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSExpansionAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSWritingDirectionAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSVerticalGlyphFormAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSCursorAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSToolTipAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSMarkedClauseSegmentAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSTextAlternativesAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSSpellingStateAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSSuperscriptAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSGlyphInfoAttributeName: &'static NSAttributedStringKey); + +ns_options!( + #[underlying(NSInteger)] + pub enum NSUnderlineStyle { + NSUnderlineStyleNone = 0x00, + NSUnderlineStyleSingle = 0x01, + NSUnderlineStyleThick = 0x02, + NSUnderlineStyleDouble = 0x09, + NSUnderlineStylePatternSolid = 0x0000, + NSUnderlineStylePatternDot = 0x0100, + NSUnderlineStylePatternDash = 0x0200, + NSUnderlineStylePatternDashDot = 0x0300, + NSUnderlineStylePatternDashDotDot = 0x0400, + NSUnderlineStyleByWord = 0x8000, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSWritingDirectionFormatType { + NSWritingDirectionEmbedding = 0 << 1, + NSWritingDirectionOverride = 1 << 1, + } +); + +pub type NSTextEffectStyle = NSString; + +extern_static!(NSTextEffectLetterpressStyle: &'static NSTextEffectStyle); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSSpellingState { + NSSpellingStateSpellingFlag = 1 << 0, + NSSpellingStateGrammarFlag = 1 << 1, + } +); + +extern_methods!( + /// NSAttributedStringAttributeFixing + unsafe impl NSMutableAttributedString { + #[method(fixAttributesInRange:)] + pub unsafe fn fixAttributesInRange(&self, range: NSRange); + + #[method(fixFontAttributeInRange:)] + pub unsafe fn fixFontAttributeInRange(&self, range: NSRange); + + #[method(fixParagraphStyleAttributeInRange:)] + pub unsafe fn fixParagraphStyleAttributeInRange(&self, range: NSRange); + + #[method(fixAttachmentAttributeInRange:)] + pub unsafe fn fixAttachmentAttributeInRange(&self, range: NSRange); + } +); + +pub type NSAttributedStringDocumentType = NSString; + +extern_static!(NSPlainTextDocumentType: &'static NSAttributedStringDocumentType); + +extern_static!(NSRTFTextDocumentType: &'static NSAttributedStringDocumentType); + +extern_static!(NSRTFDTextDocumentType: &'static NSAttributedStringDocumentType); + +extern_static!(NSHTMLTextDocumentType: &'static NSAttributedStringDocumentType); + +extern_static!(NSMacSimpleTextDocumentType: &'static NSAttributedStringDocumentType); + +extern_static!(NSDocFormatTextDocumentType: &'static NSAttributedStringDocumentType); + +extern_static!(NSWordMLTextDocumentType: &'static NSAttributedStringDocumentType); + +extern_static!(NSWebArchiveTextDocumentType: &'static NSAttributedStringDocumentType); + +extern_static!(NSOfficeOpenXMLTextDocumentType: &'static NSAttributedStringDocumentType); + +extern_static!(NSOpenDocumentTextDocumentType: &'static NSAttributedStringDocumentType); + +pub type NSTextLayoutSectionKey = NSString; + +extern_static!(NSTextLayoutSectionOrientation: &'static NSTextLayoutSectionKey); + +extern_static!(NSTextLayoutSectionRange: &'static NSTextLayoutSectionKey); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextScalingType { + NSTextScalingStandard = 0, + NSTextScalingiOS = 1, + } +); + +pub type NSAttributedStringDocumentAttributeKey = NSString; + +extern_static!(NSDocumentTypeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSConvertedDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSCocoaVersionDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSFileTypeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSTitleDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSCompanyDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSCopyrightDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSSubjectDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSAuthorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSKeywordsDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSCommentDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSEditorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSCreationTimeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!( + NSModificationTimeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey +); + +extern_static!(NSManagerDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSCategoryDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSAppearanceDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!( + NSCharacterEncodingDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey +); + +extern_static!( + NSDefaultAttributesDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey +); + +extern_static!(NSPaperSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSLeftMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSRightMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSTopMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSBottomMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSViewSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSViewZoomDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSViewModeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSReadOnlyDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSBackgroundColorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!( + NSHyphenationFactorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey +); + +extern_static!( + NSDefaultTabIntervalDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey +); + +extern_static!(NSTextLayoutSectionsAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!( + NSExcludedElementsDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey +); + +extern_static!( + NSTextEncodingNameDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey +); + +extern_static!(NSPrefixSpacesDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!(NSTextScalingDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey); + +extern_static!( + NSSourceTextScalingDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey +); + +pub type NSAttributedStringDocumentReadingOptionKey = NSString; + +extern_static!(NSDocumentTypeDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey); + +extern_static!( + NSDefaultAttributesDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey +); + +extern_static!( + NSCharacterEncodingDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey +); + +extern_static!( + NSTextEncodingNameDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey +); + +extern_static!(NSBaseURLDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey); + +extern_static!(NSTimeoutDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey); + +extern_static!(NSWebPreferencesDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey); + +extern_static!( + NSWebResourceLoadDelegateDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey +); + +extern_static!( + NSTextSizeMultiplierDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey +); + +extern_static!(NSFileTypeDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey); + +extern_static!( + NSTargetTextScalingDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey +); + +extern_static!( + NSSourceTextScalingDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey +); + +extern_methods!( + /// NSAttributedStringDocumentFormats + unsafe impl NSAttributedString { + #[method_id(@__retain_semantics Init initWithURL:options:documentAttributes:error:)] + pub unsafe fn initWithURL_options_documentAttributes_error( + this: Option>, + url: &NSURL, + options: &NSDictionary, + dict: *mut *mut NSDictionary, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithData:options:documentAttributes:error:)] + pub unsafe fn initWithData_options_documentAttributes_error( + this: Option>, + data: &NSData, + options: &NSDictionary, + dict: *mut *mut NSDictionary, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other dataFromRange:documentAttributes:error:)] + pub unsafe fn dataFromRange_documentAttributes_error( + &self, + range: NSRange, + dict: &NSDictionary, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other fileWrapperFromRange:documentAttributes:error:)] + pub unsafe fn fileWrapperFromRange_documentAttributes_error( + &self, + range: NSRange, + dict: &NSDictionary, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithRTF:documentAttributes:)] + pub unsafe fn initWithRTF_documentAttributes( + this: Option>, + data: &NSData, + dict: *mut *mut NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithRTFD:documentAttributes:)] + pub unsafe fn initWithRTFD_documentAttributes( + this: Option>, + data: &NSData, + dict: *mut *mut NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithHTML:documentAttributes:)] + pub unsafe fn initWithHTML_documentAttributes( + this: Option>, + data: &NSData, + dict: *mut *mut NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithHTML:baseURL:documentAttributes:)] + pub unsafe fn initWithHTML_baseURL_documentAttributes( + this: Option>, + data: &NSData, + base: &NSURL, + dict: *mut *mut NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithDocFormat:documentAttributes:)] + pub unsafe fn initWithDocFormat_documentAttributes( + this: Option>, + data: &NSData, + dict: *mut *mut NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithHTML:options:documentAttributes:)] + pub unsafe fn initWithHTML_options_documentAttributes( + this: Option>, + data: &NSData, + options: &NSDictionary, + dict: *mut *mut NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithRTFDFileWrapper:documentAttributes:)] + pub unsafe fn initWithRTFDFileWrapper_documentAttributes( + this: Option>, + wrapper: &NSFileWrapper, + dict: *mut *mut NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Other RTFFromRange:documentAttributes:)] + pub unsafe fn RTFFromRange_documentAttributes( + &self, + range: NSRange, + dict: &NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Other RTFDFromRange:documentAttributes:)] + pub unsafe fn RTFDFromRange_documentAttributes( + &self, + range: NSRange, + dict: &NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Other RTFDFileWrapperFromRange:documentAttributes:)] + pub unsafe fn RTFDFileWrapperFromRange_documentAttributes( + &self, + range: NSRange, + dict: &NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Other docFormatFromRange:documentAttributes:)] + pub unsafe fn docFormatFromRange_documentAttributes( + &self, + range: NSRange, + dict: &NSDictionary, + ) -> Option>; + } +); + +extern_methods!( + /// NSMutableAttributedStringDocumentFormats + unsafe impl NSMutableAttributedString { + #[method(readFromURL:options:documentAttributes:error:)] + pub unsafe fn readFromURL_options_documentAttributes_error( + &self, + url: &NSURL, + opts: &NSDictionary, + dict: *mut *mut NSDictionary, + ) -> Result<(), Id>; + + #[method(readFromData:options:documentAttributes:error:)] + pub unsafe fn readFromData_options_documentAttributes_error( + &self, + data: &NSData, + opts: &NSDictionary, + dict: *mut *mut NSDictionary, + ) -> Result<(), Id>; + } +); + +extern_methods!( + /// NSAttributedStringKitAdditions + unsafe impl NSAttributedString { + #[method_id(@__retain_semantics Other fontAttributesInRange:)] + pub unsafe fn fontAttributesInRange( + &self, + range: NSRange, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other rulerAttributesInRange:)] + pub unsafe fn rulerAttributesInRange( + &self, + range: NSRange, + ) -> Id, Shared>; + + #[method(containsAttachmentsInRange:)] + pub unsafe fn containsAttachmentsInRange(&self, range: NSRange) -> bool; + + #[method(lineBreakBeforeIndex:withinRange:)] + pub unsafe fn lineBreakBeforeIndex_withinRange( + &self, + location: NSUInteger, + aRange: NSRange, + ) -> NSUInteger; + + #[method(lineBreakByHyphenatingBeforeIndex:withinRange:)] + pub unsafe fn lineBreakByHyphenatingBeforeIndex_withinRange( + &self, + location: NSUInteger, + aRange: NSRange, + ) -> NSUInteger; + + #[method(doubleClickAtIndex:)] + pub unsafe fn doubleClickAtIndex(&self, location: NSUInteger) -> NSRange; + + #[method(nextWordFromIndex:forward:)] + pub unsafe fn nextWordFromIndex_forward( + &self, + location: NSUInteger, + isForward: bool, + ) -> NSUInteger; + + #[method(rangeOfTextBlock:atIndex:)] + pub unsafe fn rangeOfTextBlock_atIndex( + &self, + block: &NSTextBlock, + location: NSUInteger, + ) -> NSRange; + + #[method(rangeOfTextTable:atIndex:)] + pub unsafe fn rangeOfTextTable_atIndex( + &self, + table: &NSTextTable, + location: NSUInteger, + ) -> NSRange; + + #[method(rangeOfTextList:atIndex:)] + pub unsafe fn rangeOfTextList_atIndex( + &self, + list: &NSTextList, + location: NSUInteger, + ) -> NSRange; + + #[method(itemNumberInTextList:atIndex:)] + pub unsafe fn itemNumberInTextList_atIndex( + &self, + list: &NSTextList, + location: NSUInteger, + ) -> NSInteger; + } +); + +extern_methods!( + /// NSAttributedStringPasteboardAdditions + unsafe impl NSAttributedString { + #[method_id(@__retain_semantics Other textTypes)] + pub unsafe fn textTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other textUnfilteredTypes)] + pub unsafe fn textUnfilteredTypes() -> Id, Shared>; + } +); + +extern_methods!( + /// NSMutableAttributedStringKitAdditions + unsafe impl NSMutableAttributedString { + #[method(superscriptRange:)] + pub unsafe fn superscriptRange(&self, range: NSRange); + + #[method(subscriptRange:)] + pub unsafe fn subscriptRange(&self, range: NSRange); + + #[method(unscriptRange:)] + pub unsafe fn unscriptRange(&self, range: NSRange); + + #[method(applyFontTraits:range:)] + pub unsafe fn applyFontTraits_range(&self, traitMask: NSFontTraitMask, range: NSRange); + + #[method(setAlignment:range:)] + pub unsafe fn setAlignment_range(&self, alignment: NSTextAlignment, range: NSRange); + + #[method(setBaseWritingDirection:range:)] + pub unsafe fn setBaseWritingDirection_range( + &self, + writingDirection: NSWritingDirection, + range: NSRange, + ); + } +); + +extern_static!(NSUnderlinePatternSolid: NSUnderlineStyle = NSUnderlineStylePatternSolid); + +extern_static!(NSUnderlinePatternDot: NSUnderlineStyle = NSUnderlineStylePatternDot); + +extern_static!(NSUnderlinePatternDash: NSUnderlineStyle = NSUnderlineStylePatternDash); + +extern_static!(NSUnderlinePatternDashDot: NSUnderlineStyle = NSUnderlineStylePatternDashDot); + +extern_static!(NSUnderlinePatternDashDotDot: NSUnderlineStyle = NSUnderlineStylePatternDashDotDot); + +extern_static!(NSUnderlineByWord: NSUnderlineStyle = NSUnderlineStyleByWord); + +extern_static!(NSCharacterShapeAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSUsesScreenFontsDocumentAttribute: &'static NSAttributedStringKey); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSNoUnderlineStyle = 0, + NSSingleUnderlineStyle = 1, + } +); + +extern_static!(NSUnderlineStrikethroughMask: NSUInteger); + +extern_static!(NSUnderlineByWordMask: NSUInteger); + +extern_methods!( + /// NSDeprecatedKitAdditions + unsafe impl NSAttributedString { + #[method(containsAttachments)] + pub unsafe fn containsAttachments(&self) -> bool; + + #[method_id(@__retain_semantics Other textFileTypes)] + pub unsafe fn textFileTypes() -> Id; + + #[method_id(@__retain_semantics Other textPasteboardTypes)] + pub unsafe fn textPasteboardTypes() -> Id; + + #[method_id(@__retain_semantics Other textUnfilteredFileTypes)] + pub unsafe fn textUnfilteredFileTypes() -> Id; + + #[method_id(@__retain_semantics Other textUnfilteredPasteboardTypes)] + pub unsafe fn textUnfilteredPasteboardTypes() -> Id; + + #[method_id(@__retain_semantics Init initWithURL:documentAttributes:)] + pub unsafe fn initWithURL_documentAttributes( + this: Option>, + url: &NSURL, + dict: *mut *mut NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithPath:documentAttributes:)] + pub unsafe fn initWithPath_documentAttributes( + this: Option>, + path: &NSString, + dict: *mut *mut NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLAtIndex:effectiveRange:)] + pub unsafe fn URLAtIndex_effectiveRange( + &self, + location: NSUInteger, + effectiveRange: NSRangePointer, + ) -> Option>; + } +); + +extern_methods!( + /// NSDeprecatedKitAdditions + unsafe impl NSMutableAttributedString { + #[method(readFromURL:options:documentAttributes:)] + pub unsafe fn readFromURL_options_documentAttributes( + &self, + url: &NSURL, + options: &NSDictionary, + dict: *mut *mut NSDictionary, + ) -> bool; + + #[method(readFromData:options:documentAttributes:)] + pub unsafe fn readFromData_options_documentAttributes( + &self, + data: &NSData, + options: &NSDictionary, + dict: *mut *mut NSDictionary, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSBezierPath.rs b/crates/icrate/src/generated/AppKit/NSBezierPath.rs new file mode 100644 index 000000000..e3c3009da --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSBezierPath.rs @@ -0,0 +1,360 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSLineCapStyle { + NSLineCapStyleButt = 0, + NSLineCapStyleRound = 1, + NSLineCapStyleSquare = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSLineJoinStyle { + NSLineJoinStyleMiter = 0, + NSLineJoinStyleRound = 1, + NSLineJoinStyleBevel = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSWindingRule { + NSWindingRuleNonZero = 0, + NSWindingRuleEvenOdd = 1, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSBezierPathElement { + NSBezierPathElementMoveTo = 0, + NSBezierPathElementLineTo = 1, + NSBezierPathElementCurveTo = 2, + NSBezierPathElementClosePath = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSBezierPath; + + unsafe impl ClassType for NSBezierPath { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSBezierPath { + #[method_id(@__retain_semantics Other bezierPath)] + pub unsafe fn bezierPath() -> Id; + + #[method_id(@__retain_semantics Other bezierPathWithRect:)] + pub unsafe fn bezierPathWithRect(rect: NSRect) -> Id; + + #[method_id(@__retain_semantics Other bezierPathWithOvalInRect:)] + pub unsafe fn bezierPathWithOvalInRect(rect: NSRect) -> Id; + + #[method_id(@__retain_semantics Other bezierPathWithRoundedRect:xRadius:yRadius:)] + pub unsafe fn bezierPathWithRoundedRect_xRadius_yRadius( + rect: NSRect, + xRadius: CGFloat, + yRadius: CGFloat, + ) -> Id; + + #[method(fillRect:)] + pub unsafe fn fillRect(rect: NSRect); + + #[method(strokeRect:)] + pub unsafe fn strokeRect(rect: NSRect); + + #[method(clipRect:)] + pub unsafe fn clipRect(rect: NSRect); + + #[method(strokeLineFromPoint:toPoint:)] + pub unsafe fn strokeLineFromPoint_toPoint(point1: NSPoint, point2: NSPoint); + + #[method(drawPackedGlyphs:atPoint:)] + pub unsafe fn drawPackedGlyphs_atPoint(packedGlyphs: NonNull, point: NSPoint); + + #[method(defaultMiterLimit)] + pub unsafe fn defaultMiterLimit() -> CGFloat; + + #[method(setDefaultMiterLimit:)] + pub unsafe fn setDefaultMiterLimit(defaultMiterLimit: CGFloat); + + #[method(defaultFlatness)] + pub unsafe fn defaultFlatness() -> CGFloat; + + #[method(setDefaultFlatness:)] + pub unsafe fn setDefaultFlatness(defaultFlatness: CGFloat); + + #[method(defaultWindingRule)] + pub unsafe fn defaultWindingRule() -> NSWindingRule; + + #[method(setDefaultWindingRule:)] + pub unsafe fn setDefaultWindingRule(defaultWindingRule: NSWindingRule); + + #[method(defaultLineCapStyle)] + pub unsafe fn defaultLineCapStyle() -> NSLineCapStyle; + + #[method(setDefaultLineCapStyle:)] + pub unsafe fn setDefaultLineCapStyle(defaultLineCapStyle: NSLineCapStyle); + + #[method(defaultLineJoinStyle)] + pub unsafe fn defaultLineJoinStyle() -> NSLineJoinStyle; + + #[method(setDefaultLineJoinStyle:)] + pub unsafe fn setDefaultLineJoinStyle(defaultLineJoinStyle: NSLineJoinStyle); + + #[method(defaultLineWidth)] + pub unsafe fn defaultLineWidth() -> CGFloat; + + #[method(setDefaultLineWidth:)] + pub unsafe fn setDefaultLineWidth(defaultLineWidth: CGFloat); + + #[method(moveToPoint:)] + pub unsafe fn moveToPoint(&self, point: NSPoint); + + #[method(lineToPoint:)] + pub unsafe fn lineToPoint(&self, point: NSPoint); + + #[method(curveToPoint:controlPoint1:controlPoint2:)] + pub unsafe fn curveToPoint_controlPoint1_controlPoint2( + &self, + endPoint: NSPoint, + controlPoint1: NSPoint, + controlPoint2: NSPoint, + ); + + #[method(closePath)] + pub unsafe fn closePath(&self); + + #[method(removeAllPoints)] + pub unsafe fn removeAllPoints(&self); + + #[method(relativeMoveToPoint:)] + pub unsafe fn relativeMoveToPoint(&self, point: NSPoint); + + #[method(relativeLineToPoint:)] + pub unsafe fn relativeLineToPoint(&self, point: NSPoint); + + #[method(relativeCurveToPoint:controlPoint1:controlPoint2:)] + pub unsafe fn relativeCurveToPoint_controlPoint1_controlPoint2( + &self, + endPoint: NSPoint, + controlPoint1: NSPoint, + controlPoint2: NSPoint, + ); + + #[method(lineWidth)] + pub unsafe fn lineWidth(&self) -> CGFloat; + + #[method(setLineWidth:)] + pub unsafe fn setLineWidth(&self, lineWidth: CGFloat); + + #[method(lineCapStyle)] + pub unsafe fn lineCapStyle(&self) -> NSLineCapStyle; + + #[method(setLineCapStyle:)] + pub unsafe fn setLineCapStyle(&self, lineCapStyle: NSLineCapStyle); + + #[method(lineJoinStyle)] + pub unsafe fn lineJoinStyle(&self) -> NSLineJoinStyle; + + #[method(setLineJoinStyle:)] + pub unsafe fn setLineJoinStyle(&self, lineJoinStyle: NSLineJoinStyle); + + #[method(windingRule)] + pub unsafe fn windingRule(&self) -> NSWindingRule; + + #[method(setWindingRule:)] + pub unsafe fn setWindingRule(&self, windingRule: NSWindingRule); + + #[method(miterLimit)] + pub unsafe fn miterLimit(&self) -> CGFloat; + + #[method(setMiterLimit:)] + pub unsafe fn setMiterLimit(&self, miterLimit: CGFloat); + + #[method(flatness)] + pub unsafe fn flatness(&self) -> CGFloat; + + #[method(setFlatness:)] + pub unsafe fn setFlatness(&self, flatness: CGFloat); + + #[method(getLineDash:count:phase:)] + pub unsafe fn getLineDash_count_phase( + &self, + pattern: *mut CGFloat, + count: *mut NSInteger, + phase: *mut CGFloat, + ); + + #[method(setLineDash:count:phase:)] + pub unsafe fn setLineDash_count_phase( + &self, + pattern: *mut CGFloat, + count: NSInteger, + phase: CGFloat, + ); + + #[method(stroke)] + pub unsafe fn stroke(&self); + + #[method(fill)] + pub unsafe fn fill(&self); + + #[method(addClip)] + pub unsafe fn addClip(&self); + + #[method(setClip)] + pub unsafe fn setClip(&self); + + #[method_id(@__retain_semantics Other bezierPathByFlatteningPath)] + pub unsafe fn bezierPathByFlatteningPath(&self) -> Id; + + #[method_id(@__retain_semantics Other bezierPathByReversingPath)] + pub unsafe fn bezierPathByReversingPath(&self) -> Id; + + #[method(transformUsingAffineTransform:)] + pub unsafe fn transformUsingAffineTransform(&self, transform: &NSAffineTransform); + + #[method(isEmpty)] + pub unsafe fn isEmpty(&self) -> bool; + + #[method(currentPoint)] + pub unsafe fn currentPoint(&self) -> NSPoint; + + #[method(controlPointBounds)] + pub unsafe fn controlPointBounds(&self) -> NSRect; + + #[method(bounds)] + pub unsafe fn bounds(&self) -> NSRect; + + #[method(elementCount)] + pub unsafe fn elementCount(&self) -> NSInteger; + + #[method(elementAtIndex:associatedPoints:)] + pub unsafe fn elementAtIndex_associatedPoints( + &self, + index: NSInteger, + points: NSPointArray, + ) -> NSBezierPathElement; + + #[method(elementAtIndex:)] + pub unsafe fn elementAtIndex(&self, index: NSInteger) -> NSBezierPathElement; + + #[method(setAssociatedPoints:atIndex:)] + pub unsafe fn setAssociatedPoints_atIndex(&self, points: NSPointArray, index: NSInteger); + + #[method(appendBezierPath:)] + pub unsafe fn appendBezierPath(&self, path: &NSBezierPath); + + #[method(appendBezierPathWithRect:)] + pub unsafe fn appendBezierPathWithRect(&self, rect: NSRect); + + #[method(appendBezierPathWithPoints:count:)] + pub unsafe fn appendBezierPathWithPoints_count( + &self, + points: NSPointArray, + count: NSInteger, + ); + + #[method(appendBezierPathWithOvalInRect:)] + pub unsafe fn appendBezierPathWithOvalInRect(&self, rect: NSRect); + + #[method(appendBezierPathWithArcWithCenter:radius:startAngle:endAngle:clockwise:)] + pub unsafe fn appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_clockwise( + &self, + center: NSPoint, + radius: CGFloat, + startAngle: CGFloat, + endAngle: CGFloat, + clockwise: bool, + ); + + #[method(appendBezierPathWithArcWithCenter:radius:startAngle:endAngle:)] + pub unsafe fn appendBezierPathWithArcWithCenter_radius_startAngle_endAngle( + &self, + center: NSPoint, + radius: CGFloat, + startAngle: CGFloat, + endAngle: CGFloat, + ); + + #[method(appendBezierPathWithArcFromPoint:toPoint:radius:)] + pub unsafe fn appendBezierPathWithArcFromPoint_toPoint_radius( + &self, + point1: NSPoint, + point2: NSPoint, + radius: CGFloat, + ); + + #[method(appendBezierPathWithRoundedRect:xRadius:yRadius:)] + pub unsafe fn appendBezierPathWithRoundedRect_xRadius_yRadius( + &self, + rect: NSRect, + xRadius: CGFloat, + yRadius: CGFloat, + ); + + #[method(containsPoint:)] + pub unsafe fn containsPoint(&self, point: NSPoint) -> bool; + } +); + +extern_methods!( + /// NSBezierPathDeprecated + unsafe impl NSBezierPath { + #[method(cachesBezierPath)] + pub unsafe fn cachesBezierPath(&self) -> bool; + + #[method(setCachesBezierPath:)] + pub unsafe fn setCachesBezierPath(&self, flag: bool); + + #[method(appendBezierPathWithGlyph:inFont:)] + pub unsafe fn appendBezierPathWithGlyph_inFont(&self, glyph: NSGlyph, font: &NSFont); + + #[method(appendBezierPathWithGlyphs:count:inFont:)] + pub unsafe fn appendBezierPathWithGlyphs_count_inFont( + &self, + glyphs: NonNull, + count: NSInteger, + font: &NSFont, + ); + + #[method(appendBezierPathWithPackedGlyphs:)] + pub unsafe fn appendBezierPathWithPackedGlyphs(&self, packedGlyphs: NonNull); + } +); + +extern_static!(NSButtLineCapStyle: NSLineCapStyle = NSLineCapStyleButt); + +extern_static!(NSRoundLineCapStyle: NSLineCapStyle = NSLineCapStyleRound); + +extern_static!(NSSquareLineCapStyle: NSLineCapStyle = NSLineCapStyleSquare); + +extern_static!(NSMiterLineJoinStyle: NSLineJoinStyle = NSLineJoinStyleMiter); + +extern_static!(NSRoundLineJoinStyle: NSLineJoinStyle = NSLineJoinStyleRound); + +extern_static!(NSBevelLineJoinStyle: NSLineJoinStyle = NSLineJoinStyleBevel); + +extern_static!(NSNonZeroWindingRule: NSWindingRule = NSWindingRuleNonZero); + +extern_static!(NSEvenOddWindingRule: NSWindingRule = NSWindingRuleEvenOdd); + +extern_static!(NSMoveToBezierPathElement: NSBezierPathElement = NSBezierPathElementMoveTo); + +extern_static!(NSLineToBezierPathElement: NSBezierPathElement = NSBezierPathElementLineTo); + +extern_static!(NSCurveToBezierPathElement: NSBezierPathElement = NSBezierPathElementCurveTo); + +extern_static!(NSClosePathBezierPathElement: NSBezierPathElement = NSBezierPathElementClosePath); diff --git a/crates/icrate/src/generated/AppKit/NSBitmapImageRep.rs b/crates/icrate/src/generated/AppKit/NSBitmapImageRep.rs new file mode 100644 index 000000000..d25834cc2 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSBitmapImageRep.rs @@ -0,0 +1,337 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTIFFCompression { + NSTIFFCompressionNone = 1, + NSTIFFCompressionCCITTFAX3 = 3, + NSTIFFCompressionCCITTFAX4 = 4, + NSTIFFCompressionLZW = 5, + NSTIFFCompressionJPEG = 6, + NSTIFFCompressionNEXT = 32766, + NSTIFFCompressionPackBits = 32773, + NSTIFFCompressionOldJPEG = 32865, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSBitmapImageFileType { + NSBitmapImageFileTypeTIFF = 0, + NSBitmapImageFileTypeBMP = 1, + NSBitmapImageFileTypeGIF = 2, + NSBitmapImageFileTypeJPEG = 3, + NSBitmapImageFileTypePNG = 4, + NSBitmapImageFileTypeJPEG2000 = 5, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSImageRepLoadStatus { + NSImageRepLoadStatusUnknownType = -1, + NSImageRepLoadStatusReadingHeader = -2, + NSImageRepLoadStatusWillNeedAllData = -3, + NSImageRepLoadStatusInvalidData = -4, + NSImageRepLoadStatusUnexpectedEOF = -5, + NSImageRepLoadStatusCompleted = -6, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSBitmapFormat { + NSBitmapFormatAlphaFirst = 1 << 0, + NSBitmapFormatAlphaNonpremultiplied = 1 << 1, + NSBitmapFormatFloatingPointSamples = 1 << 2, + NSBitmapFormatSixteenBitLittleEndian = 1 << 8, + NSBitmapFormatThirtyTwoBitLittleEndian = 1 << 9, + NSBitmapFormatSixteenBitBigEndian = 1 << 10, + NSBitmapFormatThirtyTwoBitBigEndian = 1 << 11, + } +); + +pub type NSBitmapImageRepPropertyKey = NSString; + +extern_static!(NSImageCompressionMethod: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageCompressionFactor: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageDitherTransparency: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageRGBColorTable: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageInterlaced: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageColorSyncProfileData: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageFrameCount: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageCurrentFrame: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageCurrentFrameDuration: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageLoopCount: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageGamma: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageProgressive: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageEXIFData: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageIPTCData: &'static NSBitmapImageRepPropertyKey); + +extern_static!(NSImageFallbackBackgroundColor: &'static NSBitmapImageRepPropertyKey); + +extern_class!( + #[derive(Debug)] + pub struct NSBitmapImageRep; + + unsafe impl ClassType for NSBitmapImageRep { + type Super = NSImageRep; + } +); + +extern_methods!( + unsafe impl NSBitmapImageRep { + #[method_id(@__retain_semantics Init initWithFocusedViewRect:)] + pub unsafe fn initWithFocusedViewRect( + this: Option>, + rect: NSRect, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:)] + pub unsafe fn initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bytesPerRow_bitsPerPixel( + this: Option>, + planes: *mut *mut c_uchar, + width: NSInteger, + height: NSInteger, + bps: NSInteger, + spp: NSInteger, + alpha: bool, + isPlanar: bool, + colorSpaceName: &NSColorSpaceName, + rBytes: NSInteger, + pBits: NSInteger, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:)] + pub unsafe fn initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel( + this: Option>, + planes: *mut *mut c_uchar, + width: NSInteger, + height: NSInteger, + bps: NSInteger, + spp: NSInteger, + alpha: bool, + isPlanar: bool, + colorSpaceName: &NSColorSpaceName, + bitmapFormat: NSBitmapFormat, + rBytes: NSInteger, + pBits: NSInteger, + ) -> Option>; + + #[method_id(@__retain_semantics Other imageRepsWithData:)] + pub unsafe fn imageRepsWithData(data: &NSData) -> Id, Shared>; + + #[method_id(@__retain_semantics Other imageRepWithData:)] + pub unsafe fn imageRepWithData(data: &NSData) -> Option>; + + #[method_id(@__retain_semantics Init initWithData:)] + pub unsafe fn initWithData( + this: Option>, + data: &NSData, + ) -> Option>; + + #[method(bitmapData)] + pub unsafe fn bitmapData(&self) -> *mut c_uchar; + + #[method(getBitmapDataPlanes:)] + pub unsafe fn getBitmapDataPlanes(&self, data: NonNull<*mut c_uchar>); + + #[method(isPlanar)] + pub unsafe fn isPlanar(&self) -> bool; + + #[method(samplesPerPixel)] + pub unsafe fn samplesPerPixel(&self) -> NSInteger; + + #[method(bitsPerPixel)] + pub unsafe fn bitsPerPixel(&self) -> NSInteger; + + #[method(bytesPerRow)] + pub unsafe fn bytesPerRow(&self) -> NSInteger; + + #[method(bytesPerPlane)] + pub unsafe fn bytesPerPlane(&self) -> NSInteger; + + #[method(numberOfPlanes)] + pub unsafe fn numberOfPlanes(&self) -> NSInteger; + + #[method(bitmapFormat)] + pub unsafe fn bitmapFormat(&self) -> NSBitmapFormat; + + #[method(getCompression:factor:)] + pub unsafe fn getCompression_factor( + &self, + compression: *mut NSTIFFCompression, + factor: *mut c_float, + ); + + #[method(setCompression:factor:)] + pub unsafe fn setCompression_factor(&self, compression: NSTIFFCompression, factor: c_float); + + #[method_id(@__retain_semantics Other TIFFRepresentation)] + pub unsafe fn TIFFRepresentation(&self) -> Option>; + + #[method_id(@__retain_semantics Other TIFFRepresentationUsingCompression:factor:)] + pub unsafe fn TIFFRepresentationUsingCompression_factor( + &self, + comp: NSTIFFCompression, + factor: c_float, + ) -> Option>; + + #[method_id(@__retain_semantics Other TIFFRepresentationOfImageRepsInArray:)] + pub unsafe fn TIFFRepresentationOfImageRepsInArray( + array: &NSArray, + ) -> Option>; + + #[method_id(@__retain_semantics Other TIFFRepresentationOfImageRepsInArray:usingCompression:factor:)] + pub unsafe fn TIFFRepresentationOfImageRepsInArray_usingCompression_factor( + array: &NSArray, + comp: NSTIFFCompression, + factor: c_float, + ) -> Option>; + + #[method(getTIFFCompressionTypes:count:)] + pub unsafe fn getTIFFCompressionTypes_count( + list: NonNull<*mut NSTIFFCompression>, + numTypes: NonNull, + ); + + #[method_id(@__retain_semantics Other localizedNameForTIFFCompressionType:)] + pub unsafe fn localizedNameForTIFFCompressionType( + compression: NSTIFFCompression, + ) -> Option>; + + #[method(canBeCompressedUsing:)] + pub unsafe fn canBeCompressedUsing(&self, compression: NSTIFFCompression) -> bool; + + #[method(colorizeByMappingGray:toColor:blackMapping:whiteMapping:)] + pub unsafe fn colorizeByMappingGray_toColor_blackMapping_whiteMapping( + &self, + midPoint: CGFloat, + midPointColor: Option<&NSColor>, + shadowColor: Option<&NSColor>, + lightColor: Option<&NSColor>, + ); + + #[method_id(@__retain_semantics Init initForIncrementalLoad)] + pub unsafe fn initForIncrementalLoad(this: Option>) -> Id; + + #[method(incrementalLoadFromData:complete:)] + pub unsafe fn incrementalLoadFromData_complete( + &self, + data: &NSData, + complete: bool, + ) -> NSInteger; + + #[method(setColor:atX:y:)] + pub unsafe fn setColor_atX_y(&self, color: &NSColor, x: NSInteger, y: NSInteger); + + #[method_id(@__retain_semantics Other colorAtX:y:)] + pub unsafe fn colorAtX_y(&self, x: NSInteger, y: NSInteger) -> Option>; + + #[method(getPixel:atX:y:)] + pub unsafe fn getPixel_atX_y(&self, p: NonNull, x: NSInteger, y: NSInteger); + + #[method(setPixel:atX:y:)] + pub unsafe fn setPixel_atX_y(&self, p: NonNull, x: NSInteger, y: NSInteger); + + #[method_id(@__retain_semantics Other colorSpace)] + pub unsafe fn colorSpace(&self) -> Id; + + #[method_id(@__retain_semantics Other bitmapImageRepByConvertingToColorSpace:renderingIntent:)] + pub unsafe fn bitmapImageRepByConvertingToColorSpace_renderingIntent( + &self, + targetSpace: &NSColorSpace, + renderingIntent: NSColorRenderingIntent, + ) -> Option>; + + #[method_id(@__retain_semantics Other bitmapImageRepByRetaggingWithColorSpace:)] + pub unsafe fn bitmapImageRepByRetaggingWithColorSpace( + &self, + newSpace: &NSColorSpace, + ) -> Option>; + } +); + +extern_methods!( + /// NSBitmapImageFileTypeExtensions + unsafe impl NSBitmapImageRep { + #[method_id(@__retain_semantics Other representationOfImageRepsInArray:usingType:properties:)] + pub unsafe fn representationOfImageRepsInArray_usingType_properties( + imageReps: &NSArray, + storageType: NSBitmapImageFileType, + properties: &NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Other representationUsingType:properties:)] + pub unsafe fn representationUsingType_properties( + &self, + storageType: NSBitmapImageFileType, + properties: &NSDictionary, + ) -> Option>; + + #[method(setProperty:withValue:)] + pub unsafe fn setProperty_withValue( + &self, + property: &NSBitmapImageRepPropertyKey, + value: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other valueForProperty:)] + pub unsafe fn valueForProperty( + &self, + property: &NSBitmapImageRepPropertyKey, + ) -> Option>; + } +); + +extern_static!(NSTIFFFileType: NSBitmapImageFileType = NSBitmapImageFileTypeTIFF); + +extern_static!(NSBMPFileType: NSBitmapImageFileType = NSBitmapImageFileTypeBMP); + +extern_static!(NSGIFFileType: NSBitmapImageFileType = NSBitmapImageFileTypeGIF); + +extern_static!(NSJPEGFileType: NSBitmapImageFileType = NSBitmapImageFileTypeJPEG); + +extern_static!(NSPNGFileType: NSBitmapImageFileType = NSBitmapImageFileTypePNG); + +extern_static!(NSJPEG2000FileType: NSBitmapImageFileType = NSBitmapImageFileTypeJPEG2000); + +extern_static!(NSAlphaFirstBitmapFormat: NSBitmapFormat = NSBitmapFormatAlphaFirst); + +extern_static!( + NSAlphaNonpremultipliedBitmapFormat: NSBitmapFormat = NSBitmapFormatAlphaNonpremultiplied +); + +extern_static!( + NSFloatingPointSamplesBitmapFormat: NSBitmapFormat = NSBitmapFormatFloatingPointSamples +); + +extern_static!( + NS16BitLittleEndianBitmapFormat: NSBitmapFormat = NSBitmapFormatSixteenBitLittleEndian +); + +extern_static!( + NS32BitLittleEndianBitmapFormat: NSBitmapFormat = NSBitmapFormatThirtyTwoBitLittleEndian +); + +extern_static!(NS16BitBigEndianBitmapFormat: NSBitmapFormat = NSBitmapFormatSixteenBitBigEndian); + +extern_static!(NS32BitBigEndianBitmapFormat: NSBitmapFormat = NSBitmapFormatThirtyTwoBitBigEndian); diff --git a/crates/icrate/src/generated/AppKit/NSBox.rs b/crates/icrate/src/generated/AppKit/NSBox.rs new file mode 100644 index 000000000..f1f545550 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSBox.rs @@ -0,0 +1,140 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTitlePosition { + NSNoTitle = 0, + NSAboveTop = 1, + NSAtTop = 2, + NSBelowTop = 3, + NSAboveBottom = 4, + NSAtBottom = 5, + NSBelowBottom = 6, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSBoxType { + NSBoxPrimary = 0, + NSBoxSeparator = 2, + NSBoxCustom = 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSBox; + + unsafe impl ClassType for NSBox { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSBox { + #[method(boxType)] + pub unsafe fn boxType(&self) -> NSBoxType; + + #[method(setBoxType:)] + pub unsafe fn setBoxType(&self, boxType: NSBoxType); + + #[method(titlePosition)] + pub unsafe fn titlePosition(&self) -> NSTitlePosition; + + #[method(setTitlePosition:)] + pub unsafe fn setTitlePosition(&self, titlePosition: NSTitlePosition); + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + + #[method_id(@__retain_semantics Other titleFont)] + pub unsafe fn titleFont(&self) -> Id; + + #[method(setTitleFont:)] + pub unsafe fn setTitleFont(&self, titleFont: &NSFont); + + #[method(borderRect)] + pub unsafe fn borderRect(&self) -> NSRect; + + #[method(titleRect)] + pub unsafe fn titleRect(&self) -> NSRect; + + #[method_id(@__retain_semantics Other titleCell)] + pub unsafe fn titleCell(&self) -> Id; + + #[method(contentViewMargins)] + pub unsafe fn contentViewMargins(&self) -> NSSize; + + #[method(setContentViewMargins:)] + pub unsafe fn setContentViewMargins(&self, contentViewMargins: NSSize); + + #[method(sizeToFit)] + pub unsafe fn sizeToFit(&self); + + #[method(setFrameFromContentFrame:)] + pub unsafe fn setFrameFromContentFrame(&self, contentFrame: NSRect); + + #[method_id(@__retain_semantics Other contentView)] + pub unsafe fn contentView(&self) -> Option>; + + #[method(setContentView:)] + pub unsafe fn setContentView(&self, contentView: Option<&NSView>); + + #[method(isTransparent)] + pub unsafe fn isTransparent(&self) -> bool; + + #[method(setTransparent:)] + pub unsafe fn setTransparent(&self, transparent: bool); + + #[method(borderWidth)] + pub unsafe fn borderWidth(&self) -> CGFloat; + + #[method(setBorderWidth:)] + pub unsafe fn setBorderWidth(&self, borderWidth: CGFloat); + + #[method(cornerRadius)] + pub unsafe fn cornerRadius(&self) -> CGFloat; + + #[method(setCornerRadius:)] + pub unsafe fn setCornerRadius(&self, cornerRadius: CGFloat); + + #[method_id(@__retain_semantics Other borderColor)] + pub unsafe fn borderColor(&self) -> Id; + + #[method(setBorderColor:)] + pub unsafe fn setBorderColor(&self, borderColor: &NSColor); + + #[method_id(@__retain_semantics Other fillColor)] + pub unsafe fn fillColor(&self) -> Id; + + #[method(setFillColor:)] + pub unsafe fn setFillColor(&self, fillColor: &NSColor); + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSBox { + #[method(borderType)] + pub unsafe fn borderType(&self) -> NSBorderType; + + #[method(setBorderType:)] + pub unsafe fn setBorderType(&self, borderType: NSBorderType); + + #[method(setTitleWithMnemonic:)] + pub unsafe fn setTitleWithMnemonic(&self, stringWithAmpersand: Option<&NSString>); + } +); + +extern_static!(NSBoxSecondary: NSBoxType = 1); + +extern_static!(NSBoxOldStyle: NSBoxType = 3); diff --git a/crates/icrate/src/generated/AppKit/NSBrowser.rs b/crates/icrate/src/generated/AppKit/NSBrowser.rs new file mode 100644 index 000000000..c7d8dd8de --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSBrowser.rs @@ -0,0 +1,751 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSAppKitVersionNumberWithContinuousScrollingBrowser: NSAppKitVersion = 680.0); + +extern_static!(NSAppKitVersionNumberWithColumnResizingBrowser: NSAppKitVersion = 685.0); + +pub type NSBrowserColumnsAutosaveName = NSString; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSBrowserColumnResizingType { + NSBrowserNoColumnResizing = 0, + NSBrowserAutoColumnResizing = 1, + NSBrowserUserColumnResizing = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSBrowserDropOperation { + NSBrowserDropOn = 0, + NSBrowserDropAbove = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSBrowser; + + unsafe impl ClassType for NSBrowser { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSBrowser { + #[method(cellClass)] + pub unsafe fn cellClass() -> &'static Class; + + #[method(loadColumnZero)] + pub unsafe fn loadColumnZero(&self); + + #[method(isLoaded)] + pub unsafe fn isLoaded(&self) -> bool; + + #[method(doubleAction)] + pub unsafe fn doubleAction(&self) -> OptionSel; + + #[method(setDoubleAction:)] + pub unsafe fn setDoubleAction(&self, doubleAction: OptionSel); + + #[method(setCellClass:)] + pub unsafe fn setCellClass(&self, factoryId: &Class); + + #[method_id(@__retain_semantics Other cellPrototype)] + pub unsafe fn cellPrototype(&self) -> Option>; + + #[method(setCellPrototype:)] + pub unsafe fn setCellPrototype(&self, cellPrototype: Option<&Object>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSBrowserDelegate>); + + #[method(reusesColumns)] + pub unsafe fn reusesColumns(&self) -> bool; + + #[method(setReusesColumns:)] + pub unsafe fn setReusesColumns(&self, reusesColumns: bool); + + #[method(hasHorizontalScroller)] + pub unsafe fn hasHorizontalScroller(&self) -> bool; + + #[method(setHasHorizontalScroller:)] + pub unsafe fn setHasHorizontalScroller(&self, hasHorizontalScroller: bool); + + #[method(autohidesScroller)] + pub unsafe fn autohidesScroller(&self) -> bool; + + #[method(setAutohidesScroller:)] + pub unsafe fn setAutohidesScroller(&self, autohidesScroller: bool); + + #[method(separatesColumns)] + pub unsafe fn separatesColumns(&self) -> bool; + + #[method(setSeparatesColumns:)] + pub unsafe fn setSeparatesColumns(&self, separatesColumns: bool); + + #[method(isTitled)] + pub unsafe fn isTitled(&self) -> bool; + + #[method(setTitled:)] + pub unsafe fn setTitled(&self, titled: bool); + + #[method(minColumnWidth)] + pub unsafe fn minColumnWidth(&self) -> CGFloat; + + #[method(setMinColumnWidth:)] + pub unsafe fn setMinColumnWidth(&self, minColumnWidth: CGFloat); + + #[method(maxVisibleColumns)] + pub unsafe fn maxVisibleColumns(&self) -> NSInteger; + + #[method(setMaxVisibleColumns:)] + pub unsafe fn setMaxVisibleColumns(&self, maxVisibleColumns: NSInteger); + + #[method(allowsMultipleSelection)] + pub unsafe fn allowsMultipleSelection(&self) -> bool; + + #[method(setAllowsMultipleSelection:)] + pub unsafe fn setAllowsMultipleSelection(&self, allowsMultipleSelection: bool); + + #[method(allowsBranchSelection)] + pub unsafe fn allowsBranchSelection(&self) -> bool; + + #[method(setAllowsBranchSelection:)] + pub unsafe fn setAllowsBranchSelection(&self, allowsBranchSelection: bool); + + #[method(allowsEmptySelection)] + pub unsafe fn allowsEmptySelection(&self) -> bool; + + #[method(setAllowsEmptySelection:)] + pub unsafe fn setAllowsEmptySelection(&self, allowsEmptySelection: bool); + + #[method(takesTitleFromPreviousColumn)] + pub unsafe fn takesTitleFromPreviousColumn(&self) -> bool; + + #[method(setTakesTitleFromPreviousColumn:)] + pub unsafe fn setTakesTitleFromPreviousColumn(&self, takesTitleFromPreviousColumn: bool); + + #[method(sendsActionOnArrowKeys)] + pub unsafe fn sendsActionOnArrowKeys(&self) -> bool; + + #[method(setSendsActionOnArrowKeys:)] + pub unsafe fn setSendsActionOnArrowKeys(&self, sendsActionOnArrowKeys: bool); + + #[method_id(@__retain_semantics Other itemAtIndexPath:)] + pub unsafe fn itemAtIndexPath(&self, indexPath: &NSIndexPath) + -> Option>; + + #[method_id(@__retain_semantics Other itemAtRow:inColumn:)] + pub unsafe fn itemAtRow_inColumn( + &self, + row: NSInteger, + column: NSInteger, + ) -> Option>; + + #[method_id(@__retain_semantics Other indexPathForColumn:)] + pub unsafe fn indexPathForColumn(&self, column: NSInteger) -> Id; + + #[method(isLeafItem:)] + pub unsafe fn isLeafItem(&self, item: Option<&Object>) -> bool; + + #[method(reloadDataForRowIndexes:inColumn:)] + pub unsafe fn reloadDataForRowIndexes_inColumn( + &self, + rowIndexes: &NSIndexSet, + column: NSInteger, + ); + + #[method_id(@__retain_semantics Other parentForItemsInColumn:)] + pub unsafe fn parentForItemsInColumn( + &self, + column: NSInteger, + ) -> Option>; + + #[method(scrollRowToVisible:inColumn:)] + pub unsafe fn scrollRowToVisible_inColumn(&self, row: NSInteger, column: NSInteger); + + #[method(setTitle:ofColumn:)] + pub unsafe fn setTitle_ofColumn(&self, string: &NSString, column: NSInteger); + + #[method_id(@__retain_semantics Other titleOfColumn:)] + pub unsafe fn titleOfColumn(&self, column: NSInteger) -> Option>; + + #[method_id(@__retain_semantics Other pathSeparator)] + pub unsafe fn pathSeparator(&self) -> Id; + + #[method(setPathSeparator:)] + pub unsafe fn setPathSeparator(&self, pathSeparator: &NSString); + + #[method(setPath:)] + pub unsafe fn setPath(&self, path: &NSString) -> bool; + + #[method_id(@__retain_semantics Other path)] + pub unsafe fn path(&self) -> Id; + + #[method_id(@__retain_semantics Other pathToColumn:)] + pub unsafe fn pathToColumn(&self, column: NSInteger) -> Id; + + #[method(clickedColumn)] + pub unsafe fn clickedColumn(&self) -> NSInteger; + + #[method(clickedRow)] + pub unsafe fn clickedRow(&self) -> NSInteger; + + #[method(selectedColumn)] + pub unsafe fn selectedColumn(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other selectedCell)] + pub unsafe fn selectedCell(&self) -> Option>; + + #[method_id(@__retain_semantics Other selectedCellInColumn:)] + pub unsafe fn selectedCellInColumn(&self, column: NSInteger) -> Option>; + + #[method_id(@__retain_semantics Other selectedCells)] + pub unsafe fn selectedCells(&self) -> Option, Shared>>; + + #[method(selectRow:inColumn:)] + pub unsafe fn selectRow_inColumn(&self, row: NSInteger, column: NSInteger); + + #[method(selectedRowInColumn:)] + pub unsafe fn selectedRowInColumn(&self, column: NSInteger) -> NSInteger; + + #[method_id(@__retain_semantics Other selectionIndexPath)] + pub unsafe fn selectionIndexPath(&self) -> Option>; + + #[method(setSelectionIndexPath:)] + pub unsafe fn setSelectionIndexPath(&self, selectionIndexPath: Option<&NSIndexPath>); + + #[method_id(@__retain_semantics Other selectionIndexPaths)] + pub unsafe fn selectionIndexPaths(&self) -> Id, Shared>; + + #[method(setSelectionIndexPaths:)] + pub unsafe fn setSelectionIndexPaths(&self, selectionIndexPaths: &NSArray); + + #[method(selectRowIndexes:inColumn:)] + pub unsafe fn selectRowIndexes_inColumn(&self, indexes: &NSIndexSet, column: NSInteger); + + #[method_id(@__retain_semantics Other selectedRowIndexesInColumn:)] + pub unsafe fn selectedRowIndexesInColumn( + &self, + column: NSInteger, + ) -> Option>; + + #[method(reloadColumn:)] + pub unsafe fn reloadColumn(&self, column: NSInteger); + + #[method(validateVisibleColumns)] + pub unsafe fn validateVisibleColumns(&self); + + #[method(scrollColumnsRightBy:)] + pub unsafe fn scrollColumnsRightBy(&self, shiftAmount: NSInteger); + + #[method(scrollColumnsLeftBy:)] + pub unsafe fn scrollColumnsLeftBy(&self, shiftAmount: NSInteger); + + #[method(scrollColumnToVisible:)] + pub unsafe fn scrollColumnToVisible(&self, column: NSInteger); + + #[method(lastColumn)] + pub unsafe fn lastColumn(&self) -> NSInteger; + + #[method(setLastColumn:)] + pub unsafe fn setLastColumn(&self, lastColumn: NSInteger); + + #[method(addColumn)] + pub unsafe fn addColumn(&self); + + #[method(numberOfVisibleColumns)] + pub unsafe fn numberOfVisibleColumns(&self) -> NSInteger; + + #[method(firstVisibleColumn)] + pub unsafe fn firstVisibleColumn(&self) -> NSInteger; + + #[method(lastVisibleColumn)] + pub unsafe fn lastVisibleColumn(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other loadedCellAtRow:column:)] + pub unsafe fn loadedCellAtRow_column( + &self, + row: NSInteger, + col: NSInteger, + ) -> Option>; + + #[method(selectAll:)] + pub unsafe fn selectAll(&self, sender: Option<&Object>); + + #[method(tile)] + pub unsafe fn tile(&self); + + #[method(doClick:)] + pub unsafe fn doClick(&self, sender: Option<&Object>); + + #[method(doDoubleClick:)] + pub unsafe fn doDoubleClick(&self, sender: Option<&Object>); + + #[method(sendAction)] + pub unsafe fn sendAction(&self) -> bool; + + #[method(titleFrameOfColumn:)] + pub unsafe fn titleFrameOfColumn(&self, column: NSInteger) -> NSRect; + + #[method(drawTitleOfColumn:inRect:)] + pub unsafe fn drawTitleOfColumn_inRect(&self, column: NSInteger, rect: NSRect); + + #[method(titleHeight)] + pub unsafe fn titleHeight(&self) -> CGFloat; + + #[method(frameOfColumn:)] + pub unsafe fn frameOfColumn(&self, column: NSInteger) -> NSRect; + + #[method(frameOfInsideOfColumn:)] + pub unsafe fn frameOfInsideOfColumn(&self, column: NSInteger) -> NSRect; + + #[method(frameOfRow:inColumn:)] + pub unsafe fn frameOfRow_inColumn(&self, row: NSInteger, column: NSInteger) -> NSRect; + + #[method(getRow:column:forPoint:)] + pub unsafe fn getRow_column_forPoint( + &self, + row: *mut NSInteger, + column: *mut NSInteger, + point: NSPoint, + ) -> bool; + + #[method(columnWidthForColumnContentWidth:)] + pub unsafe fn columnWidthForColumnContentWidth( + &self, + columnContentWidth: CGFloat, + ) -> CGFloat; + + #[method(columnContentWidthForColumnWidth:)] + pub unsafe fn columnContentWidthForColumnWidth(&self, columnWidth: CGFloat) -> CGFloat; + + #[method(columnResizingType)] + pub unsafe fn columnResizingType(&self) -> NSBrowserColumnResizingType; + + #[method(setColumnResizingType:)] + pub unsafe fn setColumnResizingType(&self, columnResizingType: NSBrowserColumnResizingType); + + #[method(prefersAllColumnUserResizing)] + pub unsafe fn prefersAllColumnUserResizing(&self) -> bool; + + #[method(setPrefersAllColumnUserResizing:)] + pub unsafe fn setPrefersAllColumnUserResizing(&self, prefersAllColumnUserResizing: bool); + + #[method(setWidth:ofColumn:)] + pub unsafe fn setWidth_ofColumn(&self, columnWidth: CGFloat, columnIndex: NSInteger); + + #[method(widthOfColumn:)] + pub unsafe fn widthOfColumn(&self, column: NSInteger) -> CGFloat; + + #[method(rowHeight)] + pub unsafe fn rowHeight(&self) -> CGFloat; + + #[method(setRowHeight:)] + pub unsafe fn setRowHeight(&self, rowHeight: CGFloat); + + #[method(noteHeightOfRowsWithIndexesChanged:inColumn:)] + pub unsafe fn noteHeightOfRowsWithIndexesChanged_inColumn( + &self, + indexSet: &NSIndexSet, + columnIndex: NSInteger, + ); + + #[method(setDefaultColumnWidth:)] + pub unsafe fn setDefaultColumnWidth(&self, columnWidth: CGFloat); + + #[method(defaultColumnWidth)] + pub unsafe fn defaultColumnWidth(&self) -> CGFloat; + + #[method_id(@__retain_semantics Other columnsAutosaveName)] + pub unsafe fn columnsAutosaveName(&self) -> Id; + + #[method(setColumnsAutosaveName:)] + pub unsafe fn setColumnsAutosaveName( + &self, + columnsAutosaveName: &NSBrowserColumnsAutosaveName, + ); + + #[method(removeSavedColumnsWithAutosaveName:)] + pub unsafe fn removeSavedColumnsWithAutosaveName(name: &NSBrowserColumnsAutosaveName); + + #[method(canDragRowsWithIndexes:inColumn:withEvent:)] + pub unsafe fn canDragRowsWithIndexes_inColumn_withEvent( + &self, + rowIndexes: &NSIndexSet, + column: NSInteger, + event: &NSEvent, + ) -> bool; + + #[method_id(@__retain_semantics Other draggingImageForRowsWithIndexes:inColumn:withEvent:offset:)] + pub unsafe fn draggingImageForRowsWithIndexes_inColumn_withEvent_offset( + &self, + rowIndexes: &NSIndexSet, + column: NSInteger, + event: &NSEvent, + dragImageOffset: NSPointPointer, + ) -> Option>; + + #[method(setDraggingSourceOperationMask:forLocal:)] + pub unsafe fn setDraggingSourceOperationMask_forLocal( + &self, + mask: NSDragOperation, + isLocal: bool, + ); + + #[method(allowsTypeSelect)] + pub unsafe fn allowsTypeSelect(&self) -> bool; + + #[method(setAllowsTypeSelect:)] + pub unsafe fn setAllowsTypeSelect(&self, allowsTypeSelect: bool); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Id; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: &NSColor); + + #[method(editItemAtIndexPath:withEvent:select:)] + pub unsafe fn editItemAtIndexPath_withEvent_select( + &self, + indexPath: &NSIndexPath, + event: Option<&NSEvent>, + select: bool, + ); + } +); + +extern_static!(NSBrowserColumnConfigurationDidChangeNotification: &'static NSNotificationName); + +extern_protocol!( + pub struct NSBrowserDelegate; + + unsafe impl NSBrowserDelegate { + #[optional] + #[method(browser:numberOfRowsInColumn:)] + pub unsafe fn browser_numberOfRowsInColumn( + &self, + sender: &NSBrowser, + column: NSInteger, + ) -> NSInteger; + + #[optional] + #[method(browser:createRowsForColumn:inMatrix:)] + pub unsafe fn browser_createRowsForColumn_inMatrix( + &self, + sender: &NSBrowser, + column: NSInteger, + matrix: &NSMatrix, + ); + + #[optional] + #[method(browser:numberOfChildrenOfItem:)] + pub unsafe fn browser_numberOfChildrenOfItem( + &self, + browser: &NSBrowser, + item: Option<&Object>, + ) -> NSInteger; + + #[optional] + #[method_id(@__retain_semantics Other browser:child:ofItem:)] + pub unsafe fn browser_child_ofItem( + &self, + browser: &NSBrowser, + index: NSInteger, + item: Option<&Object>, + ) -> Id; + + #[optional] + #[method(browser:isLeafItem:)] + pub unsafe fn browser_isLeafItem(&self, browser: &NSBrowser, item: Option<&Object>) + -> bool; + + #[optional] + #[method_id(@__retain_semantics Other browser:objectValueForItem:)] + pub unsafe fn browser_objectValueForItem( + &self, + browser: &NSBrowser, + item: Option<&Object>, + ) -> Option>; + + #[optional] + #[method(browser:heightOfRow:inColumn:)] + pub unsafe fn browser_heightOfRow_inColumn( + &self, + browser: &NSBrowser, + row: NSInteger, + columnIndex: NSInteger, + ) -> CGFloat; + + #[optional] + #[method_id(@__retain_semantics Other rootItemForBrowser:)] + pub unsafe fn rootItemForBrowser(&self, browser: &NSBrowser) -> Option>; + + #[optional] + #[method(browser:setObjectValue:forItem:)] + pub unsafe fn browser_setObjectValue_forItem( + &self, + browser: &NSBrowser, + object: Option<&Object>, + item: Option<&Object>, + ); + + #[optional] + #[method(browser:shouldEditItem:)] + pub unsafe fn browser_shouldEditItem( + &self, + browser: &NSBrowser, + item: Option<&Object>, + ) -> bool; + + #[optional] + #[method(browser:willDisplayCell:atRow:column:)] + pub unsafe fn browser_willDisplayCell_atRow_column( + &self, + sender: &NSBrowser, + cell: &Object, + row: NSInteger, + column: NSInteger, + ); + + #[optional] + #[method_id(@__retain_semantics Other browser:titleOfColumn:)] + pub unsafe fn browser_titleOfColumn( + &self, + sender: &NSBrowser, + column: NSInteger, + ) -> Option>; + + #[optional] + #[method(browser:selectCellWithString:inColumn:)] + pub unsafe fn browser_selectCellWithString_inColumn( + &self, + sender: &NSBrowser, + title: &NSString, + column: NSInteger, + ) -> bool; + + #[optional] + #[method(browser:selectRow:inColumn:)] + pub unsafe fn browser_selectRow_inColumn( + &self, + sender: &NSBrowser, + row: NSInteger, + column: NSInteger, + ) -> bool; + + #[optional] + #[method(browser:isColumnValid:)] + pub unsafe fn browser_isColumnValid(&self, sender: &NSBrowser, column: NSInteger) -> bool; + + #[optional] + #[method(browserWillScroll:)] + pub unsafe fn browserWillScroll(&self, sender: &NSBrowser); + + #[optional] + #[method(browserDidScroll:)] + pub unsafe fn browserDidScroll(&self, sender: &NSBrowser); + + #[optional] + #[method(browser:shouldSizeColumn:forUserResize:toWidth:)] + pub unsafe fn browser_shouldSizeColumn_forUserResize_toWidth( + &self, + browser: &NSBrowser, + columnIndex: NSInteger, + forUserResize: bool, + suggestedWidth: CGFloat, + ) -> CGFloat; + + #[optional] + #[method(browser:sizeToFitWidthOfColumn:)] + pub unsafe fn browser_sizeToFitWidthOfColumn( + &self, + browser: &NSBrowser, + columnIndex: NSInteger, + ) -> CGFloat; + + #[optional] + #[method(browserColumnConfigurationDidChange:)] + pub unsafe fn browserColumnConfigurationDidChange(&self, notification: &NSNotification); + + #[optional] + #[method(browser:shouldShowCellExpansionForRow:column:)] + pub unsafe fn browser_shouldShowCellExpansionForRow_column( + &self, + browser: &NSBrowser, + row: NSInteger, + column: NSInteger, + ) -> bool; + + #[optional] + #[method(browser:writeRowsWithIndexes:inColumn:toPasteboard:)] + pub unsafe fn browser_writeRowsWithIndexes_inColumn_toPasteboard( + &self, + browser: &NSBrowser, + rowIndexes: &NSIndexSet, + column: NSInteger, + pasteboard: &NSPasteboard, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other browser:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:inColumn:)] + pub unsafe fn browser_namesOfPromisedFilesDroppedAtDestination_forDraggedRowsWithIndexes_inColumn( + &self, + browser: &NSBrowser, + dropDestination: &NSURL, + rowIndexes: &NSIndexSet, + column: NSInteger, + ) -> Id, Shared>; + + #[optional] + #[method(browser:canDragRowsWithIndexes:inColumn:withEvent:)] + pub unsafe fn browser_canDragRowsWithIndexes_inColumn_withEvent( + &self, + browser: &NSBrowser, + rowIndexes: &NSIndexSet, + column: NSInteger, + event: &NSEvent, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other browser:draggingImageForRowsWithIndexes:inColumn:withEvent:offset:)] + pub unsafe fn browser_draggingImageForRowsWithIndexes_inColumn_withEvent_offset( + &self, + browser: &NSBrowser, + rowIndexes: &NSIndexSet, + column: NSInteger, + event: &NSEvent, + dragImageOffset: NSPointPointer, + ) -> Option>; + + #[optional] + #[method(browser:validateDrop:proposedRow:column:dropOperation:)] + pub unsafe fn browser_validateDrop_proposedRow_column_dropOperation( + &self, + browser: &NSBrowser, + info: &NSDraggingInfo, + row: NonNull, + column: NonNull, + dropOperation: NonNull, + ) -> NSDragOperation; + + #[optional] + #[method(browser:acceptDrop:atRow:column:dropOperation:)] + pub unsafe fn browser_acceptDrop_atRow_column_dropOperation( + &self, + browser: &NSBrowser, + info: &NSDraggingInfo, + row: NSInteger, + column: NSInteger, + dropOperation: NSBrowserDropOperation, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other browser:typeSelectStringForRow:inColumn:)] + pub unsafe fn browser_typeSelectStringForRow_inColumn( + &self, + browser: &NSBrowser, + row: NSInteger, + column: NSInteger, + ) -> Option>; + + #[optional] + #[method(browser:shouldTypeSelectForEvent:withCurrentSearchString:)] + pub unsafe fn browser_shouldTypeSelectForEvent_withCurrentSearchString( + &self, + browser: &NSBrowser, + event: &NSEvent, + searchString: Option<&NSString>, + ) -> bool; + + #[optional] + #[method(browser:nextTypeSelectMatchFromRow:toRow:inColumn:forString:)] + pub unsafe fn browser_nextTypeSelectMatchFromRow_toRow_inColumn_forString( + &self, + browser: &NSBrowser, + startRow: NSInteger, + endRow: NSInteger, + column: NSInteger, + searchString: Option<&NSString>, + ) -> NSInteger; + + #[optional] + #[method_id(@__retain_semantics Other browser:previewViewControllerForLeafItem:)] + pub unsafe fn browser_previewViewControllerForLeafItem( + &self, + browser: &NSBrowser, + item: &Object, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other browser:headerViewControllerForItem:)] + pub unsafe fn browser_headerViewControllerForItem( + &self, + browser: &NSBrowser, + item: Option<&Object>, + ) -> Option>; + + #[optional] + #[method(browser:didChangeLastColumn:toColumn:)] + pub unsafe fn browser_didChangeLastColumn_toColumn( + &self, + browser: &NSBrowser, + oldLastColumn: NSInteger, + column: NSInteger, + ); + + #[optional] + #[method_id(@__retain_semantics Other browser:selectionIndexesForProposedSelection:inColumn:)] + pub unsafe fn browser_selectionIndexesForProposedSelection_inColumn( + &self, + browser: &NSBrowser, + proposedSelectionIndexes: &NSIndexSet, + column: NSInteger, + ) -> Id; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSBrowser { + #[method(setAcceptsArrowKeys:)] + pub unsafe fn setAcceptsArrowKeys(&self, flag: bool); + + #[method(acceptsArrowKeys)] + pub unsafe fn acceptsArrowKeys(&self) -> bool; + + #[method(displayColumn:)] + pub unsafe fn displayColumn(&self, column: NSInteger); + + #[method(displayAllColumns)] + pub unsafe fn displayAllColumns(&self); + + #[method(scrollViaScroller:)] + pub unsafe fn scrollViaScroller(&self, sender: Option<&NSScroller>); + + #[method(updateScroller)] + pub unsafe fn updateScroller(&self); + + #[method(setMatrixClass:)] + pub unsafe fn setMatrixClass(&self, factoryId: &Class); + + #[method(matrixClass)] + pub unsafe fn matrixClass(&self) -> &'static Class; + + #[method(columnOfMatrix:)] + pub unsafe fn columnOfMatrix(&self, matrix: &NSMatrix) -> NSInteger; + + #[method_id(@__retain_semantics Other matrixInColumn:)] + pub unsafe fn matrixInColumn(&self, column: NSInteger) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSBrowserCell.rs b/crates/icrate/src/generated/AppKit/NSBrowserCell.rs new file mode 100644 index 000000000..91f071e57 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSBrowserCell.rs @@ -0,0 +1,79 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSBrowserCell; + + unsafe impl ClassType for NSBrowserCell { + type Super = NSCell; + } +); + +extern_methods!( + unsafe impl NSBrowserCell { + #[method_id(@__retain_semantics Init initTextCell:)] + pub unsafe fn initTextCell( + this: Option>, + string: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initImageCell:)] + pub unsafe fn initImageCell( + this: Option>, + image: Option<&NSImage>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Other branchImage)] + pub unsafe fn branchImage() -> Option>; + + #[method_id(@__retain_semantics Other highlightedBranchImage)] + pub unsafe fn highlightedBranchImage() -> Option>; + + #[method_id(@__retain_semantics Other highlightColorInView:)] + pub unsafe fn highlightColorInView( + &self, + controlView: &NSView, + ) -> Option>; + + #[method(isLeaf)] + pub unsafe fn isLeaf(&self) -> bool; + + #[method(setLeaf:)] + pub unsafe fn setLeaf(&self, leaf: bool); + + #[method(isLoaded)] + pub unsafe fn isLoaded(&self) -> bool; + + #[method(setLoaded:)] + pub unsafe fn setLoaded(&self, loaded: bool); + + #[method(reset)] + pub unsafe fn reset(&self); + + #[method(set)] + pub unsafe fn set(&self); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + + #[method_id(@__retain_semantics Other alternateImage)] + pub unsafe fn alternateImage(&self) -> Option>; + + #[method(setAlternateImage:)] + pub unsafe fn setAlternateImage(&self, alternateImage: Option<&NSImage>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSButton.rs b/crates/icrate/src/generated/AppKit/NSButton.rs new file mode 100644 index 000000000..e03a35f53 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSButton.rs @@ -0,0 +1,258 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSButton; + + unsafe impl ClassType for NSButton { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSButton { + #[method_id(@__retain_semantics Other buttonWithTitle:image:target:action:)] + pub unsafe fn buttonWithTitle_image_target_action( + title: &NSString, + image: &NSImage, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Other buttonWithTitle:target:action:)] + pub unsafe fn buttonWithTitle_target_action( + title: &NSString, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Other buttonWithImage:target:action:)] + pub unsafe fn buttonWithImage_target_action( + image: &NSImage, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Other checkboxWithTitle:target:action:)] + pub unsafe fn checkboxWithTitle_target_action( + title: &NSString, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Other radioButtonWithTitle:target:action:)] + pub unsafe fn radioButtonWithTitle_target_action( + title: &NSString, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method(setButtonType:)] + pub unsafe fn setButtonType(&self, type_: NSButtonType); + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + + #[method_id(@__retain_semantics Other attributedTitle)] + pub unsafe fn attributedTitle(&self) -> Id; + + #[method(setAttributedTitle:)] + pub unsafe fn setAttributedTitle(&self, attributedTitle: &NSAttributedString); + + #[method_id(@__retain_semantics Other alternateTitle)] + pub unsafe fn alternateTitle(&self) -> Id; + + #[method(setAlternateTitle:)] + pub unsafe fn setAlternateTitle(&self, alternateTitle: &NSString); + + #[method_id(@__retain_semantics Other attributedAlternateTitle)] + pub unsafe fn attributedAlternateTitle(&self) -> Id; + + #[method(setAttributedAlternateTitle:)] + pub unsafe fn setAttributedAlternateTitle( + &self, + attributedAlternateTitle: &NSAttributedString, + ); + + #[method(hasDestructiveAction)] + pub unsafe fn hasDestructiveAction(&self) -> bool; + + #[method(setHasDestructiveAction:)] + pub unsafe fn setHasDestructiveAction(&self, hasDestructiveAction: bool); + + #[method_id(@__retain_semantics Other sound)] + pub unsafe fn sound(&self) -> Option>; + + #[method(setSound:)] + pub unsafe fn setSound(&self, sound: Option<&NSSound>); + + #[method(isSpringLoaded)] + pub unsafe fn isSpringLoaded(&self) -> bool; + + #[method(setSpringLoaded:)] + pub unsafe fn setSpringLoaded(&self, springLoaded: bool); + + #[method(maxAcceleratorLevel)] + pub unsafe fn maxAcceleratorLevel(&self) -> NSInteger; + + #[method(setMaxAcceleratorLevel:)] + pub unsafe fn setMaxAcceleratorLevel(&self, maxAcceleratorLevel: NSInteger); + + #[method(setPeriodicDelay:interval:)] + pub unsafe fn setPeriodicDelay_interval(&self, delay: c_float, interval: c_float); + + #[method(getPeriodicDelay:interval:)] + pub unsafe fn getPeriodicDelay_interval( + &self, + delay: NonNull, + interval: NonNull, + ); + + #[method(bezelStyle)] + pub unsafe fn bezelStyle(&self) -> NSBezelStyle; + + #[method(setBezelStyle:)] + pub unsafe fn setBezelStyle(&self, bezelStyle: NSBezelStyle); + + #[method(isBordered)] + pub unsafe fn isBordered(&self) -> bool; + + #[method(setBordered:)] + pub unsafe fn setBordered(&self, bordered: bool); + + #[method(isTransparent)] + pub unsafe fn isTransparent(&self) -> bool; + + #[method(setTransparent:)] + pub unsafe fn setTransparent(&self, transparent: bool); + + #[method(showsBorderOnlyWhileMouseInside)] + pub unsafe fn showsBorderOnlyWhileMouseInside(&self) -> bool; + + #[method(setShowsBorderOnlyWhileMouseInside:)] + pub unsafe fn setShowsBorderOnlyWhileMouseInside( + &self, + showsBorderOnlyWhileMouseInside: bool, + ); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + + #[method_id(@__retain_semantics Other alternateImage)] + pub unsafe fn alternateImage(&self) -> Option>; + + #[method(setAlternateImage:)] + pub unsafe fn setAlternateImage(&self, alternateImage: Option<&NSImage>); + + #[method(imagePosition)] + pub unsafe fn imagePosition(&self) -> NSCellImagePosition; + + #[method(setImagePosition:)] + pub unsafe fn setImagePosition(&self, imagePosition: NSCellImagePosition); + + #[method(imageScaling)] + pub unsafe fn imageScaling(&self) -> NSImageScaling; + + #[method(setImageScaling:)] + pub unsafe fn setImageScaling(&self, imageScaling: NSImageScaling); + + #[method(imageHugsTitle)] + pub unsafe fn imageHugsTitle(&self) -> bool; + + #[method(setImageHugsTitle:)] + pub unsafe fn setImageHugsTitle(&self, imageHugsTitle: bool); + + #[method_id(@__retain_semantics Other symbolConfiguration)] + pub unsafe fn symbolConfiguration(&self) -> Option>; + + #[method(setSymbolConfiguration:)] + pub unsafe fn setSymbolConfiguration( + &self, + symbolConfiguration: Option<&NSImageSymbolConfiguration>, + ); + + #[method_id(@__retain_semantics Other bezelColor)] + pub unsafe fn bezelColor(&self) -> Option>; + + #[method(setBezelColor:)] + pub unsafe fn setBezelColor(&self, bezelColor: Option<&NSColor>); + + #[method_id(@__retain_semantics Other contentTintColor)] + pub unsafe fn contentTintColor(&self) -> Option>; + + #[method(setContentTintColor:)] + pub unsafe fn setContentTintColor(&self, contentTintColor: Option<&NSColor>); + + #[method(state)] + pub unsafe fn state(&self) -> NSControlStateValue; + + #[method(setState:)] + pub unsafe fn setState(&self, state: NSControlStateValue); + + #[method(allowsMixedState)] + pub unsafe fn allowsMixedState(&self) -> bool; + + #[method(setAllowsMixedState:)] + pub unsafe fn setAllowsMixedState(&self, allowsMixedState: bool); + + #[method(setNextState)] + pub unsafe fn setNextState(&self); + + #[method(highlight:)] + pub unsafe fn highlight(&self, flag: bool); + + #[method_id(@__retain_semantics Other keyEquivalent)] + pub unsafe fn keyEquivalent(&self) -> Id; + + #[method(setKeyEquivalent:)] + pub unsafe fn setKeyEquivalent(&self, keyEquivalent: &NSString); + + #[method(keyEquivalentModifierMask)] + pub unsafe fn keyEquivalentModifierMask(&self) -> NSEventModifierFlags; + + #[method(setKeyEquivalentModifierMask:)] + pub unsafe fn setKeyEquivalentModifierMask( + &self, + keyEquivalentModifierMask: NSEventModifierFlags, + ); + + #[method(performKeyEquivalent:)] + pub unsafe fn performKeyEquivalent(&self, key: &NSEvent) -> bool; + + #[method(compressWithPrioritizedCompressionOptions:)] + pub unsafe fn compressWithPrioritizedCompressionOptions( + &self, + prioritizedOptions: &NSArray, + ); + + #[method(minimumSizeWithPrioritizedCompressionOptions:)] + pub unsafe fn minimumSizeWithPrioritizedCompressionOptions( + &self, + prioritizedOptions: &NSArray, + ) -> NSSize; + + #[method_id(@__retain_semantics Other activeCompressionOptions)] + pub unsafe fn activeCompressionOptions( + &self, + ) -> Id; + } +); + +extern_methods!( + /// NSButtonDeprecated + unsafe impl NSButton { + #[method(setTitleWithMnemonic:)] + pub unsafe fn setTitleWithMnemonic(&self, stringWithAmpersand: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSButtonCell.rs b/crates/icrate/src/generated/AppKit/NSButtonCell.rs new file mode 100644 index 000000000..a5f579231 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSButtonCell.rs @@ -0,0 +1,329 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSButtonType { + NSButtonTypeMomentaryLight = 0, + NSButtonTypePushOnPushOff = 1, + NSButtonTypeToggle = 2, + NSButtonTypeSwitch = 3, + NSButtonTypeRadio = 4, + NSButtonTypeMomentaryChange = 5, + NSButtonTypeOnOff = 6, + NSButtonTypeMomentaryPushIn = 7, + NSButtonTypeAccelerator = 8, + NSButtonTypeMultiLevelAccelerator = 9, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSBezelStyle { + NSBezelStyleRounded = 1, + NSBezelStyleRegularSquare = 2, + NSBezelStyleDisclosure = 5, + NSBezelStyleShadowlessSquare = 6, + NSBezelStyleCircular = 7, + NSBezelStyleTexturedSquare = 8, + NSBezelStyleHelpButton = 9, + NSBezelStyleSmallSquare = 10, + NSBezelStyleTexturedRounded = 11, + NSBezelStyleRoundRect = 12, + NSBezelStyleRecessed = 13, + NSBezelStyleRoundedDisclosure = 14, + NSBezelStyleInline = 15, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSButtonCell; + + unsafe impl ClassType for NSButtonCell { + type Super = NSActionCell; + } +); + +extern_methods!( + unsafe impl NSButtonCell { + #[method_id(@__retain_semantics Init initTextCell:)] + pub unsafe fn initTextCell( + this: Option>, + string: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initImageCell:)] + pub unsafe fn initImageCell( + this: Option>, + image: Option<&NSImage>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method(bezelStyle)] + pub unsafe fn bezelStyle(&self) -> NSBezelStyle; + + #[method(setBezelStyle:)] + pub unsafe fn setBezelStyle(&self, bezelStyle: NSBezelStyle); + + #[method(setButtonType:)] + pub unsafe fn setButtonType(&self, type_: NSButtonType); + + #[method(highlightsBy)] + pub unsafe fn highlightsBy(&self) -> NSCellStyleMask; + + #[method(setHighlightsBy:)] + pub unsafe fn setHighlightsBy(&self, highlightsBy: NSCellStyleMask); + + #[method(showsStateBy)] + pub unsafe fn showsStateBy(&self) -> NSCellStyleMask; + + #[method(setShowsStateBy:)] + pub unsafe fn setShowsStateBy(&self, showsStateBy: NSCellStyleMask); + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: Option<&NSString>); + + #[method_id(@__retain_semantics Other attributedTitle)] + pub unsafe fn attributedTitle(&self) -> Id; + + #[method(setAttributedTitle:)] + pub unsafe fn setAttributedTitle(&self, attributedTitle: &NSAttributedString); + + #[method_id(@__retain_semantics Other alternateTitle)] + pub unsafe fn alternateTitle(&self) -> Id; + + #[method(setAlternateTitle:)] + pub unsafe fn setAlternateTitle(&self, alternateTitle: &NSString); + + #[method_id(@__retain_semantics Other attributedAlternateTitle)] + pub unsafe fn attributedAlternateTitle(&self) -> Id; + + #[method(setAttributedAlternateTitle:)] + pub unsafe fn setAttributedAlternateTitle( + &self, + attributedAlternateTitle: &NSAttributedString, + ); + + #[method_id(@__retain_semantics Other alternateImage)] + pub unsafe fn alternateImage(&self) -> Option>; + + #[method(setAlternateImage:)] + pub unsafe fn setAlternateImage(&self, alternateImage: Option<&NSImage>); + + #[method(imagePosition)] + pub unsafe fn imagePosition(&self) -> NSCellImagePosition; + + #[method(setImagePosition:)] + pub unsafe fn setImagePosition(&self, imagePosition: NSCellImagePosition); + + #[method(imageScaling)] + pub unsafe fn imageScaling(&self) -> NSImageScaling; + + #[method(setImageScaling:)] + pub unsafe fn setImageScaling(&self, imageScaling: NSImageScaling); + + #[method_id(@__retain_semantics Other keyEquivalent)] + pub unsafe fn keyEquivalent(&self) -> Id; + + #[method(setKeyEquivalent:)] + pub unsafe fn setKeyEquivalent(&self, keyEquivalent: &NSString); + + #[method(keyEquivalentModifierMask)] + pub unsafe fn keyEquivalentModifierMask(&self) -> NSEventModifierFlags; + + #[method(setKeyEquivalentModifierMask:)] + pub unsafe fn setKeyEquivalentModifierMask( + &self, + keyEquivalentModifierMask: NSEventModifierFlags, + ); + + #[method(isTransparent)] + pub unsafe fn isTransparent(&self) -> bool; + + #[method(setTransparent:)] + pub unsafe fn setTransparent(&self, transparent: bool); + + #[method(isOpaque)] + pub unsafe fn isOpaque(&self) -> bool; + + #[method(imageDimsWhenDisabled)] + pub unsafe fn imageDimsWhenDisabled(&self) -> bool; + + #[method(setImageDimsWhenDisabled:)] + pub unsafe fn setImageDimsWhenDisabled(&self, imageDimsWhenDisabled: bool); + + #[method(showsBorderOnlyWhileMouseInside)] + pub unsafe fn showsBorderOnlyWhileMouseInside(&self) -> bool; + + #[method(setShowsBorderOnlyWhileMouseInside:)] + pub unsafe fn setShowsBorderOnlyWhileMouseInside( + &self, + showsBorderOnlyWhileMouseInside: bool, + ); + + #[method_id(@__retain_semantics Other sound)] + pub unsafe fn sound(&self) -> Option>; + + #[method(setSound:)] + pub unsafe fn setSound(&self, sound: Option<&NSSound>); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Option>; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: Option<&NSColor>); + + #[method(setPeriodicDelay:interval:)] + pub unsafe fn setPeriodicDelay_interval(&self, delay: c_float, interval: c_float); + + #[method(getPeriodicDelay:interval:)] + pub unsafe fn getPeriodicDelay_interval( + &self, + delay: NonNull, + interval: NonNull, + ); + + #[method(performClick:)] + pub unsafe fn performClick(&self, sender: Option<&Object>); + + #[method(mouseEntered:)] + pub unsafe fn mouseEntered(&self, event: &NSEvent); + + #[method(mouseExited:)] + pub unsafe fn mouseExited(&self, event: &NSEvent); + + #[method(drawBezelWithFrame:inView:)] + pub unsafe fn drawBezelWithFrame_inView(&self, frame: NSRect, controlView: &NSView); + + #[method(drawImage:withFrame:inView:)] + pub unsafe fn drawImage_withFrame_inView( + &self, + image: &NSImage, + frame: NSRect, + controlView: &NSView, + ); + + #[method(drawTitle:withFrame:inView:)] + pub unsafe fn drawTitle_withFrame_inView( + &self, + title: &NSAttributedString, + frame: NSRect, + controlView: &NSView, + ) -> NSRect; + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSGradientType { + NSGradientNone = 0, + NSGradientConcaveWeak = 1, + NSGradientConcaveStrong = 2, + NSGradientConvexWeak = 3, + NSGradientConvexStrong = 4, + } +); + +extern_static!(NSMomentaryLightButton: NSButtonType = NSButtonTypeMomentaryLight); + +extern_static!(NSPushOnPushOffButton: NSButtonType = NSButtonTypePushOnPushOff); + +extern_static!(NSToggleButton: NSButtonType = NSButtonTypeToggle); + +extern_static!(NSSwitchButton: NSButtonType = NSButtonTypeSwitch); + +extern_static!(NSRadioButton: NSButtonType = NSButtonTypeRadio); + +extern_static!(NSMomentaryChangeButton: NSButtonType = NSButtonTypeMomentaryChange); + +extern_static!(NSOnOffButton: NSButtonType = NSButtonTypeOnOff); + +extern_static!(NSMomentaryPushInButton: NSButtonType = NSButtonTypeMomentaryPushIn); + +extern_static!(NSAcceleratorButton: NSButtonType = NSButtonTypeAccelerator); + +extern_static!(NSMultiLevelAcceleratorButton: NSButtonType = NSButtonTypeMultiLevelAccelerator); + +extern_static!(NSMomentaryPushButton: NSButtonType = NSButtonTypeMomentaryLight); + +extern_static!(NSMomentaryLight: NSButtonType = NSButtonTypeMomentaryPushIn); + +extern_static!(NSRoundedBezelStyle: NSBezelStyle = NSBezelStyleRounded); + +extern_static!(NSRegularSquareBezelStyle: NSBezelStyle = NSBezelStyleRegularSquare); + +extern_static!(NSDisclosureBezelStyle: NSBezelStyle = NSBezelStyleDisclosure); + +extern_static!(NSShadowlessSquareBezelStyle: NSBezelStyle = NSBezelStyleShadowlessSquare); + +extern_static!(NSCircularBezelStyle: NSBezelStyle = NSBezelStyleCircular); + +extern_static!(NSTexturedSquareBezelStyle: NSBezelStyle = NSBezelStyleTexturedSquare); + +extern_static!(NSHelpButtonBezelStyle: NSBezelStyle = NSBezelStyleHelpButton); + +extern_static!(NSSmallSquareBezelStyle: NSBezelStyle = NSBezelStyleSmallSquare); + +extern_static!(NSTexturedRoundedBezelStyle: NSBezelStyle = NSBezelStyleTexturedRounded); + +extern_static!(NSRoundRectBezelStyle: NSBezelStyle = NSBezelStyleRoundRect); + +extern_static!(NSRecessedBezelStyle: NSBezelStyle = NSBezelStyleRecessed); + +extern_static!(NSRoundedDisclosureBezelStyle: NSBezelStyle = NSBezelStyleRoundedDisclosure); + +extern_static!(NSInlineBezelStyle: NSBezelStyle = NSBezelStyleInline); + +extern_static!(NSSmallIconButtonBezelStyle: NSBezelStyle = 2); + +extern_static!(NSThickSquareBezelStyle: NSBezelStyle = 3); + +extern_static!(NSThickerSquareBezelStyle: NSBezelStyle = 4); + +extern_methods!( + /// NSDeprecated + unsafe impl NSButtonCell { + #[method(gradientType)] + pub unsafe fn gradientType(&self) -> NSGradientType; + + #[method(setGradientType:)] + pub unsafe fn setGradientType(&self, gradientType: NSGradientType); + + #[method(setTitleWithMnemonic:)] + pub unsafe fn setTitleWithMnemonic(&self, stringWithAmpersand: Option<&NSString>); + + #[method(setAlternateTitleWithMnemonic:)] + pub unsafe fn setAlternateTitleWithMnemonic(&self, stringWithAmpersand: Option<&NSString>); + + #[method(setAlternateMnemonicLocation:)] + pub unsafe fn setAlternateMnemonicLocation(&self, location: NSUInteger); + + #[method(alternateMnemonicLocation)] + pub unsafe fn alternateMnemonicLocation(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other alternateMnemonic)] + pub unsafe fn alternateMnemonic(&self) -> Option>; + + #[method_id(@__retain_semantics Other keyEquivalentFont)] + pub unsafe fn keyEquivalentFont(&self) -> Option>; + + #[method(setKeyEquivalentFont:)] + pub unsafe fn setKeyEquivalentFont(&self, keyEquivalentFont: Option<&NSFont>); + + #[method(setKeyEquivalentFont:size:)] + pub unsafe fn setKeyEquivalentFont_size(&self, fontName: &NSString, fontSize: CGFloat); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSButtonTouchBarItem.rs b/crates/icrate/src/generated/AppKit/NSButtonTouchBarItem.rs new file mode 100644 index 000000000..96310517a --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSButtonTouchBarItem.rs @@ -0,0 +1,86 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSButtonTouchBarItem; + + unsafe impl ClassType for NSButtonTouchBarItem { + type Super = NSTouchBarItem; + } +); + +extern_methods!( + unsafe impl NSButtonTouchBarItem { + #[method_id(@__retain_semantics Other buttonTouchBarItemWithIdentifier:title:target:action:)] + pub unsafe fn buttonTouchBarItemWithIdentifier_title_target_action( + identifier: &NSTouchBarItemIdentifier, + title: &NSString, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Other buttonTouchBarItemWithIdentifier:image:target:action:)] + pub unsafe fn buttonTouchBarItemWithIdentifier_image_target_action( + identifier: &NSTouchBarItemIdentifier, + image: &NSImage, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Other buttonTouchBarItemWithIdentifier:title:image:target:action:)] + pub unsafe fn buttonTouchBarItemWithIdentifier_title_image_target_action( + identifier: &NSTouchBarItemIdentifier, + title: &NSString, + image: &NSImage, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + + #[method_id(@__retain_semantics Other bezelColor)] + pub unsafe fn bezelColor(&self) -> Option>; + + #[method(setBezelColor:)] + pub unsafe fn setBezelColor(&self, bezelColor: Option<&NSColor>); + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: OptionSel); + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + + #[method_id(@__retain_semantics Other customizationLabel)] + pub unsafe fn customizationLabel(&self) -> Id; + + #[method(setCustomizationLabel:)] + pub unsafe fn setCustomizationLabel(&self, customizationLabel: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSCIImageRep.rs b/crates/icrate/src/generated/AppKit/NSCIImageRep.rs new file mode 100644 index 000000000..661a20881 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCIImageRep.rs @@ -0,0 +1,6 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; diff --git a/crates/icrate/src/generated/AppKit/NSCachedImageRep.rs b/crates/icrate/src/generated/AppKit/NSCachedImageRep.rs new file mode 100644 index 000000000..fca572917 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCachedImageRep.rs @@ -0,0 +1,41 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSCachedImageRep; + + unsafe impl ClassType for NSCachedImageRep { + type Super = NSImageRep; + } +); + +extern_methods!( + unsafe impl NSCachedImageRep { + #[method_id(@__retain_semantics Init initWithWindow:rect:)] + pub unsafe fn initWithWindow_rect( + this: Option>, + win: Option<&NSWindow>, + rect: NSRect, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithSize:depth:separate:alpha:)] + pub unsafe fn initWithSize_depth_separate_alpha( + this: Option>, + size: NSSize, + depth: NSWindowDepth, + flag: bool, + alpha: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other window)] + pub unsafe fn window(&self) -> Option>; + + #[method(rect)] + pub unsafe fn rect(&self) -> NSRect; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSCandidateListTouchBarItem.rs b/crates/icrate/src/generated/AppKit/NSCandidateListTouchBarItem.rs new file mode 100644 index 000000000..36a7044b7 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCandidateListTouchBarItem.rs @@ -0,0 +1,141 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSCandidateListTouchBarItem { + _inner0: PhantomData<*mut CandidateType>, + } + + unsafe impl ClassType for NSCandidateListTouchBarItem { + type Super = NSTouchBarItem; + } +); + +extern_methods!( + unsafe impl NSCandidateListTouchBarItem { + #[method_id(@__retain_semantics Other client)] + pub unsafe fn client(&self) -> Option>; + + #[method(setClient:)] + pub unsafe fn setClient(&self, client: Option<&TodoProtocols>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSCandidateListTouchBarItemDelegate>); + + #[method(isCollapsed)] + pub unsafe fn isCollapsed(&self) -> bool; + + #[method(setCollapsed:)] + pub unsafe fn setCollapsed(&self, collapsed: bool); + + #[method(allowsCollapsing)] + pub unsafe fn allowsCollapsing(&self) -> bool; + + #[method(setAllowsCollapsing:)] + pub unsafe fn setAllowsCollapsing(&self, allowsCollapsing: bool); + + #[method(isCandidateListVisible)] + pub unsafe fn isCandidateListVisible(&self) -> bool; + + #[method(updateWithInsertionPointVisibility:)] + pub unsafe fn updateWithInsertionPointVisibility(&self, isVisible: bool); + + #[method(allowsTextInputContextCandidates)] + pub unsafe fn allowsTextInputContextCandidates(&self) -> bool; + + #[method(setAllowsTextInputContextCandidates:)] + pub unsafe fn setAllowsTextInputContextCandidates( + &self, + allowsTextInputContextCandidates: bool, + ); + + #[method(attributedStringForCandidate)] + pub unsafe fn attributedStringForCandidate( + &self, + ) -> *mut Block<(NonNull, NSInteger), NonNull>; + + #[method(setAttributedStringForCandidate:)] + pub unsafe fn setAttributedStringForCandidate( + &self, + attributedStringForCandidate: Option< + &Block<(NonNull, NSInteger), NonNull>, + >, + ); + + #[method_id(@__retain_semantics Other candidates)] + pub unsafe fn candidates(&self) -> Id, Shared>; + + #[method(setCandidates:forSelectedRange:inString:)] + pub unsafe fn setCandidates_forSelectedRange_inString( + &self, + candidates: &NSArray, + selectedRange: NSRange, + originalString: Option<&NSString>, + ); + + #[method_id(@__retain_semantics Other customizationLabel)] + pub unsafe fn customizationLabel(&self) -> Id; + + #[method(setCustomizationLabel:)] + pub unsafe fn setCustomizationLabel(&self, customizationLabel: Option<&NSString>); + } +); + +extern_protocol!( + pub struct NSCandidateListTouchBarItemDelegate; + + unsafe impl NSCandidateListTouchBarItemDelegate { + #[optional] + #[method(candidateListTouchBarItem:beginSelectingCandidateAtIndex:)] + pub unsafe fn candidateListTouchBarItem_beginSelectingCandidateAtIndex( + &self, + anItem: &NSCandidateListTouchBarItem, + index: NSInteger, + ); + + #[optional] + #[method(candidateListTouchBarItem:changeSelectionFromCandidateAtIndex:toIndex:)] + pub unsafe fn candidateListTouchBarItem_changeSelectionFromCandidateAtIndex_toIndex( + &self, + anItem: &NSCandidateListTouchBarItem, + previousIndex: NSInteger, + index: NSInteger, + ); + + #[optional] + #[method(candidateListTouchBarItem:endSelectingCandidateAtIndex:)] + pub unsafe fn candidateListTouchBarItem_endSelectingCandidateAtIndex( + &self, + anItem: &NSCandidateListTouchBarItem, + index: NSInteger, + ); + + #[optional] + #[method(candidateListTouchBarItem:changedCandidateListVisibility:)] + pub unsafe fn candidateListTouchBarItem_changedCandidateListVisibility( + &self, + anItem: &NSCandidateListTouchBarItem, + isVisible: bool, + ); + } +); + +extern_methods!( + /// NSCandidateListTouchBarItem + unsafe impl NSView { + #[method_id(@__retain_semantics Other candidateListTouchBarItem)] + pub unsafe fn candidateListTouchBarItem( + &self, + ) -> Option>; + } +); + +extern_static!(NSTouchBarItemIdentifierCandidateList: &'static NSTouchBarItemIdentifier); diff --git a/crates/icrate/src/generated/AppKit/NSCell.rs b/crates/icrate/src/generated/AppKit/NSCell.rs new file mode 100644 index 000000000..d6f7fc9e1 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCell.rs @@ -0,0 +1,791 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSCellType { + NSNullCellType = 0, + NSTextCellType = 1, + NSImageCellType = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSCellAttribute { + NSCellDisabled = 0, + NSCellState = 1, + NSPushInCell = 2, + NSCellEditable = 3, + NSChangeGrayCell = 4, + NSCellHighlighted = 5, + NSCellLightsByContents = 6, + NSCellLightsByGray = 7, + NSChangeBackgroundCell = 8, + NSCellLightsByBackground = 9, + NSCellIsBordered = 10, + NSCellHasOverlappingImage = 11, + NSCellHasImageHorizontal = 12, + NSCellHasImageOnLeftOrBottom = 13, + NSCellChangesContents = 14, + NSCellIsInsetButton = 15, + NSCellAllowsMixedState = 16, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSCellImagePosition { + NSNoImage = 0, + NSImageOnly = 1, + NSImageLeft = 2, + NSImageRight = 3, + NSImageBelow = 4, + NSImageAbove = 5, + NSImageOverlaps = 6, + NSImageLeading = 7, + NSImageTrailing = 8, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSImageScaling { + NSImageScaleProportionallyDown = 0, + NSImageScaleAxesIndependently = 1, + NSImageScaleNone = 2, + NSImageScaleProportionallyUpOrDown = 3, + NSScaleProportionally = 0, + NSScaleToFit = 1, + NSScaleNone = 2, + } +); + +pub type NSControlStateValue = NSInteger; + +extern_static!(NSControlStateValueMixed: NSControlStateValue = -1); + +extern_static!(NSControlStateValueOff: NSControlStateValue = 0); + +extern_static!(NSControlStateValueOn: NSControlStateValue = 1); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSCellStyleMask { + NSNoCellMask = 0, + NSContentsCellMask = 1, + NSPushInCellMask = 2, + NSChangeGrayCellMask = 4, + NSChangeBackgroundCellMask = 8, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSControlTint { + NSDefaultControlTint = 0, + NSBlueControlTint = 1, + NSGraphiteControlTint = 6, + NSClearControlTint = 7, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSControlSize { + NSControlSizeRegular = 0, + NSControlSizeSmall = 1, + NSControlSizeMini = 2, + NSControlSizeLarge = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCell; + + unsafe impl ClassType for NSCell { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCell { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initTextCell:)] + pub unsafe fn initTextCell( + this: Option>, + string: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initImageCell:)] + pub unsafe fn initImageCell( + this: Option>, + image: Option<&NSImage>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method(prefersTrackingUntilMouseUp)] + pub unsafe fn prefersTrackingUntilMouseUp() -> bool; + + #[method_id(@__retain_semantics Other controlView)] + pub unsafe fn controlView(&self) -> Option>; + + #[method(setControlView:)] + pub unsafe fn setControlView(&self, controlView: Option<&NSView>); + + #[method(type)] + pub unsafe fn type_(&self) -> NSCellType; + + #[method(setType:)] + pub unsafe fn setType(&self, type_: NSCellType); + + #[method(state)] + pub unsafe fn state(&self) -> NSControlStateValue; + + #[method(setState:)] + pub unsafe fn setState(&self, state: NSControlStateValue); + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: OptionSel); + + #[method(tag)] + pub unsafe fn tag(&self) -> NSInteger; + + #[method(setTag:)] + pub unsafe fn setTag(&self, tag: NSInteger); + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + + #[method(isOpaque)] + pub unsafe fn isOpaque(&self) -> bool; + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + + #[method(sendActionOn:)] + pub unsafe fn sendActionOn(&self, mask: NSEventMask) -> NSInteger; + + #[method(isContinuous)] + pub unsafe fn isContinuous(&self) -> bool; + + #[method(setContinuous:)] + pub unsafe fn setContinuous(&self, continuous: bool); + + #[method(isEditable)] + pub unsafe fn isEditable(&self) -> bool; + + #[method(setEditable:)] + pub unsafe fn setEditable(&self, editable: bool); + + #[method(isSelectable)] + pub unsafe fn isSelectable(&self) -> bool; + + #[method(setSelectable:)] + pub unsafe fn setSelectable(&self, selectable: bool); + + #[method(isBordered)] + pub unsafe fn isBordered(&self) -> bool; + + #[method(setBordered:)] + pub unsafe fn setBordered(&self, bordered: bool); + + #[method(isBezeled)] + pub unsafe fn isBezeled(&self) -> bool; + + #[method(setBezeled:)] + pub unsafe fn setBezeled(&self, bezeled: bool); + + #[method(isScrollable)] + pub unsafe fn isScrollable(&self) -> bool; + + #[method(setScrollable:)] + pub unsafe fn setScrollable(&self, scrollable: bool); + + #[method(isHighlighted)] + pub unsafe fn isHighlighted(&self) -> bool; + + #[method(setHighlighted:)] + pub unsafe fn setHighlighted(&self, highlighted: bool); + + #[method(alignment)] + pub unsafe fn alignment(&self) -> NSTextAlignment; + + #[method(setAlignment:)] + pub unsafe fn setAlignment(&self, alignment: NSTextAlignment); + + #[method(wraps)] + pub unsafe fn wraps(&self) -> bool; + + #[method(setWraps:)] + pub unsafe fn setWraps(&self, wraps: bool); + + #[method_id(@__retain_semantics Other font)] + pub unsafe fn font(&self) -> Option>; + + #[method(setFont:)] + pub unsafe fn setFont(&self, font: Option<&NSFont>); + + #[method_id(@__retain_semantics Other keyEquivalent)] + pub unsafe fn keyEquivalent(&self) -> Id; + + #[method_id(@__retain_semantics Other formatter)] + pub unsafe fn formatter(&self) -> Option>; + + #[method(setFormatter:)] + pub unsafe fn setFormatter(&self, formatter: Option<&NSFormatter>); + + #[method_id(@__retain_semantics Other objectValue)] + pub unsafe fn objectValue(&self) -> Option>; + + #[method(setObjectValue:)] + pub unsafe fn setObjectValue(&self, objectValue: Option<&Object>); + + #[method(hasValidObjectValue)] + pub unsafe fn hasValidObjectValue(&self) -> bool; + + #[method_id(@__retain_semantics Other stringValue)] + pub unsafe fn stringValue(&self) -> Id; + + #[method(setStringValue:)] + pub unsafe fn setStringValue(&self, stringValue: &NSString); + + #[method(compare:)] + pub unsafe fn compare(&self, otherCell: &Object) -> NSComparisonResult; + + #[method(intValue)] + pub unsafe fn intValue(&self) -> c_int; + + #[method(setIntValue:)] + pub unsafe fn setIntValue(&self, intValue: c_int); + + #[method(floatValue)] + pub unsafe fn floatValue(&self) -> c_float; + + #[method(setFloatValue:)] + pub unsafe fn setFloatValue(&self, floatValue: c_float); + + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + + #[method(setDoubleValue:)] + pub unsafe fn setDoubleValue(&self, doubleValue: c_double); + + #[method(integerValue)] + pub unsafe fn integerValue(&self) -> NSInteger; + + #[method(setIntegerValue:)] + pub unsafe fn setIntegerValue(&self, integerValue: NSInteger); + + #[method(takeIntValueFrom:)] + pub unsafe fn takeIntValueFrom(&self, sender: Option<&Object>); + + #[method(takeFloatValueFrom:)] + pub unsafe fn takeFloatValueFrom(&self, sender: Option<&Object>); + + #[method(takeDoubleValueFrom:)] + pub unsafe fn takeDoubleValueFrom(&self, sender: Option<&Object>); + + #[method(takeStringValueFrom:)] + pub unsafe fn takeStringValueFrom(&self, sender: Option<&Object>); + + #[method(takeObjectValueFrom:)] + pub unsafe fn takeObjectValueFrom(&self, sender: Option<&Object>); + + #[method(takeIntegerValueFrom:)] + pub unsafe fn takeIntegerValueFrom(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + + #[method(controlSize)] + pub unsafe fn controlSize(&self) -> NSControlSize; + + #[method(setControlSize:)] + pub unsafe fn setControlSize(&self, controlSize: NSControlSize); + + #[method_id(@__retain_semantics Other representedObject)] + pub unsafe fn representedObject(&self) -> Option>; + + #[method(setRepresentedObject:)] + pub unsafe fn setRepresentedObject(&self, representedObject: Option<&Object>); + + #[method(cellAttribute:)] + pub unsafe fn cellAttribute(&self, parameter: NSCellAttribute) -> NSInteger; + + #[method(setCellAttribute:to:)] + pub unsafe fn setCellAttribute_to(&self, parameter: NSCellAttribute, value: NSInteger); + + #[method(imageRectForBounds:)] + pub unsafe fn imageRectForBounds(&self, rect: NSRect) -> NSRect; + + #[method(titleRectForBounds:)] + pub unsafe fn titleRectForBounds(&self, rect: NSRect) -> NSRect; + + #[method(drawingRectForBounds:)] + pub unsafe fn drawingRectForBounds(&self, rect: NSRect) -> NSRect; + + #[method(cellSize)] + pub unsafe fn cellSize(&self) -> NSSize; + + #[method(cellSizeForBounds:)] + pub unsafe fn cellSizeForBounds(&self, rect: NSRect) -> NSSize; + + #[method_id(@__retain_semantics Other highlightColorWithFrame:inView:)] + pub unsafe fn highlightColorWithFrame_inView( + &self, + cellFrame: NSRect, + controlView: &NSView, + ) -> Option>; + + #[method(calcDrawInfo:)] + pub unsafe fn calcDrawInfo(&self, rect: NSRect); + + #[method_id(@__retain_semantics Other setUpFieldEditorAttributes:)] + pub unsafe fn setUpFieldEditorAttributes(&self, textObj: &NSText) -> Id; + + #[method(drawInteriorWithFrame:inView:)] + pub unsafe fn drawInteriorWithFrame_inView(&self, cellFrame: NSRect, controlView: &NSView); + + #[method(drawWithFrame:inView:)] + pub unsafe fn drawWithFrame_inView(&self, cellFrame: NSRect, controlView: &NSView); + + #[method(highlight:withFrame:inView:)] + pub unsafe fn highlight_withFrame_inView( + &self, + flag: bool, + cellFrame: NSRect, + controlView: &NSView, + ); + + #[method(mouseDownFlags)] + pub unsafe fn mouseDownFlags(&self) -> NSInteger; + + #[method(getPeriodicDelay:interval:)] + pub unsafe fn getPeriodicDelay_interval( + &self, + delay: NonNull, + interval: NonNull, + ); + + #[method(startTrackingAt:inView:)] + pub unsafe fn startTrackingAt_inView( + &self, + startPoint: NSPoint, + controlView: &NSView, + ) -> bool; + + #[method(continueTracking:at:inView:)] + pub unsafe fn continueTracking_at_inView( + &self, + lastPoint: NSPoint, + currentPoint: NSPoint, + controlView: &NSView, + ) -> bool; + + #[method(stopTracking:at:inView:mouseIsUp:)] + pub unsafe fn stopTracking_at_inView_mouseIsUp( + &self, + lastPoint: NSPoint, + stopPoint: NSPoint, + controlView: &NSView, + flag: bool, + ); + + #[method(trackMouse:inRect:ofView:untilMouseUp:)] + pub unsafe fn trackMouse_inRect_ofView_untilMouseUp( + &self, + event: &NSEvent, + cellFrame: NSRect, + controlView: &NSView, + flag: bool, + ) -> bool; + + #[method(editWithFrame:inView:editor:delegate:event:)] + pub unsafe fn editWithFrame_inView_editor_delegate_event( + &self, + rect: NSRect, + controlView: &NSView, + textObj: &NSText, + delegate: Option<&Object>, + event: Option<&NSEvent>, + ); + + #[method(selectWithFrame:inView:editor:delegate:start:length:)] + pub unsafe fn selectWithFrame_inView_editor_delegate_start_length( + &self, + rect: NSRect, + controlView: &NSView, + textObj: &NSText, + delegate: Option<&Object>, + selStart: NSInteger, + selLength: NSInteger, + ); + + #[method(endEditing:)] + pub unsafe fn endEditing(&self, textObj: &NSText); + + #[method(resetCursorRect:inView:)] + pub unsafe fn resetCursorRect_inView(&self, cellFrame: NSRect, controlView: &NSView); + + #[method_id(@__retain_semantics Other menu)] + pub unsafe fn menu(&self) -> Option>; + + #[method(setMenu:)] + pub unsafe fn setMenu(&self, menu: Option<&NSMenu>); + + #[method_id(@__retain_semantics Other menuForEvent:inRect:ofView:)] + pub unsafe fn menuForEvent_inRect_ofView( + &self, + event: &NSEvent, + cellFrame: NSRect, + view: &NSView, + ) -> Option>; + + #[method_id(@__retain_semantics Other defaultMenu)] + pub unsafe fn defaultMenu() -> Option>; + + #[method(sendsActionOnEndEditing)] + pub unsafe fn sendsActionOnEndEditing(&self) -> bool; + + #[method(setSendsActionOnEndEditing:)] + pub unsafe fn setSendsActionOnEndEditing(&self, sendsActionOnEndEditing: bool); + + #[method(baseWritingDirection)] + pub unsafe fn baseWritingDirection(&self) -> NSWritingDirection; + + #[method(setBaseWritingDirection:)] + pub unsafe fn setBaseWritingDirection(&self, baseWritingDirection: NSWritingDirection); + + #[method(lineBreakMode)] + pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode; + + #[method(setLineBreakMode:)] + pub unsafe fn setLineBreakMode(&self, lineBreakMode: NSLineBreakMode); + + #[method(allowsUndo)] + pub unsafe fn allowsUndo(&self) -> bool; + + #[method(setAllowsUndo:)] + pub unsafe fn setAllowsUndo(&self, allowsUndo: bool); + + #[method(truncatesLastVisibleLine)] + pub unsafe fn truncatesLastVisibleLine(&self) -> bool; + + #[method(setTruncatesLastVisibleLine:)] + pub unsafe fn setTruncatesLastVisibleLine(&self, truncatesLastVisibleLine: bool); + + #[method(userInterfaceLayoutDirection)] + pub unsafe fn userInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection; + + #[method(setUserInterfaceLayoutDirection:)] + pub unsafe fn setUserInterfaceLayoutDirection( + &self, + userInterfaceLayoutDirection: NSUserInterfaceLayoutDirection, + ); + + #[method_id(@__retain_semantics Other fieldEditorForView:)] + pub unsafe fn fieldEditorForView( + &self, + controlView: &NSView, + ) -> Option>; + + #[method(usesSingleLineMode)] + pub unsafe fn usesSingleLineMode(&self) -> bool; + + #[method(setUsesSingleLineMode:)] + pub unsafe fn setUsesSingleLineMode(&self, usesSingleLineMode: bool); + + #[method_id(@__retain_semantics Other draggingImageComponentsWithFrame:inView:)] + pub unsafe fn draggingImageComponentsWithFrame_inView( + &self, + frame: NSRect, + view: &NSView, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSKeyboardUI + unsafe impl NSCell { + #[method(refusesFirstResponder)] + pub unsafe fn refusesFirstResponder(&self) -> bool; + + #[method(setRefusesFirstResponder:)] + pub unsafe fn setRefusesFirstResponder(&self, refusesFirstResponder: bool); + + #[method(acceptsFirstResponder)] + pub unsafe fn acceptsFirstResponder(&self) -> bool; + + #[method(showsFirstResponder)] + pub unsafe fn showsFirstResponder(&self) -> bool; + + #[method(setShowsFirstResponder:)] + pub unsafe fn setShowsFirstResponder(&self, showsFirstResponder: bool); + + #[method(performClick:)] + pub unsafe fn performClick(&self, sender: Option<&Object>); + + #[method(focusRingType)] + pub unsafe fn focusRingType(&self) -> NSFocusRingType; + + #[method(setFocusRingType:)] + pub unsafe fn setFocusRingType(&self, focusRingType: NSFocusRingType); + + #[method(defaultFocusRingType)] + pub unsafe fn defaultFocusRingType() -> NSFocusRingType; + + #[method(drawFocusRingMaskWithFrame:inView:)] + pub unsafe fn drawFocusRingMaskWithFrame_inView( + &self, + cellFrame: NSRect, + controlView: &NSView, + ); + + #[method(focusRingMaskBoundsForFrame:inView:)] + pub unsafe fn focusRingMaskBoundsForFrame_inView( + &self, + cellFrame: NSRect, + controlView: &NSView, + ) -> NSRect; + + #[method(wantsNotificationForMarkedText)] + pub unsafe fn wantsNotificationForMarkedText(&self) -> bool; + } +); + +extern_methods!( + /// NSCellAttributedStringMethods + unsafe impl NSCell { + #[method_id(@__retain_semantics Other attributedStringValue)] + pub unsafe fn attributedStringValue(&self) -> Id; + + #[method(setAttributedStringValue:)] + pub unsafe fn setAttributedStringValue(&self, attributedStringValue: &NSAttributedString); + + #[method(allowsEditingTextAttributes)] + pub unsafe fn allowsEditingTextAttributes(&self) -> bool; + + #[method(setAllowsEditingTextAttributes:)] + pub unsafe fn setAllowsEditingTextAttributes(&self, allowsEditingTextAttributes: bool); + + #[method(importsGraphics)] + pub unsafe fn importsGraphics(&self) -> bool; + + #[method(setImportsGraphics:)] + pub unsafe fn setImportsGraphics(&self, importsGraphics: bool); + } +); + +extern_methods!( + /// NSCellMixedState + unsafe impl NSCell { + #[method(allowsMixedState)] + pub unsafe fn allowsMixedState(&self) -> bool; + + #[method(setAllowsMixedState:)] + pub unsafe fn setAllowsMixedState(&self, allowsMixedState: bool); + + #[method(nextState)] + pub unsafe fn nextState(&self) -> NSInteger; + + #[method(setNextState)] + pub unsafe fn setNextState(&self); + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSCellHitResult { + NSCellHitNone = 0, + NSCellHitContentArea = 1 << 0, + NSCellHitEditableTextArea = 1 << 1, + NSCellHitTrackableArea = 1 << 2, + } +); + +extern_methods!( + /// NSCellHitTest + unsafe impl NSCell { + #[method(hitTestForEvent:inRect:ofView:)] + pub unsafe fn hitTestForEvent_inRect_ofView( + &self, + event: &NSEvent, + cellFrame: NSRect, + controlView: &NSView, + ) -> NSCellHitResult; + } +); + +extern_methods!( + /// NSCellExpansion + unsafe impl NSCell { + #[method(expansionFrameWithFrame:inView:)] + pub unsafe fn expansionFrameWithFrame_inView( + &self, + cellFrame: NSRect, + view: &NSView, + ) -> NSRect; + + #[method(drawWithExpansionFrame:inView:)] + pub unsafe fn drawWithExpansionFrame_inView(&self, cellFrame: NSRect, view: &NSView); + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSBackgroundStyle { + NSBackgroundStyleNormal = 0, + NSBackgroundStyleEmphasized = 1, + NSBackgroundStyleRaised = 2, + NSBackgroundStyleLowered = 3, + } +); + +extern_methods!( + /// NSCellBackgroundStyle + unsafe impl NSCell { + #[method(backgroundStyle)] + pub unsafe fn backgroundStyle(&self) -> NSBackgroundStyle; + + #[method(setBackgroundStyle:)] + pub unsafe fn setBackgroundStyle(&self, backgroundStyle: NSBackgroundStyle); + + #[method(interiorBackgroundStyle)] + pub unsafe fn interiorBackgroundStyle(&self) -> NSBackgroundStyle; + } +); + +extern_fn!( + pub unsafe fn NSDrawThreePartImage( + frame: NSRect, + startCap: Option<&NSImage>, + centerFill: Option<&NSImage>, + endCap: Option<&NSImage>, + vertical: Bool, + op: NSCompositingOperation, + alphaFraction: CGFloat, + flipped: Bool, + ); +); + +extern_fn!( + pub unsafe fn NSDrawNinePartImage( + frame: NSRect, + topLeftCorner: Option<&NSImage>, + topEdgeFill: Option<&NSImage>, + topRightCorner: Option<&NSImage>, + leftEdgeFill: Option<&NSImage>, + centerFill: Option<&NSImage>, + rightEdgeFill: Option<&NSImage>, + bottomLeftCorner: Option<&NSImage>, + bottomEdgeFill: Option<&NSImage>, + bottomRightCorner: Option<&NSImage>, + op: NSCompositingOperation, + alphaFraction: CGFloat, + flipped: Bool, + ); +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSCell { + #[method(controlTint)] + pub unsafe fn controlTint(&self) -> NSControlTint; + + #[method(setControlTint:)] + pub unsafe fn setControlTint(&self, controlTint: NSControlTint); + + #[method(entryType)] + pub unsafe fn entryType(&self) -> NSInteger; + + #[method(setEntryType:)] + pub unsafe fn setEntryType(&self, type_: NSInteger); + + #[method(isEntryAcceptable:)] + pub unsafe fn isEntryAcceptable(&self, string: &NSString) -> bool; + + #[method(setFloatingPointFormat:left:right:)] + pub unsafe fn setFloatingPointFormat_left_right( + &self, + autoRange: bool, + leftDigits: NSUInteger, + rightDigits: NSUInteger, + ); + + #[method(setMnemonicLocation:)] + pub unsafe fn setMnemonicLocation(&self, location: NSUInteger); + + #[method(mnemonicLocation)] + pub unsafe fn mnemonicLocation(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other mnemonic)] + pub unsafe fn mnemonic(&self) -> Id; + + #[method(setTitleWithMnemonic:)] + pub unsafe fn setTitleWithMnemonic(&self, stringWithAmpersand: &NSString); + } +); + +extern_static!(NSBackgroundStyleLight: NSBackgroundStyle = NSBackgroundStyleNormal); + +extern_static!(NSBackgroundStyleDark: NSBackgroundStyle = NSBackgroundStyleEmphasized); + +pub type NSCellStateValue = NSControlStateValue; + +extern_static!(NSMixedState: NSControlStateValue = NSControlStateValueMixed); + +extern_static!(NSOffState: NSControlStateValue = NSControlStateValueOff); + +extern_static!(NSOnState: NSControlStateValue = NSControlStateValueOn); + +extern_static!(NSRegularControlSize: NSControlSize = NSControlSizeRegular); + +extern_static!(NSSmallControlSize: NSControlSize = NSControlSizeSmall); + +extern_static!(NSMiniControlSize: NSControlSize = NSControlSizeMini); + +extern_static!(NSControlTintDidChangeNotification: &'static NSNotificationName); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSAnyType = 0, + NSIntType = 1, + NSPositiveIntType = 2, + NSFloatType = 3, + NSPositiveFloatType = 4, + NSDoubleType = 6, + NSPositiveDoubleType = 7, + } +); diff --git a/crates/icrate/src/generated/AppKit/NSClickGestureRecognizer.rs b/crates/icrate/src/generated/AppKit/NSClickGestureRecognizer.rs new file mode 100644 index 000000000..196a1ebac --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSClickGestureRecognizer.rs @@ -0,0 +1,37 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSClickGestureRecognizer; + + unsafe impl ClassType for NSClickGestureRecognizer { + type Super = NSGestureRecognizer; + } +); + +extern_methods!( + unsafe impl NSClickGestureRecognizer { + #[method(buttonMask)] + pub unsafe fn buttonMask(&self) -> NSUInteger; + + #[method(setButtonMask:)] + pub unsafe fn setButtonMask(&self, buttonMask: NSUInteger); + + #[method(numberOfClicksRequired)] + pub unsafe fn numberOfClicksRequired(&self) -> NSInteger; + + #[method(setNumberOfClicksRequired:)] + pub unsafe fn setNumberOfClicksRequired(&self, numberOfClicksRequired: NSInteger); + + #[method(numberOfTouchesRequired)] + pub unsafe fn numberOfTouchesRequired(&self) -> NSInteger; + + #[method(setNumberOfTouchesRequired:)] + pub unsafe fn setNumberOfTouchesRequired(&self, numberOfTouchesRequired: NSInteger); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSClipView.rs b/crates/icrate/src/generated/AppKit/NSClipView.rs new file mode 100644 index 000000000..aaf482462 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSClipView.rs @@ -0,0 +1,103 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSClipView; + + unsafe impl ClassType for NSClipView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSClipView { + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Id; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: &NSColor); + + #[method(drawsBackground)] + pub unsafe fn drawsBackground(&self) -> bool; + + #[method(setDrawsBackground:)] + pub unsafe fn setDrawsBackground(&self, drawsBackground: bool); + + #[method_id(@__retain_semantics Other documentView)] + pub unsafe fn documentView(&self) -> Option>; + + #[method(setDocumentView:)] + pub unsafe fn setDocumentView(&self, documentView: Option<&NSView>); + + #[method(documentRect)] + pub unsafe fn documentRect(&self) -> NSRect; + + #[method_id(@__retain_semantics Other documentCursor)] + pub unsafe fn documentCursor(&self) -> Option>; + + #[method(setDocumentCursor:)] + pub unsafe fn setDocumentCursor(&self, documentCursor: Option<&NSCursor>); + + #[method(documentVisibleRect)] + pub unsafe fn documentVisibleRect(&self) -> NSRect; + + #[method(viewFrameChanged:)] + pub unsafe fn viewFrameChanged(&self, notification: &NSNotification); + + #[method(viewBoundsChanged:)] + pub unsafe fn viewBoundsChanged(&self, notification: &NSNotification); + + #[method(autoscroll:)] + pub unsafe fn autoscroll(&self, event: &NSEvent) -> bool; + + #[method(scrollToPoint:)] + pub unsafe fn scrollToPoint(&self, newOrigin: NSPoint); + + #[method(constrainBoundsRect:)] + pub unsafe fn constrainBoundsRect(&self, proposedBounds: NSRect) -> NSRect; + + #[method(contentInsets)] + pub unsafe fn contentInsets(&self) -> NSEdgeInsets; + + #[method(setContentInsets:)] + pub unsafe fn setContentInsets(&self, contentInsets: NSEdgeInsets); + + #[method(automaticallyAdjustsContentInsets)] + pub unsafe fn automaticallyAdjustsContentInsets(&self) -> bool; + + #[method(setAutomaticallyAdjustsContentInsets:)] + pub unsafe fn setAutomaticallyAdjustsContentInsets( + &self, + automaticallyAdjustsContentInsets: bool, + ); + } +); + +extern_methods!( + /// NSClipViewSuperview + unsafe impl NSView { + #[method(reflectScrolledClipView:)] + pub unsafe fn reflectScrolledClipView(&self, clipView: &NSClipView); + + #[method(scrollClipView:toPoint:)] + pub unsafe fn scrollClipView_toPoint(&self, clipView: &NSClipView, point: NSPoint); + } +); + +extern_methods!( + unsafe impl NSClipView { + #[method(constrainScrollPoint:)] + pub unsafe fn constrainScrollPoint(&self, newOrigin: NSPoint) -> NSPoint; + + #[method(copiesOnScroll)] + pub unsafe fn copiesOnScroll(&self) -> bool; + + #[method(setCopiesOnScroll:)] + pub unsafe fn setCopiesOnScroll(&self, copiesOnScroll: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSCollectionView.rs b/crates/icrate/src/generated/AppKit/NSCollectionView.rs new file mode 100644 index 000000000..816e42117 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCollectionView.rs @@ -0,0 +1,861 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSCollectionViewDropOperation { + NSCollectionViewDropOn = 0, + NSCollectionViewDropBefore = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSCollectionViewItemHighlightState { + NSCollectionViewItemHighlightNone = 0, + NSCollectionViewItemHighlightForSelection = 1, + NSCollectionViewItemHighlightForDeselection = 2, + NSCollectionViewItemHighlightAsDropTarget = 3, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSCollectionViewScrollPosition { + NSCollectionViewScrollPositionNone = 0, + NSCollectionViewScrollPositionTop = 1 << 0, + NSCollectionViewScrollPositionCenteredVertically = 1 << 1, + NSCollectionViewScrollPositionBottom = 1 << 2, + NSCollectionViewScrollPositionNearestHorizontalEdge = 1 << 9, + NSCollectionViewScrollPositionLeft = 1 << 3, + NSCollectionViewScrollPositionCenteredHorizontally = 1 << 4, + NSCollectionViewScrollPositionRight = 1 << 5, + NSCollectionViewScrollPositionLeadingEdge = 1 << 6, + NSCollectionViewScrollPositionTrailingEdge = 1 << 7, + NSCollectionViewScrollPositionNearestVerticalEdge = 1 << 8, + } +); + +pub type NSCollectionViewSupplementaryElementKind = NSString; + +extern_protocol!( + pub struct NSCollectionViewElement; + + unsafe impl NSCollectionViewElement { + #[optional] + #[method(prepareForReuse)] + pub unsafe fn prepareForReuse(&self); + + #[optional] + #[method(applyLayoutAttributes:)] + pub unsafe fn applyLayoutAttributes( + &self, + layoutAttributes: &NSCollectionViewLayoutAttributes, + ); + + #[optional] + #[method(willTransitionFromLayout:toLayout:)] + pub unsafe fn willTransitionFromLayout_toLayout( + &self, + oldLayout: &NSCollectionViewLayout, + newLayout: &NSCollectionViewLayout, + ); + + #[optional] + #[method(didTransitionFromLayout:toLayout:)] + pub unsafe fn didTransitionFromLayout_toLayout( + &self, + oldLayout: &NSCollectionViewLayout, + newLayout: &NSCollectionViewLayout, + ); + + #[optional] + #[method_id(@__retain_semantics Other preferredLayoutAttributesFittingAttributes:)] + pub unsafe fn preferredLayoutAttributesFittingAttributes( + &self, + layoutAttributes: &NSCollectionViewLayoutAttributes, + ) -> Id; + } +); + +extern_protocol!( + pub struct NSCollectionViewSectionHeaderView; + + unsafe impl NSCollectionViewSectionHeaderView { + #[optional] + #[method_id(@__retain_semantics Other sectionCollapseButton)] + pub unsafe fn sectionCollapseButton(&self) -> Option>; + + #[optional] + #[method(setSectionCollapseButton:)] + pub unsafe fn setSectionCollapseButton(&self, sectionCollapseButton: Option<&NSButton>); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionViewItem; + + unsafe impl ClassType for NSCollectionViewItem { + type Super = NSViewController; + } +); + +extern_methods!( + unsafe impl NSCollectionViewItem { + #[method_id(@__retain_semantics Other collectionView)] + pub unsafe fn collectionView(&self) -> Option>; + + #[method(isSelected)] + pub unsafe fn isSelected(&self) -> bool; + + #[method(setSelected:)] + pub unsafe fn setSelected(&self, selected: bool); + + #[method(highlightState)] + pub unsafe fn highlightState(&self) -> NSCollectionViewItemHighlightState; + + #[method(setHighlightState:)] + pub unsafe fn setHighlightState(&self, highlightState: NSCollectionViewItemHighlightState); + + #[method_id(@__retain_semantics Other imageView)] + pub unsafe fn imageView(&self) -> Option>; + + #[method(setImageView:)] + pub unsafe fn setImageView(&self, imageView: Option<&NSImageView>); + + #[method_id(@__retain_semantics Other textField)] + pub unsafe fn textField(&self) -> Option>; + + #[method(setTextField:)] + pub unsafe fn setTextField(&self, textField: Option<&NSTextField>); + + #[method_id(@__retain_semantics Other draggingImageComponents)] + pub unsafe fn draggingImageComponents( + &self, + ) -> Id, Shared>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionView; + + unsafe impl ClassType for NSCollectionView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSCollectionView { + #[method_id(@__retain_semantics Other dataSource)] + pub unsafe fn dataSource(&self) -> Option>; + + #[method(setDataSource:)] + pub unsafe fn setDataSource(&self, dataSource: Option<&NSCollectionViewDataSource>); + + #[method_id(@__retain_semantics Other prefetchDataSource)] + pub unsafe fn prefetchDataSource(&self) -> Option>; + + #[method(setPrefetchDataSource:)] + pub unsafe fn setPrefetchDataSource( + &self, + prefetchDataSource: Option<&NSCollectionViewPrefetching>, + ); + + #[method_id(@__retain_semantics Other content)] + pub unsafe fn content(&self) -> Id, Shared>; + + #[method(setContent:)] + pub unsafe fn setContent(&self, content: &NSArray); + + #[method(reloadData)] + pub unsafe fn reloadData(&self); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSCollectionViewDelegate>); + + #[method_id(@__retain_semantics Other backgroundView)] + pub unsafe fn backgroundView(&self) -> Option>; + + #[method(setBackgroundView:)] + pub unsafe fn setBackgroundView(&self, backgroundView: Option<&NSView>); + + #[method(backgroundViewScrollsWithContent)] + pub unsafe fn backgroundViewScrollsWithContent(&self) -> bool; + + #[method(setBackgroundViewScrollsWithContent:)] + pub unsafe fn setBackgroundViewScrollsWithContent( + &self, + backgroundViewScrollsWithContent: bool, + ); + + #[method_id(@__retain_semantics Other collectionViewLayout)] + pub unsafe fn collectionViewLayout(&self) -> Option>; + + #[method(setCollectionViewLayout:)] + pub unsafe fn setCollectionViewLayout( + &self, + collectionViewLayout: Option<&NSCollectionViewLayout>, + ); + + #[method_id(@__retain_semantics Other layoutAttributesForItemAtIndexPath:)] + pub unsafe fn layoutAttributesForItemAtIndexPath( + &self, + indexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other layoutAttributesForSupplementaryElementOfKind:atIndexPath:)] + pub unsafe fn layoutAttributesForSupplementaryElementOfKind_atIndexPath( + &self, + kind: &NSCollectionViewSupplementaryElementKind, + indexPath: &NSIndexPath, + ) -> Option>; + + #[method(frameForItemAtIndex:)] + pub unsafe fn frameForItemAtIndex(&self, index: NSUInteger) -> NSRect; + + #[method(frameForItemAtIndex:withNumberOfItems:)] + pub unsafe fn frameForItemAtIndex_withNumberOfItems( + &self, + index: NSUInteger, + numberOfItems: NSUInteger, + ) -> NSRect; + + #[method_id(@__retain_semantics Other backgroundColors)] + pub unsafe fn backgroundColors(&self) -> Id, Shared>; + + #[method(setBackgroundColors:)] + pub unsafe fn setBackgroundColors(&self, backgroundColors: Option<&NSArray>); + + #[method(numberOfSections)] + pub unsafe fn numberOfSections(&self) -> NSInteger; + + #[method(numberOfItemsInSection:)] + pub unsafe fn numberOfItemsInSection(&self, section: NSInteger) -> NSInteger; + + #[method(isFirstResponder)] + pub unsafe fn isFirstResponder(&self) -> bool; + + #[method(isSelectable)] + pub unsafe fn isSelectable(&self) -> bool; + + #[method(setSelectable:)] + pub unsafe fn setSelectable(&self, selectable: bool); + + #[method(allowsEmptySelection)] + pub unsafe fn allowsEmptySelection(&self) -> bool; + + #[method(setAllowsEmptySelection:)] + pub unsafe fn setAllowsEmptySelection(&self, allowsEmptySelection: bool); + + #[method(allowsMultipleSelection)] + pub unsafe fn allowsMultipleSelection(&self) -> bool; + + #[method(setAllowsMultipleSelection:)] + pub unsafe fn setAllowsMultipleSelection(&self, allowsMultipleSelection: bool); + + #[method_id(@__retain_semantics Other selectionIndexes)] + pub unsafe fn selectionIndexes(&self) -> Id; + + #[method(setSelectionIndexes:)] + pub unsafe fn setSelectionIndexes(&self, selectionIndexes: &NSIndexSet); + + #[method_id(@__retain_semantics Other selectionIndexPaths)] + pub unsafe fn selectionIndexPaths(&self) -> Id, Shared>; + + #[method(setSelectionIndexPaths:)] + pub unsafe fn setSelectionIndexPaths(&self, selectionIndexPaths: &NSSet); + + #[method(selectItemsAtIndexPaths:scrollPosition:)] + pub unsafe fn selectItemsAtIndexPaths_scrollPosition( + &self, + indexPaths: &NSSet, + scrollPosition: NSCollectionViewScrollPosition, + ); + + #[method(deselectItemsAtIndexPaths:)] + pub unsafe fn deselectItemsAtIndexPaths(&self, indexPaths: &NSSet); + + #[method(selectAll:)] + pub unsafe fn selectAll(&self, sender: Option<&Object>); + + #[method(deselectAll:)] + pub unsafe fn deselectAll(&self, sender: Option<&Object>); + + #[method(registerClass:forItemWithIdentifier:)] + pub unsafe fn registerClass_forItemWithIdentifier( + &self, + itemClass: Option<&Class>, + identifier: &NSUserInterfaceItemIdentifier, + ); + + #[method(registerNib:forItemWithIdentifier:)] + pub unsafe fn registerNib_forItemWithIdentifier( + &self, + nib: Option<&NSNib>, + identifier: &NSUserInterfaceItemIdentifier, + ); + + #[method(registerClass:forSupplementaryViewOfKind:withIdentifier:)] + pub unsafe fn registerClass_forSupplementaryViewOfKind_withIdentifier( + &self, + viewClass: Option<&Class>, + kind: &NSCollectionViewSupplementaryElementKind, + identifier: &NSUserInterfaceItemIdentifier, + ); + + #[method(registerNib:forSupplementaryViewOfKind:withIdentifier:)] + pub unsafe fn registerNib_forSupplementaryViewOfKind_withIdentifier( + &self, + nib: Option<&NSNib>, + kind: &NSCollectionViewSupplementaryElementKind, + identifier: &NSUserInterfaceItemIdentifier, + ); + + #[method_id(@__retain_semantics Other makeItemWithIdentifier:forIndexPath:)] + pub unsafe fn makeItemWithIdentifier_forIndexPath( + &self, + identifier: &NSUserInterfaceItemIdentifier, + indexPath: &NSIndexPath, + ) -> Id; + + #[method_id(@__retain_semantics Other makeSupplementaryViewOfKind:withIdentifier:forIndexPath:)] + pub unsafe fn makeSupplementaryViewOfKind_withIdentifier_forIndexPath( + &self, + elementKind: &NSCollectionViewSupplementaryElementKind, + identifier: &NSUserInterfaceItemIdentifier, + indexPath: &NSIndexPath, + ) -> Id; + + #[method_id(@__retain_semantics Other itemAtIndex:)] + pub unsafe fn itemAtIndex( + &self, + index: NSUInteger, + ) -> Option>; + + #[method_id(@__retain_semantics Other itemAtIndexPath:)] + pub unsafe fn itemAtIndexPath( + &self, + indexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other visibleItems)] + pub unsafe fn visibleItems(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other indexPathsForVisibleItems)] + pub unsafe fn indexPathsForVisibleItems(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other indexPathForItem:)] + pub unsafe fn indexPathForItem( + &self, + item: &NSCollectionViewItem, + ) -> Option>; + + #[method_id(@__retain_semantics Other indexPathForItemAtPoint:)] + pub unsafe fn indexPathForItemAtPoint( + &self, + point: NSPoint, + ) -> Option>; + + #[method_id(@__retain_semantics Other supplementaryViewForElementKind:atIndexPath:)] + pub unsafe fn supplementaryViewForElementKind_atIndexPath( + &self, + elementKind: &NSCollectionViewSupplementaryElementKind, + indexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other visibleSupplementaryViewsOfKind:)] + pub unsafe fn visibleSupplementaryViewsOfKind( + &self, + elementKind: &NSCollectionViewSupplementaryElementKind, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other indexPathsForVisibleSupplementaryElementsOfKind:)] + pub unsafe fn indexPathsForVisibleSupplementaryElementsOfKind( + &self, + elementKind: &NSCollectionViewSupplementaryElementKind, + ) -> Id, Shared>; + + #[method(insertSections:)] + pub unsafe fn insertSections(&self, sections: &NSIndexSet); + + #[method(deleteSections:)] + pub unsafe fn deleteSections(&self, sections: &NSIndexSet); + + #[method(reloadSections:)] + pub unsafe fn reloadSections(&self, sections: &NSIndexSet); + + #[method(moveSection:toSection:)] + pub unsafe fn moveSection_toSection(&self, section: NSInteger, newSection: NSInteger); + + #[method(insertItemsAtIndexPaths:)] + pub unsafe fn insertItemsAtIndexPaths(&self, indexPaths: &NSSet); + + #[method(deleteItemsAtIndexPaths:)] + pub unsafe fn deleteItemsAtIndexPaths(&self, indexPaths: &NSSet); + + #[method(reloadItemsAtIndexPaths:)] + pub unsafe fn reloadItemsAtIndexPaths(&self, indexPaths: &NSSet); + + #[method(moveItemAtIndexPath:toIndexPath:)] + pub unsafe fn moveItemAtIndexPath_toIndexPath( + &self, + indexPath: &NSIndexPath, + newIndexPath: &NSIndexPath, + ); + + #[method(performBatchUpdates:completionHandler:)] + pub unsafe fn performBatchUpdates_completionHandler( + &self, + updates: Option<&Block<(), ()>>, + completionHandler: Option<&Block<(Bool,), ()>>, + ); + + #[method(toggleSectionCollapse:)] + pub unsafe fn toggleSectionCollapse(&self, sender: &Object); + + #[method(scrollToItemsAtIndexPaths:scrollPosition:)] + pub unsafe fn scrollToItemsAtIndexPaths_scrollPosition( + &self, + indexPaths: &NSSet, + scrollPosition: NSCollectionViewScrollPosition, + ); + + #[method(setDraggingSourceOperationMask:forLocal:)] + pub unsafe fn setDraggingSourceOperationMask_forLocal( + &self, + dragOperationMask: NSDragOperation, + localDestination: bool, + ); + + #[method_id(@__retain_semantics Other draggingImageForItemsAtIndexPaths:withEvent:offset:)] + pub unsafe fn draggingImageForItemsAtIndexPaths_withEvent_offset( + &self, + indexPaths: &NSSet, + event: &NSEvent, + dragImageOffset: NSPointPointer, + ) -> Id; + + #[method_id(@__retain_semantics Other draggingImageForItemsAtIndexes:withEvent:offset:)] + pub unsafe fn draggingImageForItemsAtIndexes_withEvent_offset( + &self, + indexes: &NSIndexSet, + event: &NSEvent, + dragImageOffset: NSPointPointer, + ) -> Id; + } +); + +extern_protocol!( + pub struct NSCollectionViewDataSource; + + unsafe impl NSCollectionViewDataSource { + #[method(collectionView:numberOfItemsInSection:)] + pub unsafe fn collectionView_numberOfItemsInSection( + &self, + collectionView: &NSCollectionView, + section: NSInteger, + ) -> NSInteger; + + #[method_id(@__retain_semantics Other collectionView:itemForRepresentedObjectAtIndexPath:)] + pub unsafe fn collectionView_itemForRepresentedObjectAtIndexPath( + &self, + collectionView: &NSCollectionView, + indexPath: &NSIndexPath, + ) -> Id; + + #[optional] + #[method(numberOfSectionsInCollectionView:)] + pub unsafe fn numberOfSectionsInCollectionView( + &self, + collectionView: &NSCollectionView, + ) -> NSInteger; + + #[optional] + #[method_id(@__retain_semantics Other collectionView:viewForSupplementaryElementOfKind:atIndexPath:)] + pub unsafe fn collectionView_viewForSupplementaryElementOfKind_atIndexPath( + &self, + collectionView: &NSCollectionView, + kind: &NSCollectionViewSupplementaryElementKind, + indexPath: &NSIndexPath, + ) -> Id; + } +); + +extern_protocol!( + pub struct NSCollectionViewPrefetching; + + unsafe impl NSCollectionViewPrefetching { + #[method(collectionView:prefetchItemsAtIndexPaths:)] + pub unsafe fn collectionView_prefetchItemsAtIndexPaths( + &self, + collectionView: &NSCollectionView, + indexPaths: &NSArray, + ); + + #[optional] + #[method(collectionView:cancelPrefetchingForItemsAtIndexPaths:)] + pub unsafe fn collectionView_cancelPrefetchingForItemsAtIndexPaths( + &self, + collectionView: &NSCollectionView, + indexPaths: &NSArray, + ); + } +); + +extern_protocol!( + pub struct NSCollectionViewDelegate; + + unsafe impl NSCollectionViewDelegate { + #[optional] + #[method(collectionView:canDragItemsAtIndexPaths:withEvent:)] + pub unsafe fn collectionView_canDragItemsAtIndexPaths_withEvent( + &self, + collectionView: &NSCollectionView, + indexPaths: &NSSet, + event: &NSEvent, + ) -> bool; + + #[optional] + #[method(collectionView:canDragItemsAtIndexes:withEvent:)] + pub unsafe fn collectionView_canDragItemsAtIndexes_withEvent( + &self, + collectionView: &NSCollectionView, + indexes: &NSIndexSet, + event: &NSEvent, + ) -> bool; + + #[optional] + #[method(collectionView:writeItemsAtIndexPaths:toPasteboard:)] + pub unsafe fn collectionView_writeItemsAtIndexPaths_toPasteboard( + &self, + collectionView: &NSCollectionView, + indexPaths: &NSSet, + pasteboard: &NSPasteboard, + ) -> bool; + + #[optional] + #[method(collectionView:writeItemsAtIndexes:toPasteboard:)] + pub unsafe fn collectionView_writeItemsAtIndexes_toPasteboard( + &self, + collectionView: &NSCollectionView, + indexes: &NSIndexSet, + pasteboard: &NSPasteboard, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other collectionView:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAtIndexPaths:)] + pub unsafe fn collectionView_namesOfPromisedFilesDroppedAtDestination_forDraggedItemsAtIndexPaths( + &self, + collectionView: &NSCollectionView, + dropURL: &NSURL, + indexPaths: &NSSet, + ) -> Id, Shared>; + + #[optional] + #[method_id(@__retain_semantics Other collectionView:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAtIndexes:)] + pub unsafe fn collectionView_namesOfPromisedFilesDroppedAtDestination_forDraggedItemsAtIndexes( + &self, + collectionView: &NSCollectionView, + dropURL: &NSURL, + indexes: &NSIndexSet, + ) -> Id, Shared>; + + #[optional] + #[method_id(@__retain_semantics Other collectionView:draggingImageForItemsAtIndexPaths:withEvent:offset:)] + pub unsafe fn collectionView_draggingImageForItemsAtIndexPaths_withEvent_offset( + &self, + collectionView: &NSCollectionView, + indexPaths: &NSSet, + event: &NSEvent, + dragImageOffset: NSPointPointer, + ) -> Id; + + #[optional] + #[method_id(@__retain_semantics Other collectionView:draggingImageForItemsAtIndexes:withEvent:offset:)] + pub unsafe fn collectionView_draggingImageForItemsAtIndexes_withEvent_offset( + &self, + collectionView: &NSCollectionView, + indexes: &NSIndexSet, + event: &NSEvent, + dragImageOffset: NSPointPointer, + ) -> Id; + + #[optional] + #[method(collectionView:validateDrop:proposedIndexPath:dropOperation:)] + pub unsafe fn collectionView_validateDrop_proposedIndexPath_dropOperation( + &self, + collectionView: &NSCollectionView, + draggingInfo: &NSDraggingInfo, + proposedDropIndexPath: NonNull>, + proposedDropOperation: NonNull, + ) -> NSDragOperation; + + #[optional] + #[method(collectionView:validateDrop:proposedIndex:dropOperation:)] + pub unsafe fn collectionView_validateDrop_proposedIndex_dropOperation( + &self, + collectionView: &NSCollectionView, + draggingInfo: &NSDraggingInfo, + proposedDropIndex: NonNull, + proposedDropOperation: NonNull, + ) -> NSDragOperation; + + #[optional] + #[method(collectionView:acceptDrop:indexPath:dropOperation:)] + pub unsafe fn collectionView_acceptDrop_indexPath_dropOperation( + &self, + collectionView: &NSCollectionView, + draggingInfo: &NSDraggingInfo, + indexPath: &NSIndexPath, + dropOperation: NSCollectionViewDropOperation, + ) -> bool; + + #[optional] + #[method(collectionView:acceptDrop:index:dropOperation:)] + pub unsafe fn collectionView_acceptDrop_index_dropOperation( + &self, + collectionView: &NSCollectionView, + draggingInfo: &NSDraggingInfo, + index: NSInteger, + dropOperation: NSCollectionViewDropOperation, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other collectionView:pasteboardWriterForItemAtIndexPath:)] + pub unsafe fn collectionView_pasteboardWriterForItemAtIndexPath( + &self, + collectionView: &NSCollectionView, + indexPath: &NSIndexPath, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other collectionView:pasteboardWriterForItemAtIndex:)] + pub unsafe fn collectionView_pasteboardWriterForItemAtIndex( + &self, + collectionView: &NSCollectionView, + index: NSUInteger, + ) -> Option>; + + #[optional] + #[method(collectionView:draggingSession:willBeginAtPoint:forItemsAtIndexPaths:)] + pub unsafe fn collectionView_draggingSession_willBeginAtPoint_forItemsAtIndexPaths( + &self, + collectionView: &NSCollectionView, + session: &NSDraggingSession, + screenPoint: NSPoint, + indexPaths: &NSSet, + ); + + #[optional] + #[method(collectionView:draggingSession:willBeginAtPoint:forItemsAtIndexes:)] + pub unsafe fn collectionView_draggingSession_willBeginAtPoint_forItemsAtIndexes( + &self, + collectionView: &NSCollectionView, + session: &NSDraggingSession, + screenPoint: NSPoint, + indexes: &NSIndexSet, + ); + + #[optional] + #[method(collectionView:draggingSession:endedAtPoint:dragOperation:)] + pub unsafe fn collectionView_draggingSession_endedAtPoint_dragOperation( + &self, + collectionView: &NSCollectionView, + session: &NSDraggingSession, + screenPoint: NSPoint, + operation: NSDragOperation, + ); + + #[optional] + #[method(collectionView:updateDraggingItemsForDrag:)] + pub unsafe fn collectionView_updateDraggingItemsForDrag( + &self, + collectionView: &NSCollectionView, + draggingInfo: &NSDraggingInfo, + ); + + #[optional] + #[method_id(@__retain_semantics Other collectionView:shouldChangeItemsAtIndexPaths:toHighlightState:)] + pub unsafe fn collectionView_shouldChangeItemsAtIndexPaths_toHighlightState( + &self, + collectionView: &NSCollectionView, + indexPaths: &NSSet, + highlightState: NSCollectionViewItemHighlightState, + ) -> Id, Shared>; + + #[optional] + #[method(collectionView:didChangeItemsAtIndexPaths:toHighlightState:)] + pub unsafe fn collectionView_didChangeItemsAtIndexPaths_toHighlightState( + &self, + collectionView: &NSCollectionView, + indexPaths: &NSSet, + highlightState: NSCollectionViewItemHighlightState, + ); + + #[optional] + #[method_id(@__retain_semantics Other collectionView:shouldSelectItemsAtIndexPaths:)] + pub unsafe fn collectionView_shouldSelectItemsAtIndexPaths( + &self, + collectionView: &NSCollectionView, + indexPaths: &NSSet, + ) -> Id, Shared>; + + #[optional] + #[method_id(@__retain_semantics Other collectionView:shouldDeselectItemsAtIndexPaths:)] + pub unsafe fn collectionView_shouldDeselectItemsAtIndexPaths( + &self, + collectionView: &NSCollectionView, + indexPaths: &NSSet, + ) -> Id, Shared>; + + #[optional] + #[method(collectionView:didSelectItemsAtIndexPaths:)] + pub unsafe fn collectionView_didSelectItemsAtIndexPaths( + &self, + collectionView: &NSCollectionView, + indexPaths: &NSSet, + ); + + #[optional] + #[method(collectionView:didDeselectItemsAtIndexPaths:)] + pub unsafe fn collectionView_didDeselectItemsAtIndexPaths( + &self, + collectionView: &NSCollectionView, + indexPaths: &NSSet, + ); + + #[optional] + #[method(collectionView:willDisplayItem:forRepresentedObjectAtIndexPath:)] + pub unsafe fn collectionView_willDisplayItem_forRepresentedObjectAtIndexPath( + &self, + collectionView: &NSCollectionView, + item: &NSCollectionViewItem, + indexPath: &NSIndexPath, + ); + + #[optional] + #[method(collectionView:willDisplaySupplementaryView:forElementKind:atIndexPath:)] + pub unsafe fn collectionView_willDisplaySupplementaryView_forElementKind_atIndexPath( + &self, + collectionView: &NSCollectionView, + view: &NSView, + elementKind: &NSCollectionViewSupplementaryElementKind, + indexPath: &NSIndexPath, + ); + + #[optional] + #[method(collectionView:didEndDisplayingItem:forRepresentedObjectAtIndexPath:)] + pub unsafe fn collectionView_didEndDisplayingItem_forRepresentedObjectAtIndexPath( + &self, + collectionView: &NSCollectionView, + item: &NSCollectionViewItem, + indexPath: &NSIndexPath, + ); + + #[optional] + #[method(collectionView:didEndDisplayingSupplementaryView:forElementOfKind:atIndexPath:)] + pub unsafe fn collectionView_didEndDisplayingSupplementaryView_forElementOfKind_atIndexPath( + &self, + collectionView: &NSCollectionView, + view: &NSView, + elementKind: &NSCollectionViewSupplementaryElementKind, + indexPath: &NSIndexPath, + ); + + #[optional] + #[method_id(@__retain_semantics Other collectionView:transitionLayoutForOldLayout:newLayout:)] + pub unsafe fn collectionView_transitionLayoutForOldLayout_newLayout( + &self, + collectionView: &NSCollectionView, + fromLayout: &NSCollectionViewLayout, + toLayout: &NSCollectionViewLayout, + ) -> Id; + } +); + +extern_methods!( + /// NSCollectionViewAdditions + unsafe impl NSIndexPath { + #[method_id(@__retain_semantics Other indexPathForItem:inSection:)] + pub unsafe fn indexPathForItem_inSection( + item: NSInteger, + section: NSInteger, + ) -> Id; + + #[method(item)] + pub unsafe fn item(&self) -> NSInteger; + + #[method(section)] + pub unsafe fn section(&self) -> NSInteger; + } +); + +extern_methods!( + /// NSCollectionViewAdditions + unsafe impl NSSet { + #[method_id(@__retain_semantics Other setWithCollectionViewIndexPath:)] + pub unsafe fn setWithCollectionViewIndexPath(indexPath: &NSIndexPath) -> Id; + + #[method_id(@__retain_semantics Other setWithCollectionViewIndexPaths:)] + pub unsafe fn setWithCollectionViewIndexPaths( + indexPaths: &NSArray, + ) -> Id; + + #[method(enumerateIndexPathsWithOptions:usingBlock:)] + pub unsafe fn enumerateIndexPathsWithOptions_usingBlock( + &self, + opts: NSEnumerationOptions, + block: &Block<(NonNull, NonNull), ()>, + ); + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSCollectionView { + #[method_id(@__retain_semantics New newItemForRepresentedObject:)] + pub unsafe fn newItemForRepresentedObject( + &self, + object: &Object, + ) -> Id; + + #[method_id(@__retain_semantics Other itemPrototype)] + pub unsafe fn itemPrototype(&self) -> Option>; + + #[method(setItemPrototype:)] + pub unsafe fn setItemPrototype(&self, itemPrototype: Option<&NSCollectionViewItem>); + + #[method(maxNumberOfRows)] + pub unsafe fn maxNumberOfRows(&self) -> NSUInteger; + + #[method(setMaxNumberOfRows:)] + pub unsafe fn setMaxNumberOfRows(&self, maxNumberOfRows: NSUInteger); + + #[method(maxNumberOfColumns)] + pub unsafe fn maxNumberOfColumns(&self) -> NSUInteger; + + #[method(setMaxNumberOfColumns:)] + pub unsafe fn setMaxNumberOfColumns(&self, maxNumberOfColumns: NSUInteger); + + #[method(minItemSize)] + pub unsafe fn minItemSize(&self) -> NSSize; + + #[method(setMinItemSize:)] + pub unsafe fn setMinItemSize(&self, minItemSize: NSSize); + + #[method(maxItemSize)] + pub unsafe fn maxItemSize(&self) -> NSSize; + + #[method(setMaxItemSize:)] + pub unsafe fn setMaxItemSize(&self, maxItemSize: NSSize); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSCollectionViewCompositionalLayout.rs b/crates/icrate/src/generated/AppKit/NSCollectionViewCompositionalLayout.rs new file mode 100644 index 000000000..da78e2795 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCollectionViewCompositionalLayout.rs @@ -0,0 +1,830 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSDirectionalRectEdge { + NSDirectionalRectEdgeNone = 0, + NSDirectionalRectEdgeTop = 1 << 0, + NSDirectionalRectEdgeLeading = 1 << 1, + NSDirectionalRectEdgeBottom = 1 << 2, + NSDirectionalRectEdgeTrailing = 1 << 3, + NSDirectionalRectEdgeAll = NSDirectionalRectEdgeTop + | NSDirectionalRectEdgeLeading + | NSDirectionalRectEdgeBottom + | NSDirectionalRectEdgeTrailing, + } +); + +extern_struct!( + pub struct NSDirectionalEdgeInsets { + pub top: CGFloat, + pub leading: CGFloat, + pub bottom: CGFloat, + pub trailing: CGFloat, + } +); + +extern_static!(NSDirectionalEdgeInsetsZero: NSDirectionalEdgeInsets); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSRectAlignment { + NSRectAlignmentNone = 0, + NSRectAlignmentTop = 1, + NSRectAlignmentTopLeading = 2, + NSRectAlignmentLeading = 3, + NSRectAlignmentBottomLeading = 4, + NSRectAlignmentBottom = 5, + NSRectAlignmentBottomTrailing = 6, + NSRectAlignmentTrailing = 7, + NSRectAlignmentTopTrailing = 8, + } +); + +inline_fn!( + pub unsafe fn NSDirectionalEdgeInsetsMake( + top: CGFloat, + leading: CGFloat, + bottom: CGFloat, + trailing: CGFloat, + ) -> NSDirectionalEdgeInsets { + todo!() + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionViewCompositionalLayoutConfiguration; + + unsafe impl ClassType for NSCollectionViewCompositionalLayoutConfiguration { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionViewCompositionalLayoutConfiguration { + #[method(scrollDirection)] + pub unsafe fn scrollDirection(&self) -> NSCollectionViewScrollDirection; + + #[method(setScrollDirection:)] + pub unsafe fn setScrollDirection(&self, scrollDirection: NSCollectionViewScrollDirection); + + #[method(interSectionSpacing)] + pub unsafe fn interSectionSpacing(&self) -> CGFloat; + + #[method(setInterSectionSpacing:)] + pub unsafe fn setInterSectionSpacing(&self, interSectionSpacing: CGFloat); + + #[method_id(@__retain_semantics Other boundarySupplementaryItems)] + pub unsafe fn boundarySupplementaryItems( + &self, + ) -> Id, Shared>; + + #[method(setBoundarySupplementaryItems:)] + pub unsafe fn setBoundarySupplementaryItems( + &self, + boundarySupplementaryItems: &NSArray, + ); + } +); + +pub type NSCollectionViewCompositionalLayoutSectionProvider = + *mut Block<(NSInteger, NonNull), *mut NSCollectionLayoutSection>; + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionViewCompositionalLayout; + + unsafe impl ClassType for NSCollectionViewCompositionalLayout { + type Super = NSCollectionViewLayout; + } +); + +extern_methods!( + unsafe impl NSCollectionViewCompositionalLayout { + #[method_id(@__retain_semantics Init initWithSection:)] + pub unsafe fn initWithSection( + this: Option>, + section: &NSCollectionLayoutSection, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithSection:configuration:)] + pub unsafe fn initWithSection_configuration( + this: Option>, + section: &NSCollectionLayoutSection, + configuration: &NSCollectionViewCompositionalLayoutConfiguration, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithSectionProvider:)] + pub unsafe fn initWithSectionProvider( + this: Option>, + sectionProvider: NSCollectionViewCompositionalLayoutSectionProvider, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithSectionProvider:configuration:)] + pub unsafe fn initWithSectionProvider_configuration( + this: Option>, + sectionProvider: NSCollectionViewCompositionalLayoutSectionProvider, + configuration: &NSCollectionViewCompositionalLayoutConfiguration, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Other configuration)] + pub unsafe fn configuration( + &self, + ) -> Id; + + #[method(setConfiguration:)] + pub unsafe fn setConfiguration( + &self, + configuration: &NSCollectionViewCompositionalLayoutConfiguration, + ); + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSCollectionLayoutSectionOrthogonalScrollingBehavior { + NSCollectionLayoutSectionOrthogonalScrollingBehaviorNone = 0, + NSCollectionLayoutSectionOrthogonalScrollingBehaviorContinuous = 1, + NSCollectionLayoutSectionOrthogonalScrollingBehaviorContinuousGroupLeadingBoundary = 2, + NSCollectionLayoutSectionOrthogonalScrollingBehaviorPaging = 3, + NSCollectionLayoutSectionOrthogonalScrollingBehaviorGroupPaging = 4, + NSCollectionLayoutSectionOrthogonalScrollingBehaviorGroupPagingCentered = 5, + } +); + +pub type NSCollectionLayoutSectionVisibleItemsInvalidationHandler = *mut Block< + ( + NonNull>, + NSPoint, + NonNull, + ), + (), +>; + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionLayoutSection; + + unsafe impl ClassType for NSCollectionLayoutSection { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionLayoutSection { + #[method_id(@__retain_semantics Other sectionWithGroup:)] + pub unsafe fn sectionWithGroup(group: &NSCollectionLayoutGroup) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method(contentInsets)] + pub unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets; + + #[method(setContentInsets:)] + pub unsafe fn setContentInsets(&self, contentInsets: NSDirectionalEdgeInsets); + + #[method(interGroupSpacing)] + pub unsafe fn interGroupSpacing(&self) -> CGFloat; + + #[method(setInterGroupSpacing:)] + pub unsafe fn setInterGroupSpacing(&self, interGroupSpacing: CGFloat); + + #[method(orthogonalScrollingBehavior)] + pub unsafe fn orthogonalScrollingBehavior( + &self, + ) -> NSCollectionLayoutSectionOrthogonalScrollingBehavior; + + #[method(setOrthogonalScrollingBehavior:)] + pub unsafe fn setOrthogonalScrollingBehavior( + &self, + orthogonalScrollingBehavior: NSCollectionLayoutSectionOrthogonalScrollingBehavior, + ); + + #[method_id(@__retain_semantics Other boundarySupplementaryItems)] + pub unsafe fn boundarySupplementaryItems( + &self, + ) -> Id, Shared>; + + #[method(setBoundarySupplementaryItems:)] + pub unsafe fn setBoundarySupplementaryItems( + &self, + boundarySupplementaryItems: &NSArray, + ); + + #[method(supplementariesFollowContentInsets)] + pub unsafe fn supplementariesFollowContentInsets(&self) -> bool; + + #[method(setSupplementariesFollowContentInsets:)] + pub unsafe fn setSupplementariesFollowContentInsets( + &self, + supplementariesFollowContentInsets: bool, + ); + + #[method(visibleItemsInvalidationHandler)] + pub unsafe fn visibleItemsInvalidationHandler( + &self, + ) -> NSCollectionLayoutSectionVisibleItemsInvalidationHandler; + + #[method(setVisibleItemsInvalidationHandler:)] + pub unsafe fn setVisibleItemsInvalidationHandler( + &self, + visibleItemsInvalidationHandler: NSCollectionLayoutSectionVisibleItemsInvalidationHandler, + ); + + #[method_id(@__retain_semantics Other decorationItems)] + pub unsafe fn decorationItems( + &self, + ) -> Id, Shared>; + + #[method(setDecorationItems:)] + pub unsafe fn setDecorationItems( + &self, + decorationItems: &NSArray, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionLayoutItem; + + unsafe impl ClassType for NSCollectionLayoutItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionLayoutItem { + #[method_id(@__retain_semantics Other itemWithLayoutSize:)] + pub unsafe fn itemWithLayoutSize(layoutSize: &NSCollectionLayoutSize) -> Id; + + #[method_id(@__retain_semantics Other itemWithLayoutSize:supplementaryItems:)] + pub unsafe fn itemWithLayoutSize_supplementaryItems( + layoutSize: &NSCollectionLayoutSize, + supplementaryItems: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method(contentInsets)] + pub unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets; + + #[method(setContentInsets:)] + pub unsafe fn setContentInsets(&self, contentInsets: NSDirectionalEdgeInsets); + + #[method_id(@__retain_semantics Other edgeSpacing)] + pub unsafe fn edgeSpacing(&self) -> Option>; + + #[method(setEdgeSpacing:)] + pub unsafe fn setEdgeSpacing(&self, edgeSpacing: Option<&NSCollectionLayoutEdgeSpacing>); + + #[method_id(@__retain_semantics Other layoutSize)] + pub unsafe fn layoutSize(&self) -> Id; + + #[method_id(@__retain_semantics Other supplementaryItems)] + pub unsafe fn supplementaryItems( + &self, + ) -> Id, Shared>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionLayoutGroupCustomItem; + + unsafe impl ClassType for NSCollectionLayoutGroupCustomItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionLayoutGroupCustomItem { + #[method_id(@__retain_semantics Other customItemWithFrame:)] + pub unsafe fn customItemWithFrame(frame: NSRect) -> Id; + + #[method_id(@__retain_semantics Other customItemWithFrame:zIndex:)] + pub unsafe fn customItemWithFrame_zIndex( + frame: NSRect, + zIndex: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method(frame)] + pub unsafe fn frame(&self) -> NSRect; + + #[method(zIndex)] + pub unsafe fn zIndex(&self) -> NSInteger; + } +); + +pub type NSCollectionLayoutGroupCustomItemProvider = *mut Block< + (NonNull,), + NonNull>, +>; + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionLayoutGroup; + + unsafe impl ClassType for NSCollectionLayoutGroup { + type Super = NSCollectionLayoutItem; + } +); + +extern_methods!( + unsafe impl NSCollectionLayoutGroup { + #[method_id(@__retain_semantics Other horizontalGroupWithLayoutSize:subitem:count:)] + pub unsafe fn horizontalGroupWithLayoutSize_subitem_count( + layoutSize: &NSCollectionLayoutSize, + subitem: &NSCollectionLayoutItem, + count: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other horizontalGroupWithLayoutSize:subitems:)] + pub unsafe fn horizontalGroupWithLayoutSize_subitems( + layoutSize: &NSCollectionLayoutSize, + subitems: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other verticalGroupWithLayoutSize:subitem:count:)] + pub unsafe fn verticalGroupWithLayoutSize_subitem_count( + layoutSize: &NSCollectionLayoutSize, + subitem: &NSCollectionLayoutItem, + count: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other verticalGroupWithLayoutSize:subitems:)] + pub unsafe fn verticalGroupWithLayoutSize_subitems( + layoutSize: &NSCollectionLayoutSize, + subitems: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other customGroupWithLayoutSize:itemProvider:)] + pub unsafe fn customGroupWithLayoutSize_itemProvider( + layoutSize: &NSCollectionLayoutSize, + itemProvider: NSCollectionLayoutGroupCustomItemProvider, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Other supplementaryItems)] + pub unsafe fn supplementaryItems( + &self, + ) -> Id, Shared>; + + #[method(setSupplementaryItems:)] + pub unsafe fn setSupplementaryItems( + &self, + supplementaryItems: &NSArray, + ); + + #[method_id(@__retain_semantics Other interItemSpacing)] + pub unsafe fn interItemSpacing(&self) -> Option>; + + #[method(setInterItemSpacing:)] + pub unsafe fn setInterItemSpacing( + &self, + interItemSpacing: Option<&NSCollectionLayoutSpacing>, + ); + + #[method_id(@__retain_semantics Other subitems)] + pub unsafe fn subitems(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other visualDescription)] + pub unsafe fn visualDescription(&self) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionLayoutDimension; + + unsafe impl ClassType for NSCollectionLayoutDimension { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionLayoutDimension { + #[method_id(@__retain_semantics Other fractionalWidthDimension:)] + pub unsafe fn fractionalWidthDimension(fractionalWidth: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other fractionalHeightDimension:)] + pub unsafe fn fractionalHeightDimension(fractionalHeight: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other absoluteDimension:)] + pub unsafe fn absoluteDimension(absoluteDimension: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other estimatedDimension:)] + pub unsafe fn estimatedDimension(estimatedDimension: CGFloat) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method(isFractionalWidth)] + pub unsafe fn isFractionalWidth(&self) -> bool; + + #[method(isFractionalHeight)] + pub unsafe fn isFractionalHeight(&self) -> bool; + + #[method(isAbsolute)] + pub unsafe fn isAbsolute(&self) -> bool; + + #[method(isEstimated)] + pub unsafe fn isEstimated(&self) -> bool; + + #[method(dimension)] + pub unsafe fn dimension(&self) -> CGFloat; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionLayoutSize; + + unsafe impl ClassType for NSCollectionLayoutSize { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionLayoutSize { + #[method_id(@__retain_semantics Other sizeWithWidthDimension:heightDimension:)] + pub unsafe fn sizeWithWidthDimension_heightDimension( + width: &NSCollectionLayoutDimension, + height: &NSCollectionLayoutDimension, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Other widthDimension)] + pub unsafe fn widthDimension(&self) -> Id; + + #[method_id(@__retain_semantics Other heightDimension)] + pub unsafe fn heightDimension(&self) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionLayoutSpacing; + + unsafe impl ClassType for NSCollectionLayoutSpacing { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionLayoutSpacing { + #[method_id(@__retain_semantics Other flexibleSpacing:)] + pub unsafe fn flexibleSpacing(flexibleSpacing: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other fixedSpacing:)] + pub unsafe fn fixedSpacing(fixedSpacing: CGFloat) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method(spacing)] + pub unsafe fn spacing(&self) -> CGFloat; + + #[method(isFlexibleSpacing)] + pub unsafe fn isFlexibleSpacing(&self) -> bool; + + #[method(isFixedSpacing)] + pub unsafe fn isFixedSpacing(&self) -> bool; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionLayoutEdgeSpacing; + + unsafe impl ClassType for NSCollectionLayoutEdgeSpacing { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionLayoutEdgeSpacing { + #[method_id(@__retain_semantics Other spacingForLeading:top:trailing:bottom:)] + pub unsafe fn spacingForLeading_top_trailing_bottom( + leading: Option<&NSCollectionLayoutSpacing>, + top: Option<&NSCollectionLayoutSpacing>, + trailing: Option<&NSCollectionLayoutSpacing>, + bottom: Option<&NSCollectionLayoutSpacing>, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Other leading)] + pub unsafe fn leading(&self) -> Option>; + + #[method_id(@__retain_semantics Other top)] + pub unsafe fn top(&self) -> Option>; + + #[method_id(@__retain_semantics Other trailing)] + pub unsafe fn trailing(&self) -> Option>; + + #[method_id(@__retain_semantics Other bottom)] + pub unsafe fn bottom(&self) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionLayoutSupplementaryItem; + + unsafe impl ClassType for NSCollectionLayoutSupplementaryItem { + type Super = NSCollectionLayoutItem; + } +); + +extern_methods!( + unsafe impl NSCollectionLayoutSupplementaryItem { + #[method_id(@__retain_semantics Other supplementaryItemWithLayoutSize:elementKind:containerAnchor:)] + pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor( + layoutSize: &NSCollectionLayoutSize, + elementKind: &NSString, + containerAnchor: &NSCollectionLayoutAnchor, + ) -> Id; + + #[method_id(@__retain_semantics Other supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor:)] + pub unsafe fn supplementaryItemWithLayoutSize_elementKind_containerAnchor_itemAnchor( + layoutSize: &NSCollectionLayoutSize, + elementKind: &NSString, + containerAnchor: &NSCollectionLayoutAnchor, + itemAnchor: &NSCollectionLayoutAnchor, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method(zIndex)] + pub unsafe fn zIndex(&self) -> NSInteger; + + #[method(setZIndex:)] + pub unsafe fn setZIndex(&self, zIndex: NSInteger); + + #[method_id(@__retain_semantics Other elementKind)] + pub unsafe fn elementKind(&self) -> Id; + + #[method_id(@__retain_semantics Other containerAnchor)] + pub unsafe fn containerAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other itemAnchor)] + pub unsafe fn itemAnchor(&self) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionLayoutBoundarySupplementaryItem; + + unsafe impl ClassType for NSCollectionLayoutBoundarySupplementaryItem { + type Super = NSCollectionLayoutSupplementaryItem; + } +); + +extern_methods!( + unsafe impl NSCollectionLayoutBoundarySupplementaryItem { + #[method_id(@__retain_semantics Other boundarySupplementaryItemWithLayoutSize:elementKind:alignment:)] + pub unsafe fn boundarySupplementaryItemWithLayoutSize_elementKind_alignment( + layoutSize: &NSCollectionLayoutSize, + elementKind: &NSString, + alignment: NSRectAlignment, + ) -> Id; + + #[method_id(@__retain_semantics Other boundarySupplementaryItemWithLayoutSize:elementKind:alignment:absoluteOffset:)] + pub unsafe fn boundarySupplementaryItemWithLayoutSize_elementKind_alignment_absoluteOffset( + layoutSize: &NSCollectionLayoutSize, + elementKind: &NSString, + alignment: NSRectAlignment, + absoluteOffset: NSPoint, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method(extendsBoundary)] + pub unsafe fn extendsBoundary(&self) -> bool; + + #[method(setExtendsBoundary:)] + pub unsafe fn setExtendsBoundary(&self, extendsBoundary: bool); + + #[method(pinToVisibleBounds)] + pub unsafe fn pinToVisibleBounds(&self) -> bool; + + #[method(setPinToVisibleBounds:)] + pub unsafe fn setPinToVisibleBounds(&self, pinToVisibleBounds: bool); + + #[method(alignment)] + pub unsafe fn alignment(&self) -> NSRectAlignment; + + #[method(offset)] + pub unsafe fn offset(&self) -> NSPoint; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionLayoutDecorationItem; + + unsafe impl ClassType for NSCollectionLayoutDecorationItem { + type Super = NSCollectionLayoutItem; + } +); + +extern_methods!( + unsafe impl NSCollectionLayoutDecorationItem { + #[method_id(@__retain_semantics Other backgroundDecorationItemWithElementKind:)] + pub unsafe fn backgroundDecorationItemWithElementKind( + elementKind: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method(zIndex)] + pub unsafe fn zIndex(&self) -> NSInteger; + + #[method(setZIndex:)] + pub unsafe fn setZIndex(&self, zIndex: NSInteger); + + #[method_id(@__retain_semantics Other elementKind)] + pub unsafe fn elementKind(&self) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionLayoutAnchor; + + unsafe impl ClassType for NSCollectionLayoutAnchor { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionLayoutAnchor { + #[method_id(@__retain_semantics Other layoutAnchorWithEdges:)] + pub unsafe fn layoutAnchorWithEdges(edges: NSDirectionalRectEdge) -> Id; + + #[method_id(@__retain_semantics Other layoutAnchorWithEdges:absoluteOffset:)] + pub unsafe fn layoutAnchorWithEdges_absoluteOffset( + edges: NSDirectionalRectEdge, + absoluteOffset: NSPoint, + ) -> Id; + + #[method_id(@__retain_semantics Other layoutAnchorWithEdges:fractionalOffset:)] + pub unsafe fn layoutAnchorWithEdges_fractionalOffset( + edges: NSDirectionalRectEdge, + fractionalOffset: NSPoint, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method(edges)] + pub unsafe fn edges(&self) -> NSDirectionalRectEdge; + + #[method(offset)] + pub unsafe fn offset(&self) -> NSPoint; + + #[method(isAbsoluteOffset)] + pub unsafe fn isAbsoluteOffset(&self) -> bool; + + #[method(isFractionalOffset)] + pub unsafe fn isFractionalOffset(&self) -> bool; + } +); + +extern_protocol!( + pub struct NSCollectionLayoutContainer; + + unsafe impl NSCollectionLayoutContainer { + #[method(contentSize)] + pub unsafe fn contentSize(&self) -> NSSize; + + #[method(effectiveContentSize)] + pub unsafe fn effectiveContentSize(&self) -> NSSize; + + #[method(contentInsets)] + pub unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets; + + #[method(effectiveContentInsets)] + pub unsafe fn effectiveContentInsets(&self) -> NSDirectionalEdgeInsets; + } +); + +extern_protocol!( + pub struct NSCollectionLayoutEnvironment; + + unsafe impl NSCollectionLayoutEnvironment { + #[method_id(@__retain_semantics Other container)] + pub unsafe fn container(&self) -> Id; + } +); + +extern_protocol!( + pub struct NSCollectionLayoutVisibleItem; + + unsafe impl NSCollectionLayoutVisibleItem { + #[method(alpha)] + pub unsafe fn alpha(&self) -> CGFloat; + + #[method(setAlpha:)] + pub unsafe fn setAlpha(&self, alpha: CGFloat); + + #[method(zIndex)] + pub unsafe fn zIndex(&self) -> NSInteger; + + #[method(setZIndex:)] + pub unsafe fn setZIndex(&self, zIndex: NSInteger); + + #[method(isHidden)] + pub unsafe fn isHidden(&self) -> bool; + + #[method(setHidden:)] + pub unsafe fn setHidden(&self, hidden: bool); + + #[method(center)] + pub unsafe fn center(&self) -> NSPoint; + + #[method(setCenter:)] + pub unsafe fn setCenter(&self, center: NSPoint); + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other indexPath)] + pub unsafe fn indexPath(&self) -> Id; + + #[method(frame)] + pub unsafe fn frame(&self) -> NSRect; + + #[method(bounds)] + pub unsafe fn bounds(&self) -> NSRect; + + #[method(representedElementCategory)] + pub unsafe fn representedElementCategory(&self) -> NSCollectionElementCategory; + + #[method_id(@__retain_semantics Other representedElementKind)] + pub unsafe fn representedElementKind(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSCollectionViewFlowLayout.rs b/crates/icrate/src/generated/AppKit/NSCollectionViewFlowLayout.rs new file mode 100644 index 000000000..94f68bc3b --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCollectionViewFlowLayout.rs @@ -0,0 +1,201 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSCollectionViewScrollDirection { + NSCollectionViewScrollDirectionVertical = 0, + NSCollectionViewScrollDirectionHorizontal = 1, + } +); + +extern_static!( + NSCollectionElementKindSectionHeader: &'static NSCollectionViewSupplementaryElementKind +); + +extern_static!( + NSCollectionElementKindSectionFooter: &'static NSCollectionViewSupplementaryElementKind +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionViewFlowLayoutInvalidationContext; + + unsafe impl ClassType for NSCollectionViewFlowLayoutInvalidationContext { + type Super = NSCollectionViewLayoutInvalidationContext; + } +); + +extern_methods!( + unsafe impl NSCollectionViewFlowLayoutInvalidationContext { + #[method(invalidateFlowLayoutDelegateMetrics)] + pub unsafe fn invalidateFlowLayoutDelegateMetrics(&self) -> bool; + + #[method(setInvalidateFlowLayoutDelegateMetrics:)] + pub unsafe fn setInvalidateFlowLayoutDelegateMetrics( + &self, + invalidateFlowLayoutDelegateMetrics: bool, + ); + + #[method(invalidateFlowLayoutAttributes)] + pub unsafe fn invalidateFlowLayoutAttributes(&self) -> bool; + + #[method(setInvalidateFlowLayoutAttributes:)] + pub unsafe fn setInvalidateFlowLayoutAttributes( + &self, + invalidateFlowLayoutAttributes: bool, + ); + } +); + +extern_protocol!( + pub struct NSCollectionViewDelegateFlowLayout; + + unsafe impl NSCollectionViewDelegateFlowLayout { + #[optional] + #[method(collectionView:layout:sizeForItemAtIndexPath:)] + pub unsafe fn collectionView_layout_sizeForItemAtIndexPath( + &self, + collectionView: &NSCollectionView, + collectionViewLayout: &NSCollectionViewLayout, + indexPath: &NSIndexPath, + ) -> NSSize; + + #[optional] + #[method(collectionView:layout:insetForSectionAtIndex:)] + pub unsafe fn collectionView_layout_insetForSectionAtIndex( + &self, + collectionView: &NSCollectionView, + collectionViewLayout: &NSCollectionViewLayout, + section: NSInteger, + ) -> NSEdgeInsets; + + #[optional] + #[method(collectionView:layout:minimumLineSpacingForSectionAtIndex:)] + pub unsafe fn collectionView_layout_minimumLineSpacingForSectionAtIndex( + &self, + collectionView: &NSCollectionView, + collectionViewLayout: &NSCollectionViewLayout, + section: NSInteger, + ) -> CGFloat; + + #[optional] + #[method(collectionView:layout:minimumInteritemSpacingForSectionAtIndex:)] + pub unsafe fn collectionView_layout_minimumInteritemSpacingForSectionAtIndex( + &self, + collectionView: &NSCollectionView, + collectionViewLayout: &NSCollectionViewLayout, + section: NSInteger, + ) -> CGFloat; + + #[optional] + #[method(collectionView:layout:referenceSizeForHeaderInSection:)] + pub unsafe fn collectionView_layout_referenceSizeForHeaderInSection( + &self, + collectionView: &NSCollectionView, + collectionViewLayout: &NSCollectionViewLayout, + section: NSInteger, + ) -> NSSize; + + #[optional] + #[method(collectionView:layout:referenceSizeForFooterInSection:)] + pub unsafe fn collectionView_layout_referenceSizeForFooterInSection( + &self, + collectionView: &NSCollectionView, + collectionViewLayout: &NSCollectionViewLayout, + section: NSInteger, + ) -> NSSize; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionViewFlowLayout; + + unsafe impl ClassType for NSCollectionViewFlowLayout { + type Super = NSCollectionViewLayout; + } +); + +extern_methods!( + unsafe impl NSCollectionViewFlowLayout { + #[method(minimumLineSpacing)] + pub unsafe fn minimumLineSpacing(&self) -> CGFloat; + + #[method(setMinimumLineSpacing:)] + pub unsafe fn setMinimumLineSpacing(&self, minimumLineSpacing: CGFloat); + + #[method(minimumInteritemSpacing)] + pub unsafe fn minimumInteritemSpacing(&self) -> CGFloat; + + #[method(setMinimumInteritemSpacing:)] + pub unsafe fn setMinimumInteritemSpacing(&self, minimumInteritemSpacing: CGFloat); + + #[method(itemSize)] + pub unsafe fn itemSize(&self) -> NSSize; + + #[method(setItemSize:)] + pub unsafe fn setItemSize(&self, itemSize: NSSize); + + #[method(estimatedItemSize)] + pub unsafe fn estimatedItemSize(&self) -> NSSize; + + #[method(setEstimatedItemSize:)] + pub unsafe fn setEstimatedItemSize(&self, estimatedItemSize: NSSize); + + #[method(scrollDirection)] + pub unsafe fn scrollDirection(&self) -> NSCollectionViewScrollDirection; + + #[method(setScrollDirection:)] + pub unsafe fn setScrollDirection(&self, scrollDirection: NSCollectionViewScrollDirection); + + #[method(headerReferenceSize)] + pub unsafe fn headerReferenceSize(&self) -> NSSize; + + #[method(setHeaderReferenceSize:)] + pub unsafe fn setHeaderReferenceSize(&self, headerReferenceSize: NSSize); + + #[method(footerReferenceSize)] + pub unsafe fn footerReferenceSize(&self) -> NSSize; + + #[method(setFooterReferenceSize:)] + pub unsafe fn setFooterReferenceSize(&self, footerReferenceSize: NSSize); + + #[method(sectionInset)] + pub unsafe fn sectionInset(&self) -> NSEdgeInsets; + + #[method(setSectionInset:)] + pub unsafe fn setSectionInset(&self, sectionInset: NSEdgeInsets); + + #[method(sectionHeadersPinToVisibleBounds)] + pub unsafe fn sectionHeadersPinToVisibleBounds(&self) -> bool; + + #[method(setSectionHeadersPinToVisibleBounds:)] + pub unsafe fn setSectionHeadersPinToVisibleBounds( + &self, + sectionHeadersPinToVisibleBounds: bool, + ); + + #[method(sectionFootersPinToVisibleBounds)] + pub unsafe fn sectionFootersPinToVisibleBounds(&self) -> bool; + + #[method(setSectionFootersPinToVisibleBounds:)] + pub unsafe fn setSectionFootersPinToVisibleBounds( + &self, + sectionFootersPinToVisibleBounds: bool, + ); + + #[method(sectionAtIndexIsCollapsed:)] + pub unsafe fn sectionAtIndexIsCollapsed(&self, sectionIndex: NSUInteger) -> bool; + + #[method(collapseSectionAtIndex:)] + pub unsafe fn collapseSectionAtIndex(&self, sectionIndex: NSUInteger); + + #[method(expandSectionAtIndex:)] + pub unsafe fn expandSectionAtIndex(&self, sectionIndex: NSUInteger); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSCollectionViewGridLayout.rs b/crates/icrate/src/generated/AppKit/NSCollectionViewGridLayout.rs new file mode 100644 index 000000000..6a99de670 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCollectionViewGridLayout.rs @@ -0,0 +1,67 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionViewGridLayout; + + unsafe impl ClassType for NSCollectionViewGridLayout { + type Super = NSCollectionViewLayout; + } +); + +extern_methods!( + unsafe impl NSCollectionViewGridLayout { + #[method(margins)] + pub unsafe fn margins(&self) -> NSEdgeInsets; + + #[method(setMargins:)] + pub unsafe fn setMargins(&self, margins: NSEdgeInsets); + + #[method(minimumInteritemSpacing)] + pub unsafe fn minimumInteritemSpacing(&self) -> CGFloat; + + #[method(setMinimumInteritemSpacing:)] + pub unsafe fn setMinimumInteritemSpacing(&self, minimumInteritemSpacing: CGFloat); + + #[method(minimumLineSpacing)] + pub unsafe fn minimumLineSpacing(&self) -> CGFloat; + + #[method(setMinimumLineSpacing:)] + pub unsafe fn setMinimumLineSpacing(&self, minimumLineSpacing: CGFloat); + + #[method(maximumNumberOfRows)] + pub unsafe fn maximumNumberOfRows(&self) -> NSUInteger; + + #[method(setMaximumNumberOfRows:)] + pub unsafe fn setMaximumNumberOfRows(&self, maximumNumberOfRows: NSUInteger); + + #[method(maximumNumberOfColumns)] + pub unsafe fn maximumNumberOfColumns(&self) -> NSUInteger; + + #[method(setMaximumNumberOfColumns:)] + pub unsafe fn setMaximumNumberOfColumns(&self, maximumNumberOfColumns: NSUInteger); + + #[method(minimumItemSize)] + pub unsafe fn minimumItemSize(&self) -> NSSize; + + #[method(setMinimumItemSize:)] + pub unsafe fn setMinimumItemSize(&self, minimumItemSize: NSSize); + + #[method(maximumItemSize)] + pub unsafe fn maximumItemSize(&self) -> NSSize; + + #[method(setMaximumItemSize:)] + pub unsafe fn setMaximumItemSize(&self, maximumItemSize: NSSize); + + #[method_id(@__retain_semantics Other backgroundColors)] + pub unsafe fn backgroundColors(&self) -> Id, Shared>; + + #[method(setBackgroundColors:)] + pub unsafe fn setBackgroundColors(&self, backgroundColors: Option<&NSArray>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSCollectionViewLayout.rs b/crates/icrate/src/generated/AppKit/NSCollectionViewLayout.rs new file mode 100644 index 000000000..a13d63e6d --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCollectionViewLayout.rs @@ -0,0 +1,420 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSCollectionElementCategory { + NSCollectionElementCategoryItem = 0, + NSCollectionElementCategorySupplementaryView = 1, + NSCollectionElementCategoryDecorationView = 2, + NSCollectionElementCategoryInterItemGap = 3, + } +); + +pub type NSCollectionViewDecorationElementKind = NSString; + +extern_static!( + NSCollectionElementKindInterItemGapIndicator: &'static NSCollectionViewSupplementaryElementKind +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionViewLayoutAttributes; + + unsafe impl ClassType for NSCollectionViewLayoutAttributes { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionViewLayoutAttributes { + #[method(frame)] + pub unsafe fn frame(&self) -> NSRect; + + #[method(setFrame:)] + pub unsafe fn setFrame(&self, frame: NSRect); + + #[method(size)] + pub unsafe fn size(&self) -> NSSize; + + #[method(setSize:)] + pub unsafe fn setSize(&self, size: NSSize); + + #[method(alpha)] + pub unsafe fn alpha(&self) -> CGFloat; + + #[method(setAlpha:)] + pub unsafe fn setAlpha(&self, alpha: CGFloat); + + #[method(zIndex)] + pub unsafe fn zIndex(&self) -> NSInteger; + + #[method(setZIndex:)] + pub unsafe fn setZIndex(&self, zIndex: NSInteger); + + #[method(isHidden)] + pub unsafe fn isHidden(&self) -> bool; + + #[method(setHidden:)] + pub unsafe fn setHidden(&self, hidden: bool); + + #[method_id(@__retain_semantics Other indexPath)] + pub unsafe fn indexPath(&self) -> Option>; + + #[method(setIndexPath:)] + pub unsafe fn setIndexPath(&self, indexPath: Option<&NSIndexPath>); + + #[method(representedElementCategory)] + pub unsafe fn representedElementCategory(&self) -> NSCollectionElementCategory; + + #[method_id(@__retain_semantics Other representedElementKind)] + pub unsafe fn representedElementKind(&self) -> Option>; + + #[method_id(@__retain_semantics Other layoutAttributesForItemWithIndexPath:)] + pub unsafe fn layoutAttributesForItemWithIndexPath( + indexPath: &NSIndexPath, + ) -> Id; + + #[method_id(@__retain_semantics Other layoutAttributesForInterItemGapBeforeIndexPath:)] + pub unsafe fn layoutAttributesForInterItemGapBeforeIndexPath( + indexPath: &NSIndexPath, + ) -> Id; + + #[method_id(@__retain_semantics Other layoutAttributesForSupplementaryViewOfKind:withIndexPath:)] + pub unsafe fn layoutAttributesForSupplementaryViewOfKind_withIndexPath( + elementKind: &NSCollectionViewSupplementaryElementKind, + indexPath: &NSIndexPath, + ) -> Id; + + #[method_id(@__retain_semantics Other layoutAttributesForDecorationViewOfKind:withIndexPath:)] + pub unsafe fn layoutAttributesForDecorationViewOfKind_withIndexPath( + decorationViewKind: &NSCollectionViewDecorationElementKind, + indexPath: &NSIndexPath, + ) -> Id; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSCollectionUpdateAction { + NSCollectionUpdateActionInsert = 0, + NSCollectionUpdateActionDelete = 1, + NSCollectionUpdateActionReload = 2, + NSCollectionUpdateActionMove = 3, + NSCollectionUpdateActionNone = 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionViewUpdateItem; + + unsafe impl ClassType for NSCollectionViewUpdateItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionViewUpdateItem { + #[method_id(@__retain_semantics Other indexPathBeforeUpdate)] + pub unsafe fn indexPathBeforeUpdate(&self) -> Option>; + + #[method_id(@__retain_semantics Other indexPathAfterUpdate)] + pub unsafe fn indexPathAfterUpdate(&self) -> Option>; + + #[method(updateAction)] + pub unsafe fn updateAction(&self) -> NSCollectionUpdateAction; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionViewLayoutInvalidationContext; + + unsafe impl ClassType for NSCollectionViewLayoutInvalidationContext { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionViewLayoutInvalidationContext { + #[method(invalidateEverything)] + pub unsafe fn invalidateEverything(&self) -> bool; + + #[method(invalidateDataSourceCounts)] + pub unsafe fn invalidateDataSourceCounts(&self) -> bool; + + #[method(invalidateItemsAtIndexPaths:)] + pub unsafe fn invalidateItemsAtIndexPaths(&self, indexPaths: &NSSet); + + #[method(invalidateSupplementaryElementsOfKind:atIndexPaths:)] + pub unsafe fn invalidateSupplementaryElementsOfKind_atIndexPaths( + &self, + elementKind: &NSCollectionViewSupplementaryElementKind, + indexPaths: &NSSet, + ); + + #[method(invalidateDecorationElementsOfKind:atIndexPaths:)] + pub unsafe fn invalidateDecorationElementsOfKind_atIndexPaths( + &self, + elementKind: &NSCollectionViewDecorationElementKind, + indexPaths: &NSSet, + ); + + #[method_id(@__retain_semantics Other invalidatedItemIndexPaths)] + pub unsafe fn invalidatedItemIndexPaths(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other invalidatedSupplementaryIndexPaths)] + pub unsafe fn invalidatedSupplementaryIndexPaths( + &self, + ) -> Option< + Id>, Shared>, + >; + + #[method_id(@__retain_semantics Other invalidatedDecorationIndexPaths)] + pub unsafe fn invalidatedDecorationIndexPaths( + &self, + ) -> Option< + Id>, Shared>, + >; + + #[method(contentOffsetAdjustment)] + pub unsafe fn contentOffsetAdjustment(&self) -> NSPoint; + + #[method(setContentOffsetAdjustment:)] + pub unsafe fn setContentOffsetAdjustment(&self, contentOffsetAdjustment: NSPoint); + + #[method(contentSizeAdjustment)] + pub unsafe fn contentSizeAdjustment(&self) -> NSSize; + + #[method(setContentSizeAdjustment:)] + pub unsafe fn setContentSizeAdjustment(&self, contentSizeAdjustment: NSSize); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionViewLayout; + + unsafe impl ClassType for NSCollectionViewLayout { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCollectionViewLayout { + #[method_id(@__retain_semantics Other collectionView)] + pub unsafe fn collectionView(&self) -> Option>; + + #[method(invalidateLayout)] + pub unsafe fn invalidateLayout(&self); + + #[method(invalidateLayoutWithContext:)] + pub unsafe fn invalidateLayoutWithContext( + &self, + context: &NSCollectionViewLayoutInvalidationContext, + ); + + #[method(registerClass:forDecorationViewOfKind:)] + pub unsafe fn registerClass_forDecorationViewOfKind( + &self, + viewClass: Option<&Class>, + elementKind: &NSCollectionViewDecorationElementKind, + ); + + #[method(registerNib:forDecorationViewOfKind:)] + pub unsafe fn registerNib_forDecorationViewOfKind( + &self, + nib: Option<&NSNib>, + elementKind: &NSCollectionViewDecorationElementKind, + ); + } +); + +extern_methods!( + /// NSSubclassingHooks + unsafe impl NSCollectionViewLayout { + #[method(layoutAttributesClass)] + pub unsafe fn layoutAttributesClass() -> &'static Class; + + #[method(invalidationContextClass)] + pub unsafe fn invalidationContextClass() -> &'static Class; + + #[method(prepareLayout)] + pub unsafe fn prepareLayout(&self); + + #[method_id(@__retain_semantics Other layoutAttributesForElementsInRect:)] + pub unsafe fn layoutAttributesForElementsInRect( + &self, + rect: NSRect, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other layoutAttributesForItemAtIndexPath:)] + pub unsafe fn layoutAttributesForItemAtIndexPath( + &self, + indexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other layoutAttributesForSupplementaryViewOfKind:atIndexPath:)] + pub unsafe fn layoutAttributesForSupplementaryViewOfKind_atIndexPath( + &self, + elementKind: &NSCollectionViewSupplementaryElementKind, + indexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other layoutAttributesForDecorationViewOfKind:atIndexPath:)] + pub unsafe fn layoutAttributesForDecorationViewOfKind_atIndexPath( + &self, + elementKind: &NSCollectionViewDecorationElementKind, + indexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other layoutAttributesForDropTargetAtPoint:)] + pub unsafe fn layoutAttributesForDropTargetAtPoint( + &self, + pointInCollectionView: NSPoint, + ) -> Option>; + + #[method_id(@__retain_semantics Other layoutAttributesForInterItemGapBeforeIndexPath:)] + pub unsafe fn layoutAttributesForInterItemGapBeforeIndexPath( + &self, + indexPath: &NSIndexPath, + ) -> Option>; + + #[method(shouldInvalidateLayoutForBoundsChange:)] + pub unsafe fn shouldInvalidateLayoutForBoundsChange(&self, newBounds: NSRect) -> bool; + + #[method_id(@__retain_semantics Other invalidationContextForBoundsChange:)] + pub unsafe fn invalidationContextForBoundsChange( + &self, + newBounds: NSRect, + ) -> Id; + + #[method(shouldInvalidateLayoutForPreferredLayoutAttributes:withOriginalAttributes:)] + pub unsafe fn shouldInvalidateLayoutForPreferredLayoutAttributes_withOriginalAttributes( + &self, + preferredAttributes: &NSCollectionViewLayoutAttributes, + originalAttributes: &NSCollectionViewLayoutAttributes, + ) -> bool; + + #[method_id(@__retain_semantics Other invalidationContextForPreferredLayoutAttributes:withOriginalAttributes:)] + pub unsafe fn invalidationContextForPreferredLayoutAttributes_withOriginalAttributes( + &self, + preferredAttributes: &NSCollectionViewLayoutAttributes, + originalAttributes: &NSCollectionViewLayoutAttributes, + ) -> Id; + + #[method(targetContentOffsetForProposedContentOffset:withScrollingVelocity:)] + pub unsafe fn targetContentOffsetForProposedContentOffset_withScrollingVelocity( + &self, + proposedContentOffset: NSPoint, + velocity: NSPoint, + ) -> NSPoint; + + #[method(targetContentOffsetForProposedContentOffset:)] + pub unsafe fn targetContentOffsetForProposedContentOffset( + &self, + proposedContentOffset: NSPoint, + ) -> NSPoint; + + #[method(collectionViewContentSize)] + pub unsafe fn collectionViewContentSize(&self) -> NSSize; + } +); + +extern_methods!( + /// NSUpdateSupportHooks + unsafe impl NSCollectionViewLayout { + #[method(prepareForCollectionViewUpdates:)] + pub unsafe fn prepareForCollectionViewUpdates( + &self, + updateItems: &NSArray, + ); + + #[method(finalizeCollectionViewUpdates)] + pub unsafe fn finalizeCollectionViewUpdates(&self); + + #[method(prepareForAnimatedBoundsChange:)] + pub unsafe fn prepareForAnimatedBoundsChange(&self, oldBounds: NSRect); + + #[method(finalizeAnimatedBoundsChange)] + pub unsafe fn finalizeAnimatedBoundsChange(&self); + + #[method(prepareForTransitionToLayout:)] + pub unsafe fn prepareForTransitionToLayout(&self, newLayout: &NSCollectionViewLayout); + + #[method(prepareForTransitionFromLayout:)] + pub unsafe fn prepareForTransitionFromLayout(&self, oldLayout: &NSCollectionViewLayout); + + #[method(finalizeLayoutTransition)] + pub unsafe fn finalizeLayoutTransition(&self); + + #[method_id(@__retain_semantics Other initialLayoutAttributesForAppearingItemAtIndexPath:)] + pub unsafe fn initialLayoutAttributesForAppearingItemAtIndexPath( + &self, + itemIndexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other finalLayoutAttributesForDisappearingItemAtIndexPath:)] + pub unsafe fn finalLayoutAttributesForDisappearingItemAtIndexPath( + &self, + itemIndexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other initialLayoutAttributesForAppearingSupplementaryElementOfKind:atIndexPath:)] + pub unsafe fn initialLayoutAttributesForAppearingSupplementaryElementOfKind_atIndexPath( + &self, + elementKind: &NSCollectionViewSupplementaryElementKind, + elementIndexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other finalLayoutAttributesForDisappearingSupplementaryElementOfKind:atIndexPath:)] + pub unsafe fn finalLayoutAttributesForDisappearingSupplementaryElementOfKind_atIndexPath( + &self, + elementKind: &NSCollectionViewSupplementaryElementKind, + elementIndexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other initialLayoutAttributesForAppearingDecorationElementOfKind:atIndexPath:)] + pub unsafe fn initialLayoutAttributesForAppearingDecorationElementOfKind_atIndexPath( + &self, + elementKind: &NSCollectionViewDecorationElementKind, + decorationIndexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other finalLayoutAttributesForDisappearingDecorationElementOfKind:atIndexPath:)] + pub unsafe fn finalLayoutAttributesForDisappearingDecorationElementOfKind_atIndexPath( + &self, + elementKind: &NSCollectionViewDecorationElementKind, + decorationIndexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other indexPathsToDeleteForSupplementaryViewOfKind:)] + pub unsafe fn indexPathsToDeleteForSupplementaryViewOfKind( + &self, + elementKind: &NSCollectionViewSupplementaryElementKind, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other indexPathsToDeleteForDecorationViewOfKind:)] + pub unsafe fn indexPathsToDeleteForDecorationViewOfKind( + &self, + elementKind: &NSCollectionViewDecorationElementKind, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other indexPathsToInsertForSupplementaryViewOfKind:)] + pub unsafe fn indexPathsToInsertForSupplementaryViewOfKind( + &self, + elementKind: &NSCollectionViewSupplementaryElementKind, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other indexPathsToInsertForDecorationViewOfKind:)] + pub unsafe fn indexPathsToInsertForDecorationViewOfKind( + &self, + elementKind: &NSCollectionViewDecorationElementKind, + ) -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSCollectionViewTransitionLayout.rs b/crates/icrate/src/generated/AppKit/NSCollectionViewTransitionLayout.rs new file mode 100644 index 000000000..9590ab272 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCollectionViewTransitionLayout.rs @@ -0,0 +1,53 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSCollectionViewTransitionLayoutAnimatedKey = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSCollectionViewTransitionLayout; + + unsafe impl ClassType for NSCollectionViewTransitionLayout { + type Super = NSCollectionViewLayout; + } +); + +extern_methods!( + unsafe impl NSCollectionViewTransitionLayout { + #[method(transitionProgress)] + pub unsafe fn transitionProgress(&self) -> CGFloat; + + #[method(setTransitionProgress:)] + pub unsafe fn setTransitionProgress(&self, transitionProgress: CGFloat); + + #[method_id(@__retain_semantics Other currentLayout)] + pub unsafe fn currentLayout(&self) -> Id; + + #[method_id(@__retain_semantics Other nextLayout)] + pub unsafe fn nextLayout(&self) -> Id; + + #[method_id(@__retain_semantics Init initWithCurrentLayout:nextLayout:)] + pub unsafe fn initWithCurrentLayout_nextLayout( + this: Option>, + currentLayout: &NSCollectionViewLayout, + newLayout: &NSCollectionViewLayout, + ) -> Id; + + #[method(updateValue:forAnimatedKey:)] + pub unsafe fn updateValue_forAnimatedKey( + &self, + value: CGFloat, + key: &NSCollectionViewTransitionLayoutAnimatedKey, + ); + + #[method(valueForAnimatedKey:)] + pub unsafe fn valueForAnimatedKey( + &self, + key: &NSCollectionViewTransitionLayoutAnimatedKey, + ) -> CGFloat; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSColor.rs b/crates/icrate/src/generated/AppKit/NSColor.rs new file mode 100644 index 000000000..afe99195c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSColor.rs @@ -0,0 +1,604 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSAppKitVersionNumberWithPatternColorLeakFix: NSAppKitVersion = 641.0); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSColorType { + NSColorTypeComponentBased = 0, + NSColorTypePattern = 1, + NSColorTypeCatalog = 2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSColorSystemEffect { + NSColorSystemEffectNone = 0, + NSColorSystemEffectPressed = 1, + NSColorSystemEffectDeepPressed = 2, + NSColorSystemEffectDisabled = 3, + NSColorSystemEffectRollover = 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSColor; + + unsafe impl ClassType for NSColor { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSColor { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other colorWithColorSpace:components:count:)] + pub unsafe fn colorWithColorSpace_components_count( + space: &NSColorSpace, + components: NonNull, + numberOfComponents: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithSRGBRed:green:blue:alpha:)] + pub unsafe fn colorWithSRGBRed_green_blue_alpha( + red: CGFloat, + green: CGFloat, + blue: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithGenericGamma22White:alpha:)] + pub unsafe fn colorWithGenericGamma22White_alpha( + white: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithDisplayP3Red:green:blue:alpha:)] + pub unsafe fn colorWithDisplayP3Red_green_blue_alpha( + red: CGFloat, + green: CGFloat, + blue: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithWhite:alpha:)] + pub unsafe fn colorWithWhite_alpha(white: CGFloat, alpha: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other colorWithRed:green:blue:alpha:)] + pub unsafe fn colorWithRed_green_blue_alpha( + red: CGFloat, + green: CGFloat, + blue: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithHue:saturation:brightness:alpha:)] + pub unsafe fn colorWithHue_saturation_brightness_alpha( + hue: CGFloat, + saturation: CGFloat, + brightness: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithColorSpace:hue:saturation:brightness:alpha:)] + pub unsafe fn colorWithColorSpace_hue_saturation_brightness_alpha( + space: &NSColorSpace, + hue: CGFloat, + saturation: CGFloat, + brightness: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithCatalogName:colorName:)] + pub unsafe fn colorWithCatalogName_colorName( + listName: &NSColorListName, + colorName: &NSColorName, + ) -> Option>; + + #[method_id(@__retain_semantics Other colorNamed:bundle:)] + pub unsafe fn colorNamed_bundle( + name: &NSColorName, + bundle: Option<&NSBundle>, + ) -> Option>; + + #[method_id(@__retain_semantics Other colorNamed:)] + pub unsafe fn colorNamed(name: &NSColorName) -> Option>; + + #[method_id(@__retain_semantics Other colorWithName:dynamicProvider:)] + pub unsafe fn colorWithName_dynamicProvider( + colorName: Option<&NSColorName>, + dynamicProvider: &Block<(NonNull,), NonNull>, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithDeviceWhite:alpha:)] + pub unsafe fn colorWithDeviceWhite_alpha( + white: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithDeviceRed:green:blue:alpha:)] + pub unsafe fn colorWithDeviceRed_green_blue_alpha( + red: CGFloat, + green: CGFloat, + blue: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithDeviceHue:saturation:brightness:alpha:)] + pub unsafe fn colorWithDeviceHue_saturation_brightness_alpha( + hue: CGFloat, + saturation: CGFloat, + brightness: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithDeviceCyan:magenta:yellow:black:alpha:)] + pub unsafe fn colorWithDeviceCyan_magenta_yellow_black_alpha( + cyan: CGFloat, + magenta: CGFloat, + yellow: CGFloat, + black: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithCalibratedWhite:alpha:)] + pub unsafe fn colorWithCalibratedWhite_alpha( + white: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithCalibratedRed:green:blue:alpha:)] + pub unsafe fn colorWithCalibratedRed_green_blue_alpha( + red: CGFloat, + green: CGFloat, + blue: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithCalibratedHue:saturation:brightness:alpha:)] + pub unsafe fn colorWithCalibratedHue_saturation_brightness_alpha( + hue: CGFloat, + saturation: CGFloat, + brightness: CGFloat, + alpha: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other colorWithPatternImage:)] + pub unsafe fn colorWithPatternImage(image: &NSImage) -> Id; + + #[method(type)] + pub unsafe fn type_(&self) -> NSColorType; + + #[method_id(@__retain_semantics Other colorUsingType:)] + pub unsafe fn colorUsingType(&self, type_: NSColorType) -> Option>; + + #[method_id(@__retain_semantics Other colorUsingColorSpace:)] + pub unsafe fn colorUsingColorSpace( + &self, + space: &NSColorSpace, + ) -> Option>; + + #[method_id(@__retain_semantics Other blackColor)] + pub unsafe fn blackColor() -> Id; + + #[method_id(@__retain_semantics Other darkGrayColor)] + pub unsafe fn darkGrayColor() -> Id; + + #[method_id(@__retain_semantics Other lightGrayColor)] + pub unsafe fn lightGrayColor() -> Id; + + #[method_id(@__retain_semantics Other whiteColor)] + pub unsafe fn whiteColor() -> Id; + + #[method_id(@__retain_semantics Other grayColor)] + pub unsafe fn grayColor() -> Id; + + #[method_id(@__retain_semantics Other redColor)] + pub unsafe fn redColor() -> Id; + + #[method_id(@__retain_semantics Other greenColor)] + pub unsafe fn greenColor() -> Id; + + #[method_id(@__retain_semantics Other blueColor)] + pub unsafe fn blueColor() -> Id; + + #[method_id(@__retain_semantics Other cyanColor)] + pub unsafe fn cyanColor() -> Id; + + #[method_id(@__retain_semantics Other yellowColor)] + pub unsafe fn yellowColor() -> Id; + + #[method_id(@__retain_semantics Other magentaColor)] + pub unsafe fn magentaColor() -> Id; + + #[method_id(@__retain_semantics Other orangeColor)] + pub unsafe fn orangeColor() -> Id; + + #[method_id(@__retain_semantics Other purpleColor)] + pub unsafe fn purpleColor() -> Id; + + #[method_id(@__retain_semantics Other brownColor)] + pub unsafe fn brownColor() -> Id; + + #[method_id(@__retain_semantics Other clearColor)] + pub unsafe fn clearColor() -> Id; + + #[method_id(@__retain_semantics Other labelColor)] + pub unsafe fn labelColor() -> Id; + + #[method_id(@__retain_semantics Other secondaryLabelColor)] + pub unsafe fn secondaryLabelColor() -> Id; + + #[method_id(@__retain_semantics Other tertiaryLabelColor)] + pub unsafe fn tertiaryLabelColor() -> Id; + + #[method_id(@__retain_semantics Other quaternaryLabelColor)] + pub unsafe fn quaternaryLabelColor() -> Id; + + #[method_id(@__retain_semantics Other linkColor)] + pub unsafe fn linkColor() -> Id; + + #[method_id(@__retain_semantics Other placeholderTextColor)] + pub unsafe fn placeholderTextColor() -> Id; + + #[method_id(@__retain_semantics Other windowFrameTextColor)] + pub unsafe fn windowFrameTextColor() -> Id; + + #[method_id(@__retain_semantics Other selectedMenuItemTextColor)] + pub unsafe fn selectedMenuItemTextColor() -> Id; + + #[method_id(@__retain_semantics Other alternateSelectedControlTextColor)] + pub unsafe fn alternateSelectedControlTextColor() -> Id; + + #[method_id(@__retain_semantics Other headerTextColor)] + pub unsafe fn headerTextColor() -> Id; + + #[method_id(@__retain_semantics Other separatorColor)] + pub unsafe fn separatorColor() -> Id; + + #[method_id(@__retain_semantics Other gridColor)] + pub unsafe fn gridColor() -> Id; + + #[method_id(@__retain_semantics Other windowBackgroundColor)] + pub unsafe fn windowBackgroundColor() -> Id; + + #[method_id(@__retain_semantics Other underPageBackgroundColor)] + pub unsafe fn underPageBackgroundColor() -> Id; + + #[method_id(@__retain_semantics Other controlBackgroundColor)] + pub unsafe fn controlBackgroundColor() -> Id; + + #[method_id(@__retain_semantics Other selectedContentBackgroundColor)] + pub unsafe fn selectedContentBackgroundColor() -> Id; + + #[method_id(@__retain_semantics Other unemphasizedSelectedContentBackgroundColor)] + pub unsafe fn unemphasizedSelectedContentBackgroundColor() -> Id; + + #[method_id(@__retain_semantics Other alternatingContentBackgroundColors)] + pub unsafe fn alternatingContentBackgroundColors() -> Id, Shared>; + + #[method_id(@__retain_semantics Other findHighlightColor)] + pub unsafe fn findHighlightColor() -> Id; + + #[method_id(@__retain_semantics Other textColor)] + pub unsafe fn textColor() -> Id; + + #[method_id(@__retain_semantics Other textBackgroundColor)] + pub unsafe fn textBackgroundColor() -> Id; + + #[method_id(@__retain_semantics Other selectedTextColor)] + pub unsafe fn selectedTextColor() -> Id; + + #[method_id(@__retain_semantics Other selectedTextBackgroundColor)] + pub unsafe fn selectedTextBackgroundColor() -> Id; + + #[method_id(@__retain_semantics Other unemphasizedSelectedTextBackgroundColor)] + pub unsafe fn unemphasizedSelectedTextBackgroundColor() -> Id; + + #[method_id(@__retain_semantics Other unemphasizedSelectedTextColor)] + pub unsafe fn unemphasizedSelectedTextColor() -> Id; + + #[method_id(@__retain_semantics Other controlColor)] + pub unsafe fn controlColor() -> Id; + + #[method_id(@__retain_semantics Other controlTextColor)] + pub unsafe fn controlTextColor() -> Id; + + #[method_id(@__retain_semantics Other selectedControlColor)] + pub unsafe fn selectedControlColor() -> Id; + + #[method_id(@__retain_semantics Other selectedControlTextColor)] + pub unsafe fn selectedControlTextColor() -> Id; + + #[method_id(@__retain_semantics Other disabledControlTextColor)] + pub unsafe fn disabledControlTextColor() -> Id; + + #[method_id(@__retain_semantics Other keyboardFocusIndicatorColor)] + pub unsafe fn keyboardFocusIndicatorColor() -> Id; + + #[method_id(@__retain_semantics Other scrubberTexturedBackgroundColor)] + pub unsafe fn scrubberTexturedBackgroundColor() -> Id; + + #[method_id(@__retain_semantics Other systemRedColor)] + pub unsafe fn systemRedColor() -> Id; + + #[method_id(@__retain_semantics Other systemGreenColor)] + pub unsafe fn systemGreenColor() -> Id; + + #[method_id(@__retain_semantics Other systemBlueColor)] + pub unsafe fn systemBlueColor() -> Id; + + #[method_id(@__retain_semantics Other systemOrangeColor)] + pub unsafe fn systemOrangeColor() -> Id; + + #[method_id(@__retain_semantics Other systemYellowColor)] + pub unsafe fn systemYellowColor() -> Id; + + #[method_id(@__retain_semantics Other systemBrownColor)] + pub unsafe fn systemBrownColor() -> Id; + + #[method_id(@__retain_semantics Other systemPinkColor)] + pub unsafe fn systemPinkColor() -> Id; + + #[method_id(@__retain_semantics Other systemPurpleColor)] + pub unsafe fn systemPurpleColor() -> Id; + + #[method_id(@__retain_semantics Other systemGrayColor)] + pub unsafe fn systemGrayColor() -> Id; + + #[method_id(@__retain_semantics Other systemTealColor)] + pub unsafe fn systemTealColor() -> Id; + + #[method_id(@__retain_semantics Other systemIndigoColor)] + pub unsafe fn systemIndigoColor() -> Id; + + #[method_id(@__retain_semantics Other systemMintColor)] + pub unsafe fn systemMintColor() -> Id; + + #[method_id(@__retain_semantics Other systemCyanColor)] + pub unsafe fn systemCyanColor() -> Id; + + #[method_id(@__retain_semantics Other controlAccentColor)] + pub unsafe fn controlAccentColor() -> Id; + + #[method(currentControlTint)] + pub unsafe fn currentControlTint() -> NSControlTint; + + #[method_id(@__retain_semantics Other colorForControlTint:)] + pub unsafe fn colorForControlTint(controlTint: NSControlTint) -> Id; + + #[method_id(@__retain_semantics Other highlightColor)] + pub unsafe fn highlightColor() -> Id; + + #[method_id(@__retain_semantics Other shadowColor)] + pub unsafe fn shadowColor() -> Id; + + #[method_id(@__retain_semantics Other highlightWithLevel:)] + pub unsafe fn highlightWithLevel(&self, val: CGFloat) -> Option>; + + #[method_id(@__retain_semantics Other shadowWithLevel:)] + pub unsafe fn shadowWithLevel(&self, val: CGFloat) -> Option>; + + #[method_id(@__retain_semantics Other colorWithSystemEffect:)] + pub unsafe fn colorWithSystemEffect( + &self, + systemEffect: NSColorSystemEffect, + ) -> Id; + + #[method(set)] + pub unsafe fn set(&self); + + #[method(setFill)] + pub unsafe fn setFill(&self); + + #[method(setStroke)] + pub unsafe fn setStroke(&self); + + #[method_id(@__retain_semantics Other blendedColorWithFraction:ofColor:)] + pub unsafe fn blendedColorWithFraction_ofColor( + &self, + fraction: CGFloat, + color: &NSColor, + ) -> Option>; + + #[method_id(@__retain_semantics Other colorWithAlphaComponent:)] + pub unsafe fn colorWithAlphaComponent(&self, alpha: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other catalogNameComponent)] + pub unsafe fn catalogNameComponent(&self) -> Id; + + #[method_id(@__retain_semantics Other colorNameComponent)] + pub unsafe fn colorNameComponent(&self) -> Id; + + #[method_id(@__retain_semantics Other localizedCatalogNameComponent)] + pub unsafe fn localizedCatalogNameComponent(&self) -> Id; + + #[method_id(@__retain_semantics Other localizedColorNameComponent)] + pub unsafe fn localizedColorNameComponent(&self) -> Id; + + #[method(redComponent)] + pub unsafe fn redComponent(&self) -> CGFloat; + + #[method(greenComponent)] + pub unsafe fn greenComponent(&self) -> CGFloat; + + #[method(blueComponent)] + pub unsafe fn blueComponent(&self) -> CGFloat; + + #[method(getRed:green:blue:alpha:)] + pub unsafe fn getRed_green_blue_alpha( + &self, + red: *mut CGFloat, + green: *mut CGFloat, + blue: *mut CGFloat, + alpha: *mut CGFloat, + ); + + #[method(hueComponent)] + pub unsafe fn hueComponent(&self) -> CGFloat; + + #[method(saturationComponent)] + pub unsafe fn saturationComponent(&self) -> CGFloat; + + #[method(brightnessComponent)] + pub unsafe fn brightnessComponent(&self) -> CGFloat; + + #[method(getHue:saturation:brightness:alpha:)] + pub unsafe fn getHue_saturation_brightness_alpha( + &self, + hue: *mut CGFloat, + saturation: *mut CGFloat, + brightness: *mut CGFloat, + alpha: *mut CGFloat, + ); + + #[method(whiteComponent)] + pub unsafe fn whiteComponent(&self) -> CGFloat; + + #[method(getWhite:alpha:)] + pub unsafe fn getWhite_alpha(&self, white: *mut CGFloat, alpha: *mut CGFloat); + + #[method(cyanComponent)] + pub unsafe fn cyanComponent(&self) -> CGFloat; + + #[method(magentaComponent)] + pub unsafe fn magentaComponent(&self) -> CGFloat; + + #[method(yellowComponent)] + pub unsafe fn yellowComponent(&self) -> CGFloat; + + #[method(blackComponent)] + pub unsafe fn blackComponent(&self) -> CGFloat; + + #[method(getCyan:magenta:yellow:black:alpha:)] + pub unsafe fn getCyan_magenta_yellow_black_alpha( + &self, + cyan: *mut CGFloat, + magenta: *mut CGFloat, + yellow: *mut CGFloat, + black: *mut CGFloat, + alpha: *mut CGFloat, + ); + + #[method_id(@__retain_semantics Other colorSpace)] + pub unsafe fn colorSpace(&self) -> Id; + + #[method(numberOfComponents)] + pub unsafe fn numberOfComponents(&self) -> NSInteger; + + #[method(getComponents:)] + pub unsafe fn getComponents(&self, components: NonNull); + + #[method_id(@__retain_semantics Other patternImage)] + pub unsafe fn patternImage(&self) -> Id; + + #[method(alphaComponent)] + pub unsafe fn alphaComponent(&self) -> CGFloat; + + #[method_id(@__retain_semantics Other colorFromPasteboard:)] + pub unsafe fn colorFromPasteboard(pasteBoard: &NSPasteboard) + -> Option>; + + #[method(writeToPasteboard:)] + pub unsafe fn writeToPasteboard(&self, pasteBoard: &NSPasteboard); + + #[method(drawSwatchInRect:)] + pub unsafe fn drawSwatchInRect(&self, rect: NSRect); + + #[method(ignoresAlpha)] + pub unsafe fn ignoresAlpha() -> bool; + + #[method(setIgnoresAlpha:)] + pub unsafe fn setIgnoresAlpha(ignoresAlpha: bool); + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSColor { + #[method_id(@__retain_semantics Other controlHighlightColor)] + pub unsafe fn controlHighlightColor() -> Id; + + #[method_id(@__retain_semantics Other controlLightHighlightColor)] + pub unsafe fn controlLightHighlightColor() -> Id; + + #[method_id(@__retain_semantics Other controlShadowColor)] + pub unsafe fn controlShadowColor() -> Id; + + #[method_id(@__retain_semantics Other controlDarkShadowColor)] + pub unsafe fn controlDarkShadowColor() -> Id; + + #[method_id(@__retain_semantics Other scrollBarColor)] + pub unsafe fn scrollBarColor() -> Id; + + #[method_id(@__retain_semantics Other knobColor)] + pub unsafe fn knobColor() -> Id; + + #[method_id(@__retain_semantics Other selectedKnobColor)] + pub unsafe fn selectedKnobColor() -> Id; + + #[method_id(@__retain_semantics Other windowFrameColor)] + pub unsafe fn windowFrameColor() -> Id; + + #[method_id(@__retain_semantics Other selectedMenuItemColor)] + pub unsafe fn selectedMenuItemColor() -> Id; + + #[method_id(@__retain_semantics Other headerColor)] + pub unsafe fn headerColor() -> Id; + + #[method_id(@__retain_semantics Other secondarySelectedControlColor)] + pub unsafe fn secondarySelectedControlColor() -> Id; + + #[method_id(@__retain_semantics Other alternateSelectedControlColor)] + pub unsafe fn alternateSelectedControlColor() -> Id; + + #[method_id(@__retain_semantics Other controlAlternatingRowBackgroundColors)] + pub unsafe fn controlAlternatingRowBackgroundColors() -> Id, Shared>; + + #[method_id(@__retain_semantics Other colorSpaceName)] + pub unsafe fn colorSpaceName(&self) -> Id; + + #[method_id(@__retain_semantics Other colorUsingColorSpaceName:device:)] + pub unsafe fn colorUsingColorSpaceName_device( + &self, + name: Option<&NSColorSpaceName>, + deviceDescription: Option<&NSDictionary>, + ) -> Option>; + + #[method_id(@__retain_semantics Other colorUsingColorSpaceName:)] + pub unsafe fn colorUsingColorSpaceName( + &self, + name: &NSColorSpaceName, + ) -> Option>; + } +); + +extern_methods!( + /// NSQuartzCoreAdditions + unsafe impl NSColor {} +); + +extern_methods!( + /// NSAppKitColorExtensions + unsafe impl NSCoder { + #[method_id(@__retain_semantics Other decodeNXColor)] + pub unsafe fn decodeNXColor(&self) -> Option>; + } +); + +extern_static!(NSSystemColorsDidChangeNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/AppKit/NSColorList.rs b/crates/icrate/src/generated/AppKit/NSColorList.rs new file mode 100644 index 000000000..69950dfd0 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSColorList.rs @@ -0,0 +1,82 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSColorListName = NSString; + +pub type NSColorName = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSColorList; + + unsafe impl ClassType for NSColorList { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSColorList { + #[method_id(@__retain_semantics Other availableColorLists)] + pub unsafe fn availableColorLists() -> Id, Shared>; + + #[method_id(@__retain_semantics Other colorListNamed:)] + pub unsafe fn colorListNamed(name: &NSColorListName) -> Option>; + + #[method_id(@__retain_semantics Init initWithName:)] + pub unsafe fn initWithName( + this: Option>, + name: &NSColorListName, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithName:fromFile:)] + pub unsafe fn initWithName_fromFile( + this: Option>, + name: &NSColorListName, + path: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setColor:forKey:)] + pub unsafe fn setColor_forKey(&self, color: &NSColor, key: &NSColorName); + + #[method(insertColor:key:atIndex:)] + pub unsafe fn insertColor_key_atIndex( + &self, + color: &NSColor, + key: &NSColorName, + loc: NSUInteger, + ); + + #[method(removeColorWithKey:)] + pub unsafe fn removeColorWithKey(&self, key: &NSColorName); + + #[method_id(@__retain_semantics Other colorWithKey:)] + pub unsafe fn colorWithKey(&self, key: &NSColorName) -> Option>; + + #[method_id(@__retain_semantics Other allKeys)] + pub unsafe fn allKeys(&self) -> Id, Shared>; + + #[method(isEditable)] + pub unsafe fn isEditable(&self) -> bool; + + #[method(writeToURL:error:)] + pub unsafe fn writeToURL_error( + &self, + url: Option<&NSURL>, + ) -> Result<(), Id>; + + #[method(writeToFile:)] + pub unsafe fn writeToFile(&self, path: Option<&NSString>) -> bool; + + #[method(removeFile)] + pub unsafe fn removeFile(&self); + } +); + +extern_static!(NSColorListDidChangeNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/AppKit/NSColorPanel.rs b/crates/icrate/src/generated/AppKit/NSColorPanel.rs new file mode 100644 index 000000000..4b1419986 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSColorPanel.rs @@ -0,0 +1,158 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSColorPanelMode { + NSColorPanelModeNone = -1, + NSColorPanelModeGray = 0, + NSColorPanelModeRGB = 1, + NSColorPanelModeCMYK = 2, + NSColorPanelModeHSB = 3, + NSColorPanelModeCustomPalette = 4, + NSColorPanelModeColorList = 5, + NSColorPanelModeWheel = 6, + NSColorPanelModeCrayon = 7, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSColorPanelOptions { + NSColorPanelGrayModeMask = 0x00000001, + NSColorPanelRGBModeMask = 0x00000002, + NSColorPanelCMYKModeMask = 0x00000004, + NSColorPanelHSBModeMask = 0x00000008, + NSColorPanelCustomPaletteModeMask = 0x00000010, + NSColorPanelColorListModeMask = 0x00000020, + NSColorPanelWheelModeMask = 0x00000040, + NSColorPanelCrayonModeMask = 0x00000080, + NSColorPanelAllModesMask = 0x0000ffff, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSColorPanel; + + unsafe impl ClassType for NSColorPanel { + type Super = NSPanel; + } +); + +extern_methods!( + unsafe impl NSColorPanel { + #[method_id(@__retain_semantics Other sharedColorPanel)] + pub unsafe fn sharedColorPanel() -> Id; + + #[method(sharedColorPanelExists)] + pub unsafe fn sharedColorPanelExists() -> bool; + + #[method(dragColor:withEvent:fromView:)] + pub unsafe fn dragColor_withEvent_fromView( + color: &NSColor, + event: &NSEvent, + sourceView: &NSView, + ) -> bool; + + #[method(setPickerMask:)] + pub unsafe fn setPickerMask(mask: NSColorPanelOptions); + + #[method(setPickerMode:)] + pub unsafe fn setPickerMode(mode: NSColorPanelMode); + + #[method_id(@__retain_semantics Other accessoryView)] + pub unsafe fn accessoryView(&self) -> Option>; + + #[method(setAccessoryView:)] + pub unsafe fn setAccessoryView(&self, accessoryView: Option<&NSView>); + + #[method(isContinuous)] + pub unsafe fn isContinuous(&self) -> bool; + + #[method(setContinuous:)] + pub unsafe fn setContinuous(&self, continuous: bool); + + #[method(showsAlpha)] + pub unsafe fn showsAlpha(&self) -> bool; + + #[method(setShowsAlpha:)] + pub unsafe fn setShowsAlpha(&self, showsAlpha: bool); + + #[method(mode)] + pub unsafe fn mode(&self) -> NSColorPanelMode; + + #[method(setMode:)] + pub unsafe fn setMode(&self, mode: NSColorPanelMode); + + #[method_id(@__retain_semantics Other color)] + pub unsafe fn color(&self) -> Id; + + #[method(setColor:)] + pub unsafe fn setColor(&self, color: &NSColor); + + #[method(alpha)] + pub unsafe fn alpha(&self) -> CGFloat; + + #[method(setAction:)] + pub unsafe fn setAction(&self, selector: OptionSel); + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(attachColorList:)] + pub unsafe fn attachColorList(&self, colorList: &NSColorList); + + #[method(detachColorList:)] + pub unsafe fn detachColorList(&self, colorList: &NSColorList); + } +); + +extern_methods!( + /// NSColorPanel + unsafe impl NSApplication { + #[method(orderFrontColorPanel:)] + pub unsafe fn orderFrontColorPanel(&self, sender: Option<&Object>); + } +); + +extern_protocol!( + pub struct NSColorChanging; + + unsafe impl NSColorChanging { + #[method(changeColor:)] + pub unsafe fn changeColor(&self, sender: Option<&NSColorPanel>); + } +); + +extern_methods!( + /// NSColorPanelResponderMethod + unsafe impl NSObject { + #[method(changeColor:)] + pub unsafe fn changeColor(&self, sender: Option<&Object>); + } +); + +extern_static!(NSColorPanelColorDidChangeNotification: &'static NSNotificationName); + +extern_static!(NSNoModeColorPanel: NSColorPanelMode = NSColorPanelModeNone); + +extern_static!(NSGrayModeColorPanel: NSColorPanelMode = NSColorPanelModeGray); + +extern_static!(NSRGBModeColorPanel: NSColorPanelMode = NSColorPanelModeRGB); + +extern_static!(NSCMYKModeColorPanel: NSColorPanelMode = NSColorPanelModeCMYK); + +extern_static!(NSHSBModeColorPanel: NSColorPanelMode = NSColorPanelModeHSB); + +extern_static!(NSCustomPaletteModeColorPanel: NSColorPanelMode = NSColorPanelModeCustomPalette); + +extern_static!(NSColorListModeColorPanel: NSColorPanelMode = NSColorPanelModeColorList); + +extern_static!(NSWheelModeColorPanel: NSColorPanelMode = NSColorPanelModeWheel); + +extern_static!(NSCrayonModeColorPanel: NSColorPanelMode = NSColorPanelModeCrayon); diff --git a/crates/icrate/src/generated/AppKit/NSColorPicker.rs b/crates/icrate/src/generated/AppKit/NSColorPicker.rs new file mode 100644 index 000000000..0264bbe23 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSColorPicker.rs @@ -0,0 +1,57 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSColorPicker; + + unsafe impl ClassType for NSColorPicker { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSColorPicker { + #[method_id(@__retain_semantics Init initWithPickerMask:colorPanel:)] + pub unsafe fn initWithPickerMask_colorPanel( + this: Option>, + mask: NSUInteger, + owningColorPanel: &NSColorPanel, + ) -> Option>; + + #[method_id(@__retain_semantics Other colorPanel)] + pub unsafe fn colorPanel(&self) -> Id; + + #[method_id(@__retain_semantics Other provideNewButtonImage)] + pub unsafe fn provideNewButtonImage(&self) -> Id; + + #[method(insertNewButtonImage:in:)] + pub unsafe fn insertNewButtonImage_in( + &self, + newButtonImage: &NSImage, + buttonCell: &NSButtonCell, + ); + + #[method(viewSizeChanged:)] + pub unsafe fn viewSizeChanged(&self, sender: Option<&Object>); + + #[method(attachColorList:)] + pub unsafe fn attachColorList(&self, colorList: &NSColorList); + + #[method(detachColorList:)] + pub unsafe fn detachColorList(&self, colorList: &NSColorList); + + #[method(setMode:)] + pub unsafe fn setMode(&self, mode: NSColorPanelMode); + + #[method_id(@__retain_semantics Other buttonToolTip)] + pub unsafe fn buttonToolTip(&self) -> Id; + + #[method(minContentSize)] + pub unsafe fn minContentSize(&self) -> NSSize; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSColorPickerTouchBarItem.rs b/crates/icrate/src/generated/AppKit/NSColorPickerTouchBarItem.rs new file mode 100644 index 000000000..fdb1e7ef5 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSColorPickerTouchBarItem.rs @@ -0,0 +1,91 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSColorPickerTouchBarItem; + + unsafe impl ClassType for NSColorPickerTouchBarItem { + type Super = NSTouchBarItem; + } +); + +extern_methods!( + unsafe impl NSColorPickerTouchBarItem { + #[method_id(@__retain_semantics Other colorPickerWithIdentifier:)] + pub unsafe fn colorPickerWithIdentifier( + identifier: &NSTouchBarItemIdentifier, + ) -> Id; + + #[method_id(@__retain_semantics Other textColorPickerWithIdentifier:)] + pub unsafe fn textColorPickerWithIdentifier( + identifier: &NSTouchBarItemIdentifier, + ) -> Id; + + #[method_id(@__retain_semantics Other strokeColorPickerWithIdentifier:)] + pub unsafe fn strokeColorPickerWithIdentifier( + identifier: &NSTouchBarItemIdentifier, + ) -> Id; + + #[method_id(@__retain_semantics Other colorPickerWithIdentifier:buttonImage:)] + pub unsafe fn colorPickerWithIdentifier_buttonImage( + identifier: &NSTouchBarItemIdentifier, + image: &NSImage, + ) -> Id; + + #[method_id(@__retain_semantics Other color)] + pub unsafe fn color(&self) -> Id; + + #[method(setColor:)] + pub unsafe fn setColor(&self, color: &NSColor); + + #[method(showsAlpha)] + pub unsafe fn showsAlpha(&self) -> bool; + + #[method(setShowsAlpha:)] + pub unsafe fn setShowsAlpha(&self, showsAlpha: bool); + + #[method_id(@__retain_semantics Other allowedColorSpaces)] + pub unsafe fn allowedColorSpaces(&self) -> Option, Shared>>; + + #[method(setAllowedColorSpaces:)] + pub unsafe fn setAllowedColorSpaces( + &self, + allowedColorSpaces: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other colorList)] + pub unsafe fn colorList(&self) -> Option>; + + #[method(setColorList:)] + pub unsafe fn setColorList(&self, colorList: Option<&NSColorList>); + + #[method_id(@__retain_semantics Other customizationLabel)] + pub unsafe fn customizationLabel(&self) -> Id; + + #[method(setCustomizationLabel:)] + pub unsafe fn setCustomizationLabel(&self, customizationLabel: Option<&NSString>); + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: OptionSel); + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSColorPicking.rs b/crates/icrate/src/generated/AppKit/NSColorPicking.rs new file mode 100644 index 000000000..6aaf4aba7 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSColorPicking.rs @@ -0,0 +1,68 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSColorPickingDefault; + + unsafe impl NSColorPickingDefault { + #[method_id(@__retain_semantics Init initWithPickerMask:colorPanel:)] + pub unsafe fn initWithPickerMask_colorPanel( + this: Option>, + mask: NSUInteger, + owningColorPanel: &NSColorPanel, + ) -> Option>; + + #[method_id(@__retain_semantics Other provideNewButtonImage)] + pub unsafe fn provideNewButtonImage(&self) -> Id; + + #[method(insertNewButtonImage:in:)] + pub unsafe fn insertNewButtonImage_in( + &self, + newButtonImage: &NSImage, + buttonCell: &NSButtonCell, + ); + + #[method(viewSizeChanged:)] + pub unsafe fn viewSizeChanged(&self, sender: Option<&Object>); + + #[method(alphaControlAddedOrRemoved:)] + pub unsafe fn alphaControlAddedOrRemoved(&self, sender: Option<&Object>); + + #[method(attachColorList:)] + pub unsafe fn attachColorList(&self, colorList: &NSColorList); + + #[method(detachColorList:)] + pub unsafe fn detachColorList(&self, colorList: &NSColorList); + + #[method(setMode:)] + pub unsafe fn setMode(&self, mode: NSColorPanelMode); + + #[method_id(@__retain_semantics Other buttonToolTip)] + pub unsafe fn buttonToolTip(&self) -> Id; + + #[method(minContentSize)] + pub unsafe fn minContentSize(&self) -> NSSize; + } +); + +extern_protocol!( + pub struct NSColorPickingCustom; + + unsafe impl NSColorPickingCustom { + #[method(supportsMode:)] + pub unsafe fn supportsMode(&self, mode: NSColorPanelMode) -> bool; + + #[method(currentMode)] + pub unsafe fn currentMode(&self) -> NSColorPanelMode; + + #[method_id(@__retain_semantics Other provideNewView:)] + pub unsafe fn provideNewView(&self, initialRequest: bool) -> Id; + + #[method(setColor:)] + pub unsafe fn setColor(&self, newColor: &NSColor); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSColorSampler.rs b/crates/icrate/src/generated/AppKit/NSColorSampler.rs new file mode 100644 index 000000000..b3b8fb337 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSColorSampler.rs @@ -0,0 +1,25 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSColorSampler; + + unsafe impl ClassType for NSColorSampler { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSColorSampler { + #[method(showSamplerWithSelectionHandler:)] + pub unsafe fn showSamplerWithSelectionHandler( + &self, + selectionHandler: &Block<(*mut NSColor,), ()>, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSColorSpace.rs b/crates/icrate/src/generated/AppKit/NSColorSpace.rs new file mode 100644 index 000000000..9b481e5ee --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSColorSpace.rs @@ -0,0 +1,117 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSColorSpaceModel { + NSColorSpaceModelUnknown = -1, + NSColorSpaceModelGray = 0, + NSColorSpaceModelRGB = 1, + NSColorSpaceModelCMYK = 2, + NSColorSpaceModelLAB = 3, + NSColorSpaceModelDeviceN = 4, + NSColorSpaceModelIndexed = 5, + NSColorSpaceModelPatterned = 6, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSColorSpace; + + unsafe impl ClassType for NSColorSpace { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSColorSpace { + #[method_id(@__retain_semantics Init initWithICCProfileData:)] + pub unsafe fn initWithICCProfileData( + this: Option>, + iccData: &NSData, + ) -> Option>; + + #[method_id(@__retain_semantics Other ICCProfileData)] + pub unsafe fn ICCProfileData(&self) -> Option>; + + #[method_id(@__retain_semantics Init initWithColorSyncProfile:)] + pub unsafe fn initWithColorSyncProfile( + this: Option>, + prof: NonNull, + ) -> Option>; + + #[method(colorSyncProfile)] + pub unsafe fn colorSyncProfile(&self) -> *mut c_void; + + #[method(numberOfColorComponents)] + pub unsafe fn numberOfColorComponents(&self) -> NSInteger; + + #[method(colorSpaceModel)] + pub unsafe fn colorSpaceModel(&self) -> NSColorSpaceModel; + + #[method_id(@__retain_semantics Other localizedName)] + pub unsafe fn localizedName(&self) -> Option>; + + #[method_id(@__retain_semantics Other sRGBColorSpace)] + pub unsafe fn sRGBColorSpace() -> Id; + + #[method_id(@__retain_semantics Other genericGamma22GrayColorSpace)] + pub unsafe fn genericGamma22GrayColorSpace() -> Id; + + #[method_id(@__retain_semantics Other extendedSRGBColorSpace)] + pub unsafe fn extendedSRGBColorSpace() -> Id; + + #[method_id(@__retain_semantics Other extendedGenericGamma22GrayColorSpace)] + pub unsafe fn extendedGenericGamma22GrayColorSpace() -> Id; + + #[method_id(@__retain_semantics Other displayP3ColorSpace)] + pub unsafe fn displayP3ColorSpace() -> Id; + + #[method_id(@__retain_semantics Other adobeRGB1998ColorSpace)] + pub unsafe fn adobeRGB1998ColorSpace() -> Id; + + #[method_id(@__retain_semantics Other genericRGBColorSpace)] + pub unsafe fn genericRGBColorSpace() -> Id; + + #[method_id(@__retain_semantics Other genericGrayColorSpace)] + pub unsafe fn genericGrayColorSpace() -> Id; + + #[method_id(@__retain_semantics Other genericCMYKColorSpace)] + pub unsafe fn genericCMYKColorSpace() -> Id; + + #[method_id(@__retain_semantics Other deviceRGBColorSpace)] + pub unsafe fn deviceRGBColorSpace() -> Id; + + #[method_id(@__retain_semantics Other deviceGrayColorSpace)] + pub unsafe fn deviceGrayColorSpace() -> Id; + + #[method_id(@__retain_semantics Other deviceCMYKColorSpace)] + pub unsafe fn deviceCMYKColorSpace() -> Id; + + #[method_id(@__retain_semantics Other availableColorSpacesWithModel:)] + pub unsafe fn availableColorSpacesWithModel( + model: NSColorSpaceModel, + ) -> Id, Shared>; + } +); + +extern_static!(NSUnknownColorSpaceModel: NSColorSpaceModel = NSColorSpaceModelUnknown); + +extern_static!(NSGrayColorSpaceModel: NSColorSpaceModel = NSColorSpaceModelGray); + +extern_static!(NSRGBColorSpaceModel: NSColorSpaceModel = NSColorSpaceModelRGB); + +extern_static!(NSCMYKColorSpaceModel: NSColorSpaceModel = NSColorSpaceModelCMYK); + +extern_static!(NSLABColorSpaceModel: NSColorSpaceModel = NSColorSpaceModelLAB); + +extern_static!(NSDeviceNColorSpaceModel: NSColorSpaceModel = NSColorSpaceModelDeviceN); + +extern_static!(NSIndexedColorSpaceModel: NSColorSpaceModel = NSColorSpaceModelIndexed); + +extern_static!(NSPatternColorSpaceModel: NSColorSpaceModel = NSColorSpaceModelPatterned); diff --git a/crates/icrate/src/generated/AppKit/NSColorWell.rs b/crates/icrate/src/generated/AppKit/NSColorWell.rs new file mode 100644 index 000000000..8a7dd47cd --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSColorWell.rs @@ -0,0 +1,46 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSColorWell; + + unsafe impl ClassType for NSColorWell { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSColorWell { + #[method(deactivate)] + pub unsafe fn deactivate(&self); + + #[method(activate:)] + pub unsafe fn activate(&self, exclusive: bool); + + #[method(isActive)] + pub unsafe fn isActive(&self) -> bool; + + #[method(drawWellInside:)] + pub unsafe fn drawWellInside(&self, insideRect: NSRect); + + #[method(isBordered)] + pub unsafe fn isBordered(&self) -> bool; + + #[method(setBordered:)] + pub unsafe fn setBordered(&self, bordered: bool); + + #[method(takeColorFrom:)] + pub unsafe fn takeColorFrom(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other color)] + pub unsafe fn color(&self) -> Id; + + #[method(setColor:)] + pub unsafe fn setColor(&self, color: &NSColor); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSComboBox.rs b/crates/icrate/src/generated/AppKit/NSComboBox.rs new file mode 100644 index 000000000..966416496 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSComboBox.rs @@ -0,0 +1,194 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSComboBoxWillPopUpNotification: &'static NSNotificationName); + +extern_static!(NSComboBoxWillDismissNotification: &'static NSNotificationName); + +extern_static!(NSComboBoxSelectionDidChangeNotification: &'static NSNotificationName); + +extern_static!(NSComboBoxSelectionIsChangingNotification: &'static NSNotificationName); + +extern_protocol!( + pub struct NSComboBoxDataSource; + + unsafe impl NSComboBoxDataSource { + #[optional] + #[method(numberOfItemsInComboBox:)] + pub unsafe fn numberOfItemsInComboBox(&self, comboBox: &NSComboBox) -> NSInteger; + + #[optional] + #[method_id(@__retain_semantics Other comboBox:objectValueForItemAtIndex:)] + pub unsafe fn comboBox_objectValueForItemAtIndex( + &self, + comboBox: &NSComboBox, + index: NSInteger, + ) -> Option>; + + #[optional] + #[method(comboBox:indexOfItemWithStringValue:)] + pub unsafe fn comboBox_indexOfItemWithStringValue( + &self, + comboBox: &NSComboBox, + string: &NSString, + ) -> NSUInteger; + + #[optional] + #[method_id(@__retain_semantics Other comboBox:completedString:)] + pub unsafe fn comboBox_completedString( + &self, + comboBox: &NSComboBox, + string: &NSString, + ) -> Option>; + } +); + +extern_protocol!( + pub struct NSComboBoxDelegate; + + unsafe impl NSComboBoxDelegate { + #[optional] + #[method(comboBoxWillPopUp:)] + pub unsafe fn comboBoxWillPopUp(&self, notification: &NSNotification); + + #[optional] + #[method(comboBoxWillDismiss:)] + pub unsafe fn comboBoxWillDismiss(&self, notification: &NSNotification); + + #[optional] + #[method(comboBoxSelectionDidChange:)] + pub unsafe fn comboBoxSelectionDidChange(&self, notification: &NSNotification); + + #[optional] + #[method(comboBoxSelectionIsChanging:)] + pub unsafe fn comboBoxSelectionIsChanging(&self, notification: &NSNotification); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSComboBox; + + unsafe impl ClassType for NSComboBox { + type Super = NSTextField; + } +); + +extern_methods!( + unsafe impl NSComboBox { + #[method(hasVerticalScroller)] + pub unsafe fn hasVerticalScroller(&self) -> bool; + + #[method(setHasVerticalScroller:)] + pub unsafe fn setHasVerticalScroller(&self, hasVerticalScroller: bool); + + #[method(intercellSpacing)] + pub unsafe fn intercellSpacing(&self) -> NSSize; + + #[method(setIntercellSpacing:)] + pub unsafe fn setIntercellSpacing(&self, intercellSpacing: NSSize); + + #[method(itemHeight)] + pub unsafe fn itemHeight(&self) -> CGFloat; + + #[method(setItemHeight:)] + pub unsafe fn setItemHeight(&self, itemHeight: CGFloat); + + #[method(numberOfVisibleItems)] + pub unsafe fn numberOfVisibleItems(&self) -> NSInteger; + + #[method(setNumberOfVisibleItems:)] + pub unsafe fn setNumberOfVisibleItems(&self, numberOfVisibleItems: NSInteger); + + #[method(isButtonBordered)] + pub unsafe fn isButtonBordered(&self) -> bool; + + #[method(setButtonBordered:)] + pub unsafe fn setButtonBordered(&self, buttonBordered: bool); + + #[method(reloadData)] + pub unsafe fn reloadData(&self); + + #[method(noteNumberOfItemsChanged)] + pub unsafe fn noteNumberOfItemsChanged(&self); + + #[method(usesDataSource)] + pub unsafe fn usesDataSource(&self) -> bool; + + #[method(setUsesDataSource:)] + pub unsafe fn setUsesDataSource(&self, usesDataSource: bool); + + #[method(scrollItemAtIndexToTop:)] + pub unsafe fn scrollItemAtIndexToTop(&self, index: NSInteger); + + #[method(scrollItemAtIndexToVisible:)] + pub unsafe fn scrollItemAtIndexToVisible(&self, index: NSInteger); + + #[method(selectItemAtIndex:)] + pub unsafe fn selectItemAtIndex(&self, index: NSInteger); + + #[method(deselectItemAtIndex:)] + pub unsafe fn deselectItemAtIndex(&self, index: NSInteger); + + #[method(indexOfSelectedItem)] + pub unsafe fn indexOfSelectedItem(&self) -> NSInteger; + + #[method(numberOfItems)] + pub unsafe fn numberOfItems(&self) -> NSInteger; + + #[method(completes)] + pub unsafe fn completes(&self) -> bool; + + #[method(setCompletes:)] + pub unsafe fn setCompletes(&self, completes: bool); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSComboBoxDelegate>); + + #[method_id(@__retain_semantics Other dataSource)] + pub unsafe fn dataSource(&self) -> Option>; + + #[method(setDataSource:)] + pub unsafe fn setDataSource(&self, dataSource: Option<&NSComboBoxDataSource>); + + #[method(addItemWithObjectValue:)] + pub unsafe fn addItemWithObjectValue(&self, object: &Object); + + #[method(addItemsWithObjectValues:)] + pub unsafe fn addItemsWithObjectValues(&self, objects: &NSArray); + + #[method(insertItemWithObjectValue:atIndex:)] + pub unsafe fn insertItemWithObjectValue_atIndex(&self, object: &Object, index: NSInteger); + + #[method(removeItemWithObjectValue:)] + pub unsafe fn removeItemWithObjectValue(&self, object: &Object); + + #[method(removeItemAtIndex:)] + pub unsafe fn removeItemAtIndex(&self, index: NSInteger); + + #[method(removeAllItems)] + pub unsafe fn removeAllItems(&self); + + #[method(selectItemWithObjectValue:)] + pub unsafe fn selectItemWithObjectValue(&self, object: Option<&Object>); + + #[method_id(@__retain_semantics Other itemObjectValueAtIndex:)] + pub unsafe fn itemObjectValueAtIndex(&self, index: NSInteger) -> Id; + + #[method_id(@__retain_semantics Other objectValueOfSelectedItem)] + pub unsafe fn objectValueOfSelectedItem(&self) -> Option>; + + #[method(indexOfItemWithObjectValue:)] + pub unsafe fn indexOfItemWithObjectValue(&self, object: &Object) -> NSInteger; + + #[method_id(@__retain_semantics Other objectValues)] + pub unsafe fn objectValues(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSComboBoxCell.rs b/crates/icrate/src/generated/AppKit/NSComboBoxCell.rs new file mode 100644 index 000000000..3c203cf36 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSComboBoxCell.rs @@ -0,0 +1,164 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSComboBoxCell; + + unsafe impl ClassType for NSComboBoxCell { + type Super = NSTextFieldCell; + } +); + +extern_methods!( + unsafe impl NSComboBoxCell { + #[method(hasVerticalScroller)] + pub unsafe fn hasVerticalScroller(&self) -> bool; + + #[method(setHasVerticalScroller:)] + pub unsafe fn setHasVerticalScroller(&self, hasVerticalScroller: bool); + + #[method(intercellSpacing)] + pub unsafe fn intercellSpacing(&self) -> NSSize; + + #[method(setIntercellSpacing:)] + pub unsafe fn setIntercellSpacing(&self, intercellSpacing: NSSize); + + #[method(itemHeight)] + pub unsafe fn itemHeight(&self) -> CGFloat; + + #[method(setItemHeight:)] + pub unsafe fn setItemHeight(&self, itemHeight: CGFloat); + + #[method(numberOfVisibleItems)] + pub unsafe fn numberOfVisibleItems(&self) -> NSInteger; + + #[method(setNumberOfVisibleItems:)] + pub unsafe fn setNumberOfVisibleItems(&self, numberOfVisibleItems: NSInteger); + + #[method(isButtonBordered)] + pub unsafe fn isButtonBordered(&self) -> bool; + + #[method(setButtonBordered:)] + pub unsafe fn setButtonBordered(&self, buttonBordered: bool); + + #[method(reloadData)] + pub unsafe fn reloadData(&self); + + #[method(noteNumberOfItemsChanged)] + pub unsafe fn noteNumberOfItemsChanged(&self); + + #[method(usesDataSource)] + pub unsafe fn usesDataSource(&self) -> bool; + + #[method(setUsesDataSource:)] + pub unsafe fn setUsesDataSource(&self, usesDataSource: bool); + + #[method(scrollItemAtIndexToTop:)] + pub unsafe fn scrollItemAtIndexToTop(&self, index: NSInteger); + + #[method(scrollItemAtIndexToVisible:)] + pub unsafe fn scrollItemAtIndexToVisible(&self, index: NSInteger); + + #[method(selectItemAtIndex:)] + pub unsafe fn selectItemAtIndex(&self, index: NSInteger); + + #[method(deselectItemAtIndex:)] + pub unsafe fn deselectItemAtIndex(&self, index: NSInteger); + + #[method(indexOfSelectedItem)] + pub unsafe fn indexOfSelectedItem(&self) -> NSInteger; + + #[method(numberOfItems)] + pub unsafe fn numberOfItems(&self) -> NSInteger; + + #[method(completes)] + pub unsafe fn completes(&self) -> bool; + + #[method(setCompletes:)] + pub unsafe fn setCompletes(&self, completes: bool); + + #[method_id(@__retain_semantics Other completedString:)] + pub unsafe fn completedString(&self, string: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other dataSource)] + pub unsafe fn dataSource(&self) -> Option>; + + #[method(setDataSource:)] + pub unsafe fn setDataSource(&self, dataSource: Option<&NSComboBoxCellDataSource>); + + #[method(addItemWithObjectValue:)] + pub unsafe fn addItemWithObjectValue(&self, object: &Object); + + #[method(addItemsWithObjectValues:)] + pub unsafe fn addItemsWithObjectValues(&self, objects: &NSArray); + + #[method(insertItemWithObjectValue:atIndex:)] + pub unsafe fn insertItemWithObjectValue_atIndex(&self, object: &Object, index: NSInteger); + + #[method(removeItemWithObjectValue:)] + pub unsafe fn removeItemWithObjectValue(&self, object: &Object); + + #[method(removeItemAtIndex:)] + pub unsafe fn removeItemAtIndex(&self, index: NSInteger); + + #[method(removeAllItems)] + pub unsafe fn removeAllItems(&self); + + #[method(selectItemWithObjectValue:)] + pub unsafe fn selectItemWithObjectValue(&self, object: Option<&Object>); + + #[method_id(@__retain_semantics Other itemObjectValueAtIndex:)] + pub unsafe fn itemObjectValueAtIndex(&self, index: NSInteger) -> Id; + + #[method_id(@__retain_semantics Other objectValueOfSelectedItem)] + pub unsafe fn objectValueOfSelectedItem(&self) -> Option>; + + #[method(indexOfItemWithObjectValue:)] + pub unsafe fn indexOfItemWithObjectValue(&self, object: &Object) -> NSInteger; + + #[method_id(@__retain_semantics Other objectValues)] + pub unsafe fn objectValues(&self) -> Id; + } +); + +extern_protocol!( + pub struct NSComboBoxCellDataSource; + + unsafe impl NSComboBoxCellDataSource { + #[optional] + #[method(numberOfItemsInComboBoxCell:)] + pub unsafe fn numberOfItemsInComboBoxCell( + &self, + comboBoxCell: &NSComboBoxCell, + ) -> NSInteger; + + #[optional] + #[method_id(@__retain_semantics Other comboBoxCell:objectValueForItemAtIndex:)] + pub unsafe fn comboBoxCell_objectValueForItemAtIndex( + &self, + comboBoxCell: &NSComboBoxCell, + index: NSInteger, + ) -> Id; + + #[optional] + #[method(comboBoxCell:indexOfItemWithStringValue:)] + pub unsafe fn comboBoxCell_indexOfItemWithStringValue( + &self, + comboBoxCell: &NSComboBoxCell, + string: &NSString, + ) -> NSUInteger; + + #[optional] + #[method_id(@__retain_semantics Other comboBoxCell:completedString:)] + pub unsafe fn comboBoxCell_completedString( + &self, + comboBoxCell: &NSComboBoxCell, + uncompletedString: &NSString, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSControl.rs b/crates/icrate/src/generated/AppKit/NSControl.rs new file mode 100644 index 000000000..3287b7411 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSControl.rs @@ -0,0 +1,399 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSControl; + + unsafe impl ClassType for NSControl { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSControl { + #[method_id(@__retain_semantics Init initWithFrame:)] + pub unsafe fn initWithFrame( + this: Option>, + frameRect: NSRect, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: OptionSel); + + #[method(tag)] + pub unsafe fn tag(&self) -> NSInteger; + + #[method(setTag:)] + pub unsafe fn setTag(&self, tag: NSInteger); + + #[method(ignoresMultiClick)] + pub unsafe fn ignoresMultiClick(&self) -> bool; + + #[method(setIgnoresMultiClick:)] + pub unsafe fn setIgnoresMultiClick(&self, ignoresMultiClick: bool); + + #[method(isContinuous)] + pub unsafe fn isContinuous(&self) -> bool; + + #[method(setContinuous:)] + pub unsafe fn setContinuous(&self, continuous: bool); + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + + #[method(refusesFirstResponder)] + pub unsafe fn refusesFirstResponder(&self) -> bool; + + #[method(setRefusesFirstResponder:)] + pub unsafe fn setRefusesFirstResponder(&self, refusesFirstResponder: bool); + + #[method(isHighlighted)] + pub unsafe fn isHighlighted(&self) -> bool; + + #[method(setHighlighted:)] + pub unsafe fn setHighlighted(&self, highlighted: bool); + + #[method(controlSize)] + pub unsafe fn controlSize(&self) -> NSControlSize; + + #[method(setControlSize:)] + pub unsafe fn setControlSize(&self, controlSize: NSControlSize); + + #[method_id(@__retain_semantics Other formatter)] + pub unsafe fn formatter(&self) -> Option>; + + #[method(setFormatter:)] + pub unsafe fn setFormatter(&self, formatter: Option<&NSFormatter>); + + #[method_id(@__retain_semantics Other objectValue)] + pub unsafe fn objectValue(&self) -> Option>; + + #[method(setObjectValue:)] + pub unsafe fn setObjectValue(&self, objectValue: Option<&Object>); + + #[method_id(@__retain_semantics Other stringValue)] + pub unsafe fn stringValue(&self) -> Id; + + #[method(setStringValue:)] + pub unsafe fn setStringValue(&self, stringValue: &NSString); + + #[method_id(@__retain_semantics Other attributedStringValue)] + pub unsafe fn attributedStringValue(&self) -> Id; + + #[method(setAttributedStringValue:)] + pub unsafe fn setAttributedStringValue(&self, attributedStringValue: &NSAttributedString); + + #[method(intValue)] + pub unsafe fn intValue(&self) -> c_int; + + #[method(setIntValue:)] + pub unsafe fn setIntValue(&self, intValue: c_int); + + #[method(integerValue)] + pub unsafe fn integerValue(&self) -> NSInteger; + + #[method(setIntegerValue:)] + pub unsafe fn setIntegerValue(&self, integerValue: NSInteger); + + #[method(floatValue)] + pub unsafe fn floatValue(&self) -> c_float; + + #[method(setFloatValue:)] + pub unsafe fn setFloatValue(&self, floatValue: c_float); + + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + + #[method(setDoubleValue:)] + pub unsafe fn setDoubleValue(&self, doubleValue: c_double); + + #[method(sizeThatFits:)] + pub unsafe fn sizeThatFits(&self, size: NSSize) -> NSSize; + + #[method(sizeToFit)] + pub unsafe fn sizeToFit(&self); + + #[method(sendActionOn:)] + pub unsafe fn sendActionOn(&self, mask: NSEventMask) -> NSInteger; + + #[method(sendAction:to:)] + pub unsafe fn sendAction_to(&self, action: OptionSel, target: Option<&Object>) -> bool; + + #[method(takeIntValueFrom:)] + pub unsafe fn takeIntValueFrom(&self, sender: Option<&Object>); + + #[method(takeFloatValueFrom:)] + pub unsafe fn takeFloatValueFrom(&self, sender: Option<&Object>); + + #[method(takeDoubleValueFrom:)] + pub unsafe fn takeDoubleValueFrom(&self, sender: Option<&Object>); + + #[method(takeStringValueFrom:)] + pub unsafe fn takeStringValueFrom(&self, sender: Option<&Object>); + + #[method(takeObjectValueFrom:)] + pub unsafe fn takeObjectValueFrom(&self, sender: Option<&Object>); + + #[method(takeIntegerValueFrom:)] + pub unsafe fn takeIntegerValueFrom(&self, sender: Option<&Object>); + + #[method(mouseDown:)] + pub unsafe fn mouseDown(&self, event: &NSEvent); + + #[method(performClick:)] + pub unsafe fn performClick(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other font)] + pub unsafe fn font(&self) -> Option>; + + #[method(setFont:)] + pub unsafe fn setFont(&self, font: Option<&NSFont>); + + #[method(usesSingleLineMode)] + pub unsafe fn usesSingleLineMode(&self) -> bool; + + #[method(setUsesSingleLineMode:)] + pub unsafe fn setUsesSingleLineMode(&self, usesSingleLineMode: bool); + + #[method(lineBreakMode)] + pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode; + + #[method(setLineBreakMode:)] + pub unsafe fn setLineBreakMode(&self, lineBreakMode: NSLineBreakMode); + + #[method(alignment)] + pub unsafe fn alignment(&self) -> NSTextAlignment; + + #[method(setAlignment:)] + pub unsafe fn setAlignment(&self, alignment: NSTextAlignment); + + #[method(baseWritingDirection)] + pub unsafe fn baseWritingDirection(&self) -> NSWritingDirection; + + #[method(setBaseWritingDirection:)] + pub unsafe fn setBaseWritingDirection(&self, baseWritingDirection: NSWritingDirection); + + #[method(allowsExpansionToolTips)] + pub unsafe fn allowsExpansionToolTips(&self) -> bool; + + #[method(setAllowsExpansionToolTips:)] + pub unsafe fn setAllowsExpansionToolTips(&self, allowsExpansionToolTips: bool); + + #[method(expansionFrameWithFrame:)] + pub unsafe fn expansionFrameWithFrame(&self, contentFrame: NSRect) -> NSRect; + + #[method(drawWithExpansionFrame:inView:)] + pub unsafe fn drawWithExpansionFrame_inView(&self, contentFrame: NSRect, view: &NSView); + } +); + +extern_methods!( + /// NSControlEditableTextMethods + unsafe impl NSControl { + #[method_id(@__retain_semantics Other currentEditor)] + pub unsafe fn currentEditor(&self) -> Option>; + + #[method(abortEditing)] + pub unsafe fn abortEditing(&self) -> bool; + + #[method(validateEditing)] + pub unsafe fn validateEditing(&self); + + #[method(editWithFrame:editor:delegate:event:)] + pub unsafe fn editWithFrame_editor_delegate_event( + &self, + rect: NSRect, + textObj: &NSText, + delegate: Option<&Object>, + event: &NSEvent, + ); + + #[method(selectWithFrame:editor:delegate:start:length:)] + pub unsafe fn selectWithFrame_editor_delegate_start_length( + &self, + rect: NSRect, + textObj: &NSText, + delegate: Option<&Object>, + selStart: NSInteger, + selLength: NSInteger, + ); + + #[method(endEditing:)] + pub unsafe fn endEditing(&self, textObj: &NSText); + } +); + +extern_protocol!( + pub struct NSControlTextEditingDelegate; + + unsafe impl NSControlTextEditingDelegate { + #[optional] + #[method(controlTextDidBeginEditing:)] + pub unsafe fn controlTextDidBeginEditing(&self, obj: &NSNotification); + + #[optional] + #[method(controlTextDidEndEditing:)] + pub unsafe fn controlTextDidEndEditing(&self, obj: &NSNotification); + + #[optional] + #[method(controlTextDidChange:)] + pub unsafe fn controlTextDidChange(&self, obj: &NSNotification); + + #[optional] + #[method(control:textShouldBeginEditing:)] + pub unsafe fn control_textShouldBeginEditing( + &self, + control: &NSControl, + fieldEditor: &NSText, + ) -> bool; + + #[optional] + #[method(control:textShouldEndEditing:)] + pub unsafe fn control_textShouldEndEditing( + &self, + control: &NSControl, + fieldEditor: &NSText, + ) -> bool; + + #[optional] + #[method(control:didFailToFormatString:errorDescription:)] + pub unsafe fn control_didFailToFormatString_errorDescription( + &self, + control: &NSControl, + string: &NSString, + error: Option<&NSString>, + ) -> bool; + + #[optional] + #[method(control:didFailToValidatePartialString:errorDescription:)] + pub unsafe fn control_didFailToValidatePartialString_errorDescription( + &self, + control: &NSControl, + string: &NSString, + error: Option<&NSString>, + ); + + #[optional] + #[method(control:isValidObject:)] + pub unsafe fn control_isValidObject( + &self, + control: &NSControl, + obj: Option<&Object>, + ) -> bool; + + #[optional] + #[method(control:textView:doCommandBySelector:)] + pub unsafe fn control_textView_doCommandBySelector( + &self, + control: &NSControl, + textView: &NSTextView, + commandSelector: Sel, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other control:textView:completions:forPartialWordRange:indexOfSelectedItem:)] + pub unsafe fn control_textView_completions_forPartialWordRange_indexOfSelectedItem( + &self, + control: &NSControl, + textView: &NSTextView, + words: &NSArray, + charRange: NSRange, + index: NonNull, + ) -> Id, Shared>; + } +); + +extern_static!(NSControlTextDidBeginEditingNotification: &'static NSNotificationName); + +extern_static!(NSControlTextDidEndEditingNotification: &'static NSNotificationName); + +extern_static!(NSControlTextDidChangeNotification: &'static NSNotificationName); + +extern_methods!( + /// NSDeprecated + unsafe impl NSControl { + #[method(setFloatingPointFormat:left:right:)] + pub unsafe fn setFloatingPointFormat_left_right( + &self, + autoRange: bool, + leftDigits: NSUInteger, + rightDigits: NSUInteger, + ); + + #[method(cellClass)] + pub unsafe fn cellClass() -> Option<&'static Class>; + + #[method(setCellClass:)] + pub unsafe fn setCellClass(cellClass: Option<&Class>); + + #[method_id(@__retain_semantics Other cell)] + pub unsafe fn cell(&self) -> Option>; + + #[method(setCell:)] + pub unsafe fn setCell(&self, cell: Option<&NSCell>); + + #[method_id(@__retain_semantics Other selectedCell)] + pub unsafe fn selectedCell(&self) -> Option>; + + #[method(selectedTag)] + pub unsafe fn selectedTag(&self) -> NSInteger; + + #[method(setNeedsDisplay)] + pub unsafe fn setNeedsDisplay(&self); + + #[method(calcSize)] + pub unsafe fn calcSize(&self); + + #[method(updateCell:)] + pub unsafe fn updateCell(&self, cell: &NSCell); + + #[method(updateCellInside:)] + pub unsafe fn updateCellInside(&self, cell: &NSCell); + + #[method(drawCellInside:)] + pub unsafe fn drawCellInside(&self, cell: &NSCell); + + #[method(drawCell:)] + pub unsafe fn drawCell(&self, cell: &NSCell); + + #[method(selectCell:)] + pub unsafe fn selectCell(&self, cell: &NSCell); + } +); + +extern_methods!( + /// NSControlSubclassNotifications + unsafe impl NSObject { + #[method(controlTextDidBeginEditing:)] + pub unsafe fn controlTextDidBeginEditing(&self, obj: &NSNotification); + + #[method(controlTextDidEndEditing:)] + pub unsafe fn controlTextDidEndEditing(&self, obj: &NSNotification); + + #[method(controlTextDidChange:)] + pub unsafe fn controlTextDidChange(&self, obj: &NSNotification); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSController.rs b/crates/icrate/src/generated/AppKit/NSController.rs new file mode 100644 index 000000000..97ba28701 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSController.rs @@ -0,0 +1,51 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSController; + + unsafe impl ClassType for NSController { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSController { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method(objectDidBeginEditing:)] + pub unsafe fn objectDidBeginEditing(&self, editor: &NSEditor); + + #[method(objectDidEndEditing:)] + pub unsafe fn objectDidEndEditing(&self, editor: &NSEditor); + + #[method(discardEditing)] + pub unsafe fn discardEditing(&self); + + #[method(commitEditing)] + pub unsafe fn commitEditing(&self) -> bool; + + #[method(commitEditingWithDelegate:didCommitSelector:contextInfo:)] + pub unsafe fn commitEditingWithDelegate_didCommitSelector_contextInfo( + &self, + delegate: Option<&Object>, + didCommitSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(isEditing)] + pub unsafe fn isEditing(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSCursor.rs b/crates/icrate/src/generated/AppKit/NSCursor.rs new file mode 100644 index 000000000..d86228a42 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCursor.rs @@ -0,0 +1,147 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSCursor; + + unsafe impl ClassType for NSCursor { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCursor { + #[method_id(@__retain_semantics Other currentCursor)] + pub unsafe fn currentCursor() -> Id; + + #[method_id(@__retain_semantics Other currentSystemCursor)] + pub unsafe fn currentSystemCursor() -> Option>; + + #[method_id(@__retain_semantics Other arrowCursor)] + pub unsafe fn arrowCursor() -> Id; + + #[method_id(@__retain_semantics Other IBeamCursor)] + pub unsafe fn IBeamCursor() -> Id; + + #[method_id(@__retain_semantics Other pointingHandCursor)] + pub unsafe fn pointingHandCursor() -> Id; + + #[method_id(@__retain_semantics Other closedHandCursor)] + pub unsafe fn closedHandCursor() -> Id; + + #[method_id(@__retain_semantics Other openHandCursor)] + pub unsafe fn openHandCursor() -> Id; + + #[method_id(@__retain_semantics Other resizeLeftCursor)] + pub unsafe fn resizeLeftCursor() -> Id; + + #[method_id(@__retain_semantics Other resizeRightCursor)] + pub unsafe fn resizeRightCursor() -> Id; + + #[method_id(@__retain_semantics Other resizeLeftRightCursor)] + pub unsafe fn resizeLeftRightCursor() -> Id; + + #[method_id(@__retain_semantics Other resizeUpCursor)] + pub unsafe fn resizeUpCursor() -> Id; + + #[method_id(@__retain_semantics Other resizeDownCursor)] + pub unsafe fn resizeDownCursor() -> Id; + + #[method_id(@__retain_semantics Other resizeUpDownCursor)] + pub unsafe fn resizeUpDownCursor() -> Id; + + #[method_id(@__retain_semantics Other crosshairCursor)] + pub unsafe fn crosshairCursor() -> Id; + + #[method_id(@__retain_semantics Other disappearingItemCursor)] + pub unsafe fn disappearingItemCursor() -> Id; + + #[method_id(@__retain_semantics Other operationNotAllowedCursor)] + pub unsafe fn operationNotAllowedCursor() -> Id; + + #[method_id(@__retain_semantics Other dragLinkCursor)] + pub unsafe fn dragLinkCursor() -> Id; + + #[method_id(@__retain_semantics Other dragCopyCursor)] + pub unsafe fn dragCopyCursor() -> Id; + + #[method_id(@__retain_semantics Other contextualMenuCursor)] + pub unsafe fn contextualMenuCursor() -> Id; + + #[method_id(@__retain_semantics Other IBeamCursorForVerticalLayout)] + pub unsafe fn IBeamCursorForVerticalLayout() -> Id; + + #[method_id(@__retain_semantics Init initWithImage:hotSpot:)] + pub unsafe fn initWithImage_hotSpot( + this: Option>, + newImage: &NSImage, + point: NSPoint, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method(hide)] + pub unsafe fn hide(); + + #[method(unhide)] + pub unsafe fn unhide(); + + #[method(setHiddenUntilMouseMoves:)] + pub unsafe fn setHiddenUntilMouseMoves(flag: bool); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Id; + + #[method(hotSpot)] + pub unsafe fn hotSpot(&self) -> NSPoint; + + #[method(push)] + pub unsafe fn push(&self); + + #[method(set)] + pub unsafe fn set(&self); + } +); + +extern_static!(NSAppKitVersionNumberWithCursorSizeSupport: NSAppKitVersion = 682.0); + +extern_methods!( + /// NSDeprecated + unsafe impl NSCursor { + #[method_id(@__retain_semantics Init initWithImage:foregroundColorHint:backgroundColorHint:hotSpot:)] + pub unsafe fn initWithImage_foregroundColorHint_backgroundColorHint_hotSpot( + this: Option>, + newImage: &NSImage, + fg: Option<&NSColor>, + bg: Option<&NSColor>, + hotSpot: NSPoint, + ) -> Id; + + #[method(setOnMouseExited:)] + pub unsafe fn setOnMouseExited(&self, flag: bool); + + #[method(setOnMouseEntered:)] + pub unsafe fn setOnMouseEntered(&self, flag: bool); + + #[method(isSetOnMouseExited)] + pub unsafe fn isSetOnMouseExited(&self) -> bool; + + #[method(isSetOnMouseEntered)] + pub unsafe fn isSetOnMouseEntered(&self) -> bool; + + #[method(mouseEntered:)] + pub unsafe fn mouseEntered(&self, event: &NSEvent); + + #[method(mouseExited:)] + pub unsafe fn mouseExited(&self, event: &NSEvent); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSCustomImageRep.rs b/crates/icrate/src/generated/AppKit/NSCustomImageRep.rs new file mode 100644 index 000000000..46a458ff3 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCustomImageRep.rs @@ -0,0 +1,43 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSCustomImageRep; + + unsafe impl ClassType for NSCustomImageRep { + type Super = NSImageRep; + } +); + +extern_methods!( + unsafe impl NSCustomImageRep { + #[method_id(@__retain_semantics Init initWithSize:flipped:drawingHandler:)] + pub unsafe fn initWithSize_flipped_drawingHandler( + this: Option>, + size: NSSize, + drawingHandlerShouldBeCalledWithFlippedContext: bool, + drawingHandler: &Block<(NSRect,), Bool>, + ) -> Id; + + #[method(drawingHandler)] + pub unsafe fn drawingHandler(&self) -> *mut Block<(NSRect,), Bool>; + + #[method_id(@__retain_semantics Init initWithDrawSelector:delegate:)] + pub unsafe fn initWithDrawSelector_delegate( + this: Option>, + selector: Sel, + delegate: &Object, + ) -> Id; + + #[method(drawSelector)] + pub unsafe fn drawSelector(&self) -> OptionSel; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSCustomTouchBarItem.rs b/crates/icrate/src/generated/AppKit/NSCustomTouchBarItem.rs new file mode 100644 index 000000000..7253a1b4c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSCustomTouchBarItem.rs @@ -0,0 +1,37 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSCustomTouchBarItem; + + unsafe impl ClassType for NSCustomTouchBarItem { + type Super = NSTouchBarItem; + } +); + +extern_methods!( + unsafe impl NSCustomTouchBarItem { + #[method_id(@__retain_semantics Other view)] + pub unsafe fn view(&self) -> Id; + + #[method(setView:)] + pub unsafe fn setView(&self, view: &NSView); + + #[method_id(@__retain_semantics Other viewController)] + pub unsafe fn viewController(&self) -> Option>; + + #[method(setViewController:)] + pub unsafe fn setViewController(&self, viewController: Option<&NSViewController>); + + #[method_id(@__retain_semantics Other customizationLabel)] + pub unsafe fn customizationLabel(&self) -> Id; + + #[method(setCustomizationLabel:)] + pub unsafe fn setCustomizationLabel(&self, customizationLabel: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSDataAsset.rs b/crates/icrate/src/generated/AppKit/NSDataAsset.rs new file mode 100644 index 000000000..d0dde56b4 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDataAsset.rs @@ -0,0 +1,46 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSDataAssetName = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSDataAsset; + + unsafe impl ClassType for NSDataAsset { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDataAsset { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithName:)] + pub unsafe fn initWithName( + this: Option>, + name: &NSDataAssetName, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithName:bundle:)] + pub unsafe fn initWithName_bundle( + this: Option>, + name: &NSDataAssetName, + bundle: &NSBundle, + ) -> Option>; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other data)] + pub unsafe fn data(&self) -> Id; + + #[method_id(@__retain_semantics Other typeIdentifier)] + pub unsafe fn typeIdentifier(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSDatePicker.rs b/crates/icrate/src/generated/AppKit/NSDatePicker.rs new file mode 100644 index 000000000..4234e4e90 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDatePicker.rs @@ -0,0 +1,121 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSDatePicker; + + unsafe impl ClassType for NSDatePicker { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSDatePicker { + #[method(datePickerStyle)] + pub unsafe fn datePickerStyle(&self) -> NSDatePickerStyle; + + #[method(setDatePickerStyle:)] + pub unsafe fn setDatePickerStyle(&self, datePickerStyle: NSDatePickerStyle); + + #[method(isBezeled)] + pub unsafe fn isBezeled(&self) -> bool; + + #[method(setBezeled:)] + pub unsafe fn setBezeled(&self, bezeled: bool); + + #[method(isBordered)] + pub unsafe fn isBordered(&self) -> bool; + + #[method(setBordered:)] + pub unsafe fn setBordered(&self, bordered: bool); + + #[method(drawsBackground)] + pub unsafe fn drawsBackground(&self) -> bool; + + #[method(setDrawsBackground:)] + pub unsafe fn setDrawsBackground(&self, drawsBackground: bool); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Id; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: &NSColor); + + #[method_id(@__retain_semantics Other textColor)] + pub unsafe fn textColor(&self) -> Id; + + #[method(setTextColor:)] + pub unsafe fn setTextColor(&self, textColor: &NSColor); + + #[method(datePickerMode)] + pub unsafe fn datePickerMode(&self) -> NSDatePickerMode; + + #[method(setDatePickerMode:)] + pub unsafe fn setDatePickerMode(&self, datePickerMode: NSDatePickerMode); + + #[method(datePickerElements)] + pub unsafe fn datePickerElements(&self) -> NSDatePickerElementFlags; + + #[method(setDatePickerElements:)] + pub unsafe fn setDatePickerElements(&self, datePickerElements: NSDatePickerElementFlags); + + #[method_id(@__retain_semantics Other calendar)] + pub unsafe fn calendar(&self) -> Option>; + + #[method(setCalendar:)] + pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>); + + #[method_id(@__retain_semantics Other locale)] + pub unsafe fn locale(&self) -> Option>; + + #[method(setLocale:)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + + #[method_id(@__retain_semantics Other timeZone)] + pub unsafe fn timeZone(&self) -> Option>; + + #[method(setTimeZone:)] + pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>); + + #[method_id(@__retain_semantics Other dateValue)] + pub unsafe fn dateValue(&self) -> Id; + + #[method(setDateValue:)] + pub unsafe fn setDateValue(&self, dateValue: &NSDate); + + #[method(timeInterval)] + pub unsafe fn timeInterval(&self) -> NSTimeInterval; + + #[method(setTimeInterval:)] + pub unsafe fn setTimeInterval(&self, timeInterval: NSTimeInterval); + + #[method_id(@__retain_semantics Other minDate)] + pub unsafe fn minDate(&self) -> Option>; + + #[method(setMinDate:)] + pub unsafe fn setMinDate(&self, minDate: Option<&NSDate>); + + #[method_id(@__retain_semantics Other maxDate)] + pub unsafe fn maxDate(&self) -> Option>; + + #[method(setMaxDate:)] + pub unsafe fn setMaxDate(&self, maxDate: Option<&NSDate>); + + #[method(presentsCalendarOverlay)] + pub unsafe fn presentsCalendarOverlay(&self) -> bool; + + #[method(setPresentsCalendarOverlay:)] + pub unsafe fn setPresentsCalendarOverlay(&self, presentsCalendarOverlay: bool); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSDatePickerCellDelegate>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSDatePickerCell.rs b/crates/icrate/src/generated/AppKit/NSDatePickerCell.rs new file mode 100644 index 000000000..c6fe13b1e --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDatePickerCell.rs @@ -0,0 +1,203 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSDatePickerStyle { + NSDatePickerStyleTextFieldAndStepper = 0, + NSDatePickerStyleClockAndCalendar = 1, + NSDatePickerStyleTextField = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSDatePickerMode { + NSDatePickerModeSingle = 0, + NSDatePickerModeRange = 1, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSDatePickerElementFlags { + NSDatePickerElementFlagHourMinute = 0x000c, + NSDatePickerElementFlagHourMinuteSecond = 0x000e, + NSDatePickerElementFlagTimeZone = 0x0010, + NSDatePickerElementFlagYearMonth = 0x00c0, + NSDatePickerElementFlagYearMonthDay = 0x00e0, + NSDatePickerElementFlagEra = 0x0100, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDatePickerCell; + + unsafe impl ClassType for NSDatePickerCell { + type Super = NSActionCell; + } +); + +extern_methods!( + unsafe impl NSDatePickerCell { + #[method_id(@__retain_semantics Init initTextCell:)] + pub unsafe fn initTextCell( + this: Option>, + string: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Init initImageCell:)] + pub unsafe fn initImageCell( + this: Option>, + image: Option<&NSImage>, + ) -> Id; + + #[method(datePickerStyle)] + pub unsafe fn datePickerStyle(&self) -> NSDatePickerStyle; + + #[method(setDatePickerStyle:)] + pub unsafe fn setDatePickerStyle(&self, datePickerStyle: NSDatePickerStyle); + + #[method(drawsBackground)] + pub unsafe fn drawsBackground(&self) -> bool; + + #[method(setDrawsBackground:)] + pub unsafe fn setDrawsBackground(&self, drawsBackground: bool); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Id; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: &NSColor); + + #[method_id(@__retain_semantics Other textColor)] + pub unsafe fn textColor(&self) -> Id; + + #[method(setTextColor:)] + pub unsafe fn setTextColor(&self, textColor: &NSColor); + + #[method(datePickerMode)] + pub unsafe fn datePickerMode(&self) -> NSDatePickerMode; + + #[method(setDatePickerMode:)] + pub unsafe fn setDatePickerMode(&self, datePickerMode: NSDatePickerMode); + + #[method(datePickerElements)] + pub unsafe fn datePickerElements(&self) -> NSDatePickerElementFlags; + + #[method(setDatePickerElements:)] + pub unsafe fn setDatePickerElements(&self, datePickerElements: NSDatePickerElementFlags); + + #[method_id(@__retain_semantics Other calendar)] + pub unsafe fn calendar(&self) -> Option>; + + #[method(setCalendar:)] + pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>); + + #[method_id(@__retain_semantics Other locale)] + pub unsafe fn locale(&self) -> Option>; + + #[method(setLocale:)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + + #[method_id(@__retain_semantics Other timeZone)] + pub unsafe fn timeZone(&self) -> Option>; + + #[method(setTimeZone:)] + pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>); + + #[method_id(@__retain_semantics Other dateValue)] + pub unsafe fn dateValue(&self) -> Id; + + #[method(setDateValue:)] + pub unsafe fn setDateValue(&self, dateValue: &NSDate); + + #[method(timeInterval)] + pub unsafe fn timeInterval(&self) -> NSTimeInterval; + + #[method(setTimeInterval:)] + pub unsafe fn setTimeInterval(&self, timeInterval: NSTimeInterval); + + #[method_id(@__retain_semantics Other minDate)] + pub unsafe fn minDate(&self) -> Option>; + + #[method(setMinDate:)] + pub unsafe fn setMinDate(&self, minDate: Option<&NSDate>); + + #[method_id(@__retain_semantics Other maxDate)] + pub unsafe fn maxDate(&self) -> Option>; + + #[method(setMaxDate:)] + pub unsafe fn setMaxDate(&self, maxDate: Option<&NSDate>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSDatePickerCellDelegate>); + } +); + +extern_protocol!( + pub struct NSDatePickerCellDelegate; + + unsafe impl NSDatePickerCellDelegate { + #[optional] + #[method(datePickerCell:validateProposedDateValue:timeInterval:)] + pub unsafe fn datePickerCell_validateProposedDateValue_timeInterval( + &self, + datePickerCell: &NSDatePickerCell, + proposedDateValue: NonNull>, + proposedTimeInterval: *mut NSTimeInterval, + ); + } +); + +extern_static!( + NSTextFieldAndStepperDatePickerStyle: NSDatePickerStyle = NSDatePickerStyleTextFieldAndStepper +); + +extern_static!( + NSClockAndCalendarDatePickerStyle: NSDatePickerStyle = NSDatePickerStyleClockAndCalendar +); + +extern_static!(NSTextFieldDatePickerStyle: NSDatePickerStyle = NSDatePickerStyleTextField); + +extern_static!(NSSingleDateMode: NSDatePickerMode = NSDatePickerModeSingle); + +extern_static!(NSRangeDateMode: NSDatePickerMode = NSDatePickerModeRange); + +extern_static!( + NSHourMinuteDatePickerElementFlag: NSDatePickerElementFlags = NSDatePickerElementFlagHourMinute +); + +extern_static!( + NSHourMinuteSecondDatePickerElementFlag: NSDatePickerElementFlags = + NSDatePickerElementFlagHourMinuteSecond +); + +extern_static!( + NSTimeZoneDatePickerElementFlag: NSDatePickerElementFlags = NSDatePickerElementFlagTimeZone +); + +extern_static!( + NSYearMonthDatePickerElementFlag: NSDatePickerElementFlags = NSDatePickerElementFlagYearMonth +); + +extern_static!( + NSYearMonthDayDatePickerElementFlag: NSDatePickerElementFlags = + NSDatePickerElementFlagYearMonthDay +); + +extern_static!(NSEraDatePickerElementFlag: NSDatePickerElementFlags = NSDatePickerElementFlagEra); diff --git a/crates/icrate/src/generated/AppKit/NSDictionaryController.rs b/crates/icrate/src/generated/AppKit/NSDictionaryController.rs new file mode 100644 index 000000000..0b318f397 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDictionaryController.rs @@ -0,0 +1,99 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSDictionaryControllerKeyValuePair; + + unsafe impl ClassType for NSDictionaryControllerKeyValuePair { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDictionaryControllerKeyValuePair { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other key)] + pub unsafe fn key(&self) -> Option>; + + #[method(setKey:)] + pub unsafe fn setKey(&self, key: Option<&NSString>); + + #[method_id(@__retain_semantics Other value)] + pub unsafe fn value(&self) -> Option>; + + #[method(setValue:)] + pub unsafe fn setValue(&self, value: Option<&Object>); + + #[method_id(@__retain_semantics Other localizedKey)] + pub unsafe fn localizedKey(&self) -> Option>; + + #[method(setLocalizedKey:)] + pub unsafe fn setLocalizedKey(&self, localizedKey: Option<&NSString>); + + #[method(isExplicitlyIncluded)] + pub unsafe fn isExplicitlyIncluded(&self) -> bool; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDictionaryController; + + unsafe impl ClassType for NSDictionaryController { + type Super = NSArrayController; + } +); + +extern_methods!( + unsafe impl NSDictionaryController { + #[method_id(@__retain_semantics New newObject)] + pub unsafe fn newObject(&self) -> Id; + + #[method_id(@__retain_semantics Other initialKey)] + pub unsafe fn initialKey(&self) -> Id; + + #[method(setInitialKey:)] + pub unsafe fn setInitialKey(&self, initialKey: &NSString); + + #[method_id(@__retain_semantics Other initialValue)] + pub unsafe fn initialValue(&self) -> Id; + + #[method(setInitialValue:)] + pub unsafe fn setInitialValue(&self, initialValue: &Object); + + #[method_id(@__retain_semantics Other includedKeys)] + pub unsafe fn includedKeys(&self) -> Id, Shared>; + + #[method(setIncludedKeys:)] + pub unsafe fn setIncludedKeys(&self, includedKeys: &NSArray); + + #[method_id(@__retain_semantics Other excludedKeys)] + pub unsafe fn excludedKeys(&self) -> Id, Shared>; + + #[method(setExcludedKeys:)] + pub unsafe fn setExcludedKeys(&self, excludedKeys: &NSArray); + + #[method_id(@__retain_semantics Other localizedKeyDictionary)] + pub unsafe fn localizedKeyDictionary(&self) + -> Id, Shared>; + + #[method(setLocalizedKeyDictionary:)] + pub unsafe fn setLocalizedKeyDictionary( + &self, + localizedKeyDictionary: &NSDictionary, + ); + + #[method_id(@__retain_semantics Other localizedKeyTable)] + pub unsafe fn localizedKeyTable(&self) -> Option>; + + #[method(setLocalizedKeyTable:)] + pub unsafe fn setLocalizedKeyTable(&self, localizedKeyTable: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSDiffableDataSource.rs b/crates/icrate/src/generated/AppKit/NSDiffableDataSource.rs new file mode 100644 index 000000000..58e6d5f48 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDiffableDataSource.rs @@ -0,0 +1,234 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSDiffableDataSourceSnapshot< + SectionIdentifierType: Message = Object, + ItemIdentifierType: Message = Object, + > { + _inner0: PhantomData<*mut SectionIdentifierType>, + _inner1: PhantomData<*mut ItemIdentifierType>, + } + + unsafe impl ClassType + for NSDiffableDataSourceSnapshot + { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl + NSDiffableDataSourceSnapshot + { + #[method(numberOfItems)] + pub unsafe fn numberOfItems(&self) -> NSInteger; + + #[method(numberOfSections)] + pub unsafe fn numberOfSections(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other sectionIdentifiers)] + pub unsafe fn sectionIdentifiers(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other itemIdentifiers)] + pub unsafe fn itemIdentifiers(&self) -> Id, Shared>; + + #[method(numberOfItemsInSection:)] + pub unsafe fn numberOfItemsInSection( + &self, + sectionIdentifier: &SectionIdentifierType, + ) -> NSInteger; + + #[method_id(@__retain_semantics Other itemIdentifiersInSectionWithIdentifier:)] + pub unsafe fn itemIdentifiersInSectionWithIdentifier( + &self, + sectionIdentifier: &SectionIdentifierType, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other sectionIdentifierForSectionContainingItemIdentifier:)] + pub unsafe fn sectionIdentifierForSectionContainingItemIdentifier( + &self, + itemIdentifier: &ItemIdentifierType, + ) -> Option>; + + #[method(indexOfItemIdentifier:)] + pub unsafe fn indexOfItemIdentifier( + &self, + itemIdentifier: &ItemIdentifierType, + ) -> NSInteger; + + #[method(indexOfSectionIdentifier:)] + pub unsafe fn indexOfSectionIdentifier( + &self, + sectionIdentifier: &SectionIdentifierType, + ) -> NSInteger; + + #[method(appendItemsWithIdentifiers:)] + pub unsafe fn appendItemsWithIdentifiers(&self, identifiers: &NSArray); + + #[method(appendItemsWithIdentifiers:intoSectionWithIdentifier:)] + pub unsafe fn appendItemsWithIdentifiers_intoSectionWithIdentifier( + &self, + identifiers: &NSArray, + sectionIdentifier: &SectionIdentifierType, + ); + + #[method(insertItemsWithIdentifiers:beforeItemWithIdentifier:)] + pub unsafe fn insertItemsWithIdentifiers_beforeItemWithIdentifier( + &self, + identifiers: &NSArray, + itemIdentifier: &ItemIdentifierType, + ); + + #[method(insertItemsWithIdentifiers:afterItemWithIdentifier:)] + pub unsafe fn insertItemsWithIdentifiers_afterItemWithIdentifier( + &self, + identifiers: &NSArray, + itemIdentifier: &ItemIdentifierType, + ); + + #[method(deleteItemsWithIdentifiers:)] + pub unsafe fn deleteItemsWithIdentifiers(&self, identifiers: &NSArray); + + #[method(deleteAllItems)] + pub unsafe fn deleteAllItems(&self); + + #[method(moveItemWithIdentifier:beforeItemWithIdentifier:)] + pub unsafe fn moveItemWithIdentifier_beforeItemWithIdentifier( + &self, + fromIdentifier: &ItemIdentifierType, + toIdentifier: &ItemIdentifierType, + ); + + #[method(moveItemWithIdentifier:afterItemWithIdentifier:)] + pub unsafe fn moveItemWithIdentifier_afterItemWithIdentifier( + &self, + fromIdentifier: &ItemIdentifierType, + toIdentifier: &ItemIdentifierType, + ); + + #[method(reloadItemsWithIdentifiers:)] + pub unsafe fn reloadItemsWithIdentifiers(&self, identifiers: &NSArray); + + #[method(appendSectionsWithIdentifiers:)] + pub unsafe fn appendSectionsWithIdentifiers(&self, sectionIdentifiers: &NSArray); + + #[method(insertSectionsWithIdentifiers:beforeSectionWithIdentifier:)] + pub unsafe fn insertSectionsWithIdentifiers_beforeSectionWithIdentifier( + &self, + sectionIdentifiers: &NSArray, + toSectionIdentifier: &SectionIdentifierType, + ); + + #[method(insertSectionsWithIdentifiers:afterSectionWithIdentifier:)] + pub unsafe fn insertSectionsWithIdentifiers_afterSectionWithIdentifier( + &self, + sectionIdentifiers: &NSArray, + toSectionIdentifier: &SectionIdentifierType, + ); + + #[method(deleteSectionsWithIdentifiers:)] + pub unsafe fn deleteSectionsWithIdentifiers( + &self, + sectionIdentifiers: &NSArray, + ); + + #[method(moveSectionWithIdentifier:beforeSectionWithIdentifier:)] + pub unsafe fn moveSectionWithIdentifier_beforeSectionWithIdentifier( + &self, + fromSectionIdentifier: &SectionIdentifierType, + toSectionIdentifier: &SectionIdentifierType, + ); + + #[method(moveSectionWithIdentifier:afterSectionWithIdentifier:)] + pub unsafe fn moveSectionWithIdentifier_afterSectionWithIdentifier( + &self, + fromSectionIdentifier: &SectionIdentifierType, + toSectionIdentifier: &SectionIdentifierType, + ); + + #[method(reloadSectionsWithIdentifiers:)] + pub unsafe fn reloadSectionsWithIdentifiers( + &self, + sectionIdentifiers: &NSArray, + ); + } +); + +pub type NSCollectionViewDiffableDataSourceSupplementaryViewProvider = *mut Block< + ( + NonNull, + NonNull, + NonNull, + ), + *mut NSView, +>; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSCollectionViewDiffableDataSource< + SectionIdentifierType: Message = Object, + ItemIdentifierType: Message = Object, + > { + _inner0: PhantomData<*mut SectionIdentifierType>, + _inner1: PhantomData<*mut ItemIdentifierType>, + } + + unsafe impl ClassType + for NSCollectionViewDiffableDataSource + { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl + NSCollectionViewDiffableDataSource + { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Other snapshot)] + pub unsafe fn snapshot( + &self, + ) -> Id, Shared>; + + #[method(applySnapshot:animatingDifferences:)] + pub unsafe fn applySnapshot_animatingDifferences( + &self, + snapshot: &NSDiffableDataSourceSnapshot, + animatingDifferences: bool, + ); + + #[method_id(@__retain_semantics Other itemIdentifierForIndexPath:)] + pub unsafe fn itemIdentifierForIndexPath( + &self, + indexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other indexPathForItemIdentifier:)] + pub unsafe fn indexPathForItemIdentifier( + &self, + identifier: &ItemIdentifierType, + ) -> Option>; + + #[method(supplementaryViewProvider)] + pub unsafe fn supplementaryViewProvider( + &self, + ) -> NSCollectionViewDiffableDataSourceSupplementaryViewProvider; + + #[method(setSupplementaryViewProvider:)] + pub unsafe fn setSupplementaryViewProvider( + &self, + supplementaryViewProvider: NSCollectionViewDiffableDataSourceSupplementaryViewProvider, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSDockTile.rs b/crates/icrate/src/generated/AppKit/NSDockTile.rs new file mode 100644 index 000000000..c29d905b7 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDockTile.rs @@ -0,0 +1,61 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSAppKitVersionNumberWithDockTilePlugInSupport: NSAppKitVersion = 1001.0); + +extern_class!( + #[derive(Debug)] + pub struct NSDockTile; + + unsafe impl ClassType for NSDockTile { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDockTile { + #[method(size)] + pub unsafe fn size(&self) -> NSSize; + + #[method_id(@__retain_semantics Other contentView)] + pub unsafe fn contentView(&self) -> Option>; + + #[method(setContentView:)] + pub unsafe fn setContentView(&self, contentView: Option<&NSView>); + + #[method(display)] + pub unsafe fn display(&self); + + #[method(showsApplicationBadge)] + pub unsafe fn showsApplicationBadge(&self) -> bool; + + #[method(setShowsApplicationBadge:)] + pub unsafe fn setShowsApplicationBadge(&self, showsApplicationBadge: bool); + + #[method_id(@__retain_semantics Other badgeLabel)] + pub unsafe fn badgeLabel(&self) -> Option>; + + #[method(setBadgeLabel:)] + pub unsafe fn setBadgeLabel(&self, badgeLabel: Option<&NSString>); + + #[method_id(@__retain_semantics Other owner)] + pub unsafe fn owner(&self) -> Option>; + } +); + +extern_protocol!( + pub struct NSDockTilePlugIn; + + unsafe impl NSDockTilePlugIn { + #[method(setDockTile:)] + pub unsafe fn setDockTile(&self, dockTile: Option<&NSDockTile>); + + #[optional] + #[method_id(@__retain_semantics Other dockMenu)] + pub unsafe fn dockMenu(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSDocument.rs b/crates/icrate/src/generated/AppKit/NSDocument.rs new file mode 100644 index 000000000..8c75fd927 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDocument.rs @@ -0,0 +1,735 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSDocumentChangeType { + NSChangeDone = 0, + NSChangeUndone = 1, + NSChangeRedone = 5, + NSChangeCleared = 2, + NSChangeReadOtherContents = 3, + NSChangeAutosaved = 4, + NSChangeDiscardable = 256, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSSaveOperationType { + NSSaveOperation = 0, + NSSaveAsOperation = 1, + NSSaveToOperation = 2, + NSAutosaveInPlaceOperation = 4, + NSAutosaveElsewhereOperation = 3, + NSAutosaveAsOperation = 5, + NSAutosaveOperation = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDocument; + + unsafe impl ClassType for NSDocument { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDocument { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithType:error:)] + pub unsafe fn initWithType_error( + this: Option>, + typeName: &NSString, + ) -> Result, Id>; + + #[method(canConcurrentlyReadDocumentsOfType:)] + pub unsafe fn canConcurrentlyReadDocumentsOfType(typeName: &NSString) -> bool; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:ofType:error:)] + pub unsafe fn initWithContentsOfURL_ofType_error( + this: Option>, + url: &NSURL, + typeName: &NSString, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initForURL:withContentsOfURL:ofType:error:)] + pub unsafe fn initForURL_withContentsOfURL_ofType_error( + this: Option>, + urlOrNil: Option<&NSURL>, + contentsURL: &NSURL, + typeName: &NSString, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other fileType)] + pub unsafe fn fileType(&self) -> Option>; + + #[method(setFileType:)] + pub unsafe fn setFileType(&self, fileType: Option<&NSString>); + + #[method_id(@__retain_semantics Other fileURL)] + pub unsafe fn fileURL(&self) -> Option>; + + #[method(setFileURL:)] + pub unsafe fn setFileURL(&self, fileURL: Option<&NSURL>); + + #[method_id(@__retain_semantics Other fileModificationDate)] + pub unsafe fn fileModificationDate(&self) -> Option>; + + #[method(setFileModificationDate:)] + pub unsafe fn setFileModificationDate(&self, fileModificationDate: Option<&NSDate>); + + #[method(isDraft)] + pub unsafe fn isDraft(&self) -> bool; + + #[method(setDraft:)] + pub unsafe fn setDraft(&self, draft: bool); + + #[method(performActivityWithSynchronousWaiting:usingBlock:)] + pub unsafe fn performActivityWithSynchronousWaiting_usingBlock( + &self, + waitSynchronously: bool, + block: &Block<(NonNull>,), ()>, + ); + + #[method(continueActivityUsingBlock:)] + pub unsafe fn continueActivityUsingBlock(&self, block: &Block<(), ()>); + + #[method(continueAsynchronousWorkOnMainThreadUsingBlock:)] + pub unsafe fn continueAsynchronousWorkOnMainThreadUsingBlock(&self, block: &Block<(), ()>); + + #[method(performSynchronousFileAccessUsingBlock:)] + pub unsafe fn performSynchronousFileAccessUsingBlock(&self, block: &Block<(), ()>); + + #[method(performAsynchronousFileAccessUsingBlock:)] + pub unsafe fn performAsynchronousFileAccessUsingBlock( + &self, + block: &Block<(NonNull>,), ()>, + ); + + #[method(revertDocumentToSaved:)] + pub unsafe fn revertDocumentToSaved(&self, sender: Option<&Object>); + + #[method(revertToContentsOfURL:ofType:error:)] + pub unsafe fn revertToContentsOfURL_ofType_error( + &self, + url: &NSURL, + typeName: &NSString, + ) -> Result<(), Id>; + + #[method(readFromURL:ofType:error:)] + pub unsafe fn readFromURL_ofType_error( + &self, + url: &NSURL, + typeName: &NSString, + ) -> Result<(), Id>; + + #[method(readFromFileWrapper:ofType:error:)] + pub unsafe fn readFromFileWrapper_ofType_error( + &self, + fileWrapper: &NSFileWrapper, + typeName: &NSString, + ) -> Result<(), Id>; + + #[method(readFromData:ofType:error:)] + pub unsafe fn readFromData_ofType_error( + &self, + data: &NSData, + typeName: &NSString, + ) -> Result<(), Id>; + + #[method(isEntireFileLoaded)] + pub unsafe fn isEntireFileLoaded(&self) -> bool; + + #[method(writeToURL:ofType:error:)] + pub unsafe fn writeToURL_ofType_error( + &self, + url: &NSURL, + typeName: &NSString, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other fileWrapperOfType:error:)] + pub unsafe fn fileWrapperOfType_error( + &self, + typeName: &NSString, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other dataOfType:error:)] + pub unsafe fn dataOfType_error( + &self, + typeName: &NSString, + ) -> Result, Id>; + + #[method(unblockUserInteraction)] + pub unsafe fn unblockUserInteraction(&self); + + #[method(autosavingIsImplicitlyCancellable)] + pub unsafe fn autosavingIsImplicitlyCancellable(&self) -> bool; + + #[method(writeSafelyToURL:ofType:forSaveOperation:error:)] + pub unsafe fn writeSafelyToURL_ofType_forSaveOperation_error( + &self, + url: &NSURL, + typeName: &NSString, + saveOperation: NSSaveOperationType, + ) -> Result<(), Id>; + + #[method(writeToURL:ofType:forSaveOperation:originalContentsURL:error:)] + pub unsafe fn writeToURL_ofType_forSaveOperation_originalContentsURL_error( + &self, + url: &NSURL, + typeName: &NSString, + saveOperation: NSSaveOperationType, + absoluteOriginalContentsURL: Option<&NSURL>, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other fileAttributesToWriteToURL:ofType:forSaveOperation:originalContentsURL:error:)] + pub unsafe fn fileAttributesToWriteToURL_ofType_forSaveOperation_originalContentsURL_error( + &self, + url: &NSURL, + typeName: &NSString, + saveOperation: NSSaveOperationType, + absoluteOriginalContentsURL: Option<&NSURL>, + ) -> Result, Shared>, Id>; + + #[method(keepBackupFile)] + pub unsafe fn keepBackupFile(&self) -> bool; + + #[method_id(@__retain_semantics Other backupFileURL)] + pub unsafe fn backupFileURL(&self) -> Option>; + + #[method(saveDocument:)] + pub unsafe fn saveDocument(&self, sender: Option<&Object>); + + #[method(saveDocumentAs:)] + pub unsafe fn saveDocumentAs(&self, sender: Option<&Object>); + + #[method(saveDocumentTo:)] + pub unsafe fn saveDocumentTo(&self, sender: Option<&Object>); + + #[method(saveDocumentWithDelegate:didSaveSelector:contextInfo:)] + pub unsafe fn saveDocumentWithDelegate_didSaveSelector_contextInfo( + &self, + delegate: Option<&Object>, + didSaveSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo:)] + pub unsafe fn runModalSavePanelForSaveOperation_delegate_didSaveSelector_contextInfo( + &self, + saveOperation: NSSaveOperationType, + delegate: Option<&Object>, + didSaveSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(shouldRunSavePanelWithAccessoryView)] + pub unsafe fn shouldRunSavePanelWithAccessoryView(&self) -> bool; + + #[method(prepareSavePanel:)] + pub unsafe fn prepareSavePanel(&self, savePanel: &NSSavePanel) -> bool; + + #[method(fileNameExtensionWasHiddenInLastRunSavePanel)] + pub unsafe fn fileNameExtensionWasHiddenInLastRunSavePanel(&self) -> bool; + + #[method_id(@__retain_semantics Other fileTypeFromLastRunSavePanel)] + pub unsafe fn fileTypeFromLastRunSavePanel(&self) -> Option>; + + #[method(saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:)] + pub unsafe fn saveToURL_ofType_forSaveOperation_delegate_didSaveSelector_contextInfo( + &self, + url: &NSURL, + typeName: &NSString, + saveOperation: NSSaveOperationType, + delegate: Option<&Object>, + didSaveSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(saveToURL:ofType:forSaveOperation:completionHandler:)] + pub unsafe fn saveToURL_ofType_forSaveOperation_completionHandler( + &self, + url: &NSURL, + typeName: &NSString, + saveOperation: NSSaveOperationType, + completionHandler: &Block<(*mut NSError,), ()>, + ); + + #[method(canAsynchronouslyWriteToURL:ofType:forSaveOperation:)] + pub unsafe fn canAsynchronouslyWriteToURL_ofType_forSaveOperation( + &self, + url: &NSURL, + typeName: &NSString, + saveOperation: NSSaveOperationType, + ) -> bool; + + #[method(checkAutosavingSafetyAndReturnError:)] + pub unsafe fn checkAutosavingSafetyAndReturnError(&self) + -> Result<(), Id>; + + #[method(scheduleAutosaving)] + pub unsafe fn scheduleAutosaving(&self); + + #[method(hasUnautosavedChanges)] + pub unsafe fn hasUnautosavedChanges(&self) -> bool; + + #[method(autosaveDocumentWithDelegate:didAutosaveSelector:contextInfo:)] + pub unsafe fn autosaveDocumentWithDelegate_didAutosaveSelector_contextInfo( + &self, + delegate: Option<&Object>, + didAutosaveSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(autosaveWithImplicitCancellability:completionHandler:)] + pub unsafe fn autosaveWithImplicitCancellability_completionHandler( + &self, + autosavingIsImplicitlyCancellable: bool, + completionHandler: &Block<(*mut NSError,), ()>, + ); + + #[method(autosavesInPlace)] + pub unsafe fn autosavesInPlace() -> bool; + + #[method(preservesVersions)] + pub unsafe fn preservesVersions() -> bool; + + #[method(browseDocumentVersions:)] + pub unsafe fn browseDocumentVersions(&self, sender: Option<&Object>); + + #[method(isBrowsingVersions)] + pub unsafe fn isBrowsingVersions(&self) -> bool; + + #[method(stopBrowsingVersionsWithCompletionHandler:)] + pub unsafe fn stopBrowsingVersionsWithCompletionHandler( + &self, + completionHandler: Option<&Block<(), ()>>, + ); + + #[method(autosavesDrafts)] + pub unsafe fn autosavesDrafts() -> bool; + + #[method_id(@__retain_semantics Other autosavingFileType)] + pub unsafe fn autosavingFileType(&self) -> Option>; + + #[method_id(@__retain_semantics Other autosavedContentsFileURL)] + pub unsafe fn autosavedContentsFileURL(&self) -> Option>; + + #[method(setAutosavedContentsFileURL:)] + pub unsafe fn setAutosavedContentsFileURL(&self, autosavedContentsFileURL: Option<&NSURL>); + + #[method(canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:)] + pub unsafe fn canCloseDocumentWithDelegate_shouldCloseSelector_contextInfo( + &self, + delegate: &Object, + shouldCloseSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(close)] + pub unsafe fn close(&self); + + #[method(duplicateDocument:)] + pub unsafe fn duplicateDocument(&self, sender: Option<&Object>); + + #[method(duplicateDocumentWithDelegate:didDuplicateSelector:contextInfo:)] + pub unsafe fn duplicateDocumentWithDelegate_didDuplicateSelector_contextInfo( + &self, + delegate: Option<&Object>, + didDuplicateSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method_id(@__retain_semantics Other duplicateAndReturnError:)] + pub unsafe fn duplicateAndReturnError( + &self, + ) -> Result, Id>; + + #[method(renameDocument:)] + pub unsafe fn renameDocument(&self, sender: Option<&Object>); + + #[method(moveDocumentToUbiquityContainer:)] + pub unsafe fn moveDocumentToUbiquityContainer(&self, sender: Option<&Object>); + + #[method(moveDocument:)] + pub unsafe fn moveDocument(&self, sender: Option<&Object>); + + #[method(moveDocumentWithCompletionHandler:)] + pub unsafe fn moveDocumentWithCompletionHandler( + &self, + completionHandler: Option<&Block<(Bool,), ()>>, + ); + + #[method(moveToURL:completionHandler:)] + pub unsafe fn moveToURL_completionHandler( + &self, + url: &NSURL, + completionHandler: Option<&Block<(*mut NSError,), ()>>, + ); + + #[method(lockDocument:)] + pub unsafe fn lockDocument(&self, sender: Option<&Object>); + + #[method(unlockDocument:)] + pub unsafe fn unlockDocument(&self, sender: Option<&Object>); + + #[method(lockDocumentWithCompletionHandler:)] + pub unsafe fn lockDocumentWithCompletionHandler( + &self, + completionHandler: Option<&Block<(Bool,), ()>>, + ); + + #[method(lockWithCompletionHandler:)] + pub unsafe fn lockWithCompletionHandler( + &self, + completionHandler: Option<&Block<(*mut NSError,), ()>>, + ); + + #[method(unlockDocumentWithCompletionHandler:)] + pub unsafe fn unlockDocumentWithCompletionHandler( + &self, + completionHandler: Option<&Block<(Bool,), ()>>, + ); + + #[method(unlockWithCompletionHandler:)] + pub unsafe fn unlockWithCompletionHandler( + &self, + completionHandler: Option<&Block<(*mut NSError,), ()>>, + ); + + #[method(isLocked)] + pub unsafe fn isLocked(&self) -> bool; + + #[method(runPageLayout:)] + pub unsafe fn runPageLayout(&self, sender: Option<&Object>); + + #[method(runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo:)] + pub unsafe fn runModalPageLayoutWithPrintInfo_delegate_didRunSelector_contextInfo( + &self, + printInfo: &NSPrintInfo, + delegate: Option<&Object>, + didRunSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(preparePageLayout:)] + pub unsafe fn preparePageLayout(&self, pageLayout: &NSPageLayout) -> bool; + + #[method(shouldChangePrintInfo:)] + pub unsafe fn shouldChangePrintInfo(&self, newPrintInfo: &NSPrintInfo) -> bool; + + #[method_id(@__retain_semantics Other printInfo)] + pub unsafe fn printInfo(&self) -> Id; + + #[method(setPrintInfo:)] + pub unsafe fn setPrintInfo(&self, printInfo: &NSPrintInfo); + + #[method(printDocument:)] + pub unsafe fn printDocument(&self, sender: Option<&Object>); + + #[method(printDocumentWithSettings:showPrintPanel:delegate:didPrintSelector:contextInfo:)] + pub unsafe fn printDocumentWithSettings_showPrintPanel_delegate_didPrintSelector_contextInfo( + &self, + printSettings: &NSDictionary, + showPrintPanel: bool, + delegate: Option<&Object>, + didPrintSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method_id(@__retain_semantics Other printOperationWithSettings:error:)] + pub unsafe fn printOperationWithSettings_error( + &self, + printSettings: &NSDictionary, + ) -> Result, Id>; + + #[method(runModalPrintOperation:delegate:didRunSelector:contextInfo:)] + pub unsafe fn runModalPrintOperation_delegate_didRunSelector_contextInfo( + &self, + printOperation: &NSPrintOperation, + delegate: Option<&Object>, + didRunSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(saveDocumentToPDF:)] + pub unsafe fn saveDocumentToPDF(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other PDFPrintOperation)] + pub unsafe fn PDFPrintOperation(&self) -> Id; + + #[method(allowsDocumentSharing)] + pub unsafe fn allowsDocumentSharing(&self) -> bool; + + #[method(shareDocumentWithSharingService:completionHandler:)] + pub unsafe fn shareDocumentWithSharingService_completionHandler( + &self, + sharingService: &NSSharingService, + completionHandler: Option<&Block<(Bool,), ()>>, + ); + + #[method(prepareSharingServicePicker:)] + pub unsafe fn prepareSharingServicePicker( + &self, + sharingServicePicker: &NSSharingServicePicker, + ); + + #[method(isDocumentEdited)] + pub unsafe fn isDocumentEdited(&self) -> bool; + + #[method(isInViewingMode)] + pub unsafe fn isInViewingMode(&self) -> bool; + + #[method(updateChangeCount:)] + pub unsafe fn updateChangeCount(&self, change: NSDocumentChangeType); + + #[method_id(@__retain_semantics Other changeCountTokenForSaveOperation:)] + pub unsafe fn changeCountTokenForSaveOperation( + &self, + saveOperation: NSSaveOperationType, + ) -> Id; + + #[method(updateChangeCountWithToken:forSaveOperation:)] + pub unsafe fn updateChangeCountWithToken_forSaveOperation( + &self, + changeCountToken: &Object, + saveOperation: NSSaveOperationType, + ); + + #[method_id(@__retain_semantics Other undoManager)] + pub unsafe fn undoManager(&self) -> Option>; + + #[method(setUndoManager:)] + pub unsafe fn setUndoManager(&self, undoManager: Option<&NSUndoManager>); + + #[method(hasUndoManager)] + pub unsafe fn hasUndoManager(&self) -> bool; + + #[method(setHasUndoManager:)] + pub unsafe fn setHasUndoManager(&self, hasUndoManager: bool); + + #[method(presentError:modalForWindow:delegate:didPresentSelector:contextInfo:)] + pub unsafe fn presentError_modalForWindow_delegate_didPresentSelector_contextInfo( + &self, + error: &NSError, + window: &NSWindow, + delegate: Option<&Object>, + didPresentSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(presentError:)] + pub unsafe fn presentError(&self, error: &NSError) -> bool; + + #[method_id(@__retain_semantics Other willPresentError:)] + pub unsafe fn willPresentError(&self, error: &NSError) -> Id; + + #[method(willNotPresentError:)] + pub unsafe fn willNotPresentError(&self, error: &NSError); + + #[method(makeWindowControllers)] + pub unsafe fn makeWindowControllers(&self); + + #[method_id(@__retain_semantics Other windowNibName)] + pub unsafe fn windowNibName(&self) -> Option>; + + #[method(windowControllerWillLoadNib:)] + pub unsafe fn windowControllerWillLoadNib(&self, windowController: &NSWindowController); + + #[method(windowControllerDidLoadNib:)] + pub unsafe fn windowControllerDidLoadNib(&self, windowController: &NSWindowController); + + #[method(setWindow:)] + pub unsafe fn setWindow(&self, window: Option<&NSWindow>); + + #[method(addWindowController:)] + pub unsafe fn addWindowController(&self, windowController: &NSWindowController); + + #[method(removeWindowController:)] + pub unsafe fn removeWindowController(&self, windowController: &NSWindowController); + + #[method(showWindows)] + pub unsafe fn showWindows(&self); + + #[method_id(@__retain_semantics Other windowControllers)] + pub unsafe fn windowControllers(&self) -> Id, Shared>; + + #[method(shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:)] + pub unsafe fn shouldCloseWindowController_delegate_shouldCloseSelector_contextInfo( + &self, + windowController: &NSWindowController, + delegate: Option<&Object>, + shouldCloseSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method_id(@__retain_semantics Other displayName)] + pub unsafe fn displayName(&self) -> Id; + + #[method(setDisplayName:)] + pub unsafe fn setDisplayName(&self, displayName: Option<&NSString>); + + #[method_id(@__retain_semantics Other defaultDraftName)] + pub unsafe fn defaultDraftName(&self) -> Id; + + #[method_id(@__retain_semantics Other windowForSheet)] + pub unsafe fn windowForSheet(&self) -> Option>; + + #[method_id(@__retain_semantics Other readableTypes)] + pub unsafe fn readableTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other writableTypes)] + pub unsafe fn writableTypes() -> Id, Shared>; + + #[method(isNativeType:)] + pub unsafe fn isNativeType(type_: &NSString) -> bool; + + #[method_id(@__retain_semantics Other writableTypesForSaveOperation:)] + pub unsafe fn writableTypesForSaveOperation( + &self, + saveOperation: NSSaveOperationType, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other fileNameExtensionForType:saveOperation:)] + pub unsafe fn fileNameExtensionForType_saveOperation( + &self, + typeName: &NSString, + saveOperation: NSSaveOperationType, + ) -> Option>; + + #[method(validateUserInterfaceItem:)] + pub unsafe fn validateUserInterfaceItem(&self, item: &NSValidatedUserInterfaceItem) + -> bool; + + #[method(usesUbiquitousStorage)] + pub unsafe fn usesUbiquitousStorage() -> bool; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSDocument { + #[method(saveToURL:ofType:forSaveOperation:error:)] + pub unsafe fn saveToURL_ofType_forSaveOperation_error( + &self, + url: &NSURL, + typeName: &NSString, + saveOperation: NSSaveOperationType, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other dataRepresentationOfType:)] + pub unsafe fn dataRepresentationOfType( + &self, + type_: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other fileAttributesToWriteToFile:ofType:saveOperation:)] + pub unsafe fn fileAttributesToWriteToFile_ofType_saveOperation( + &self, + fullDocumentPath: &NSString, + documentTypeName: &NSString, + saveOperationType: NSSaveOperationType, + ) -> Option>; + + #[method_id(@__retain_semantics Other fileName)] + pub unsafe fn fileName(&self) -> Option>; + + #[method_id(@__retain_semantics Other fileWrapperRepresentationOfType:)] + pub unsafe fn fileWrapperRepresentationOfType( + &self, + type_: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContentsOfFile:ofType:)] + pub unsafe fn initWithContentsOfFile_ofType( + this: Option>, + absolutePath: &NSString, + typeName: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:ofType:)] + pub unsafe fn initWithContentsOfURL_ofType( + this: Option>, + url: &NSURL, + typeName: &NSString, + ) -> Option>; + + #[method(loadDataRepresentation:ofType:)] + pub unsafe fn loadDataRepresentation_ofType(&self, data: &NSData, type_: &NSString) + -> bool; + + #[method(loadFileWrapperRepresentation:ofType:)] + pub unsafe fn loadFileWrapperRepresentation_ofType( + &self, + wrapper: &NSFileWrapper, + type_: &NSString, + ) -> bool; + + #[method(printShowingPrintPanel:)] + pub unsafe fn printShowingPrintPanel(&self, flag: bool); + + #[method(readFromFile:ofType:)] + pub unsafe fn readFromFile_ofType(&self, fileName: &NSString, type_: &NSString) -> bool; + + #[method(readFromURL:ofType:)] + pub unsafe fn readFromURL_ofType(&self, url: &NSURL, type_: &NSString) -> bool; + + #[method(revertToSavedFromFile:ofType:)] + pub unsafe fn revertToSavedFromFile_ofType( + &self, + fileName: &NSString, + type_: &NSString, + ) -> bool; + + #[method(revertToSavedFromURL:ofType:)] + pub unsafe fn revertToSavedFromURL_ofType(&self, url: &NSURL, type_: &NSString) -> bool; + + #[method(runModalPageLayoutWithPrintInfo:)] + pub unsafe fn runModalPageLayoutWithPrintInfo(&self, printInfo: &NSPrintInfo) -> NSInteger; + + #[method(saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:)] + pub unsafe fn saveToFile_saveOperation_delegate_didSaveSelector_contextInfo( + &self, + fileName: &NSString, + saveOperation: NSSaveOperationType, + delegate: Option<&Object>, + didSaveSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(setFileName:)] + pub unsafe fn setFileName(&self, fileName: Option<&NSString>); + + #[method(writeToFile:ofType:)] + pub unsafe fn writeToFile_ofType(&self, fileName: &NSString, type_: &NSString) -> bool; + + #[method(writeToFile:ofType:originalFile:saveOperation:)] + pub unsafe fn writeToFile_ofType_originalFile_saveOperation( + &self, + fullDocumentPath: &NSString, + documentTypeName: &NSString, + fullOriginalDocumentPath: Option<&NSString>, + saveOperationType: NSSaveOperationType, + ) -> bool; + + #[method(writeToURL:ofType:)] + pub unsafe fn writeToURL_ofType(&self, url: &NSURL, type_: &NSString) -> bool; + + #[method(writeWithBackupToFile:ofType:saveOperation:)] + pub unsafe fn writeWithBackupToFile_ofType_saveOperation( + &self, + fullDocumentPath: &NSString, + documentTypeName: &NSString, + saveOperationType: NSSaveOperationType, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSDocumentController.rs b/crates/icrate/src/generated/AppKit/NSDocumentController.rs new file mode 100644 index 000000000..adc505ec0 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDocumentController.rs @@ -0,0 +1,312 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSDocumentController; + + unsafe impl ClassType for NSDocumentController { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDocumentController { + #[method_id(@__retain_semantics Other sharedDocumentController)] + pub unsafe fn sharedDocumentController() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other documents)] + pub unsafe fn documents(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other currentDocument)] + pub unsafe fn currentDocument(&self) -> Option>; + + #[method_id(@__retain_semantics Other currentDirectory)] + pub unsafe fn currentDirectory(&self) -> Option>; + + #[method_id(@__retain_semantics Other documentForURL:)] + pub unsafe fn documentForURL(&self, url: &NSURL) -> Option>; + + #[method_id(@__retain_semantics Other documentForWindow:)] + pub unsafe fn documentForWindow(&self, window: &NSWindow) + -> Option>; + + #[method(addDocument:)] + pub unsafe fn addDocument(&self, document: &NSDocument); + + #[method(removeDocument:)] + pub unsafe fn removeDocument(&self, document: &NSDocument); + + #[method(newDocument:)] + pub unsafe fn newDocument(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other openUntitledDocumentAndDisplay:error:)] + pub unsafe fn openUntitledDocumentAndDisplay_error( + &self, + displayDocument: bool, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other makeUntitledDocumentOfType:error:)] + pub unsafe fn makeUntitledDocumentOfType_error( + &self, + typeName: &NSString, + ) -> Result, Id>; + + #[method(openDocument:)] + pub unsafe fn openDocument(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other URLsFromRunningOpenPanel)] + pub unsafe fn URLsFromRunningOpenPanel(&self) -> Option, Shared>>; + + #[method(runModalOpenPanel:forTypes:)] + pub unsafe fn runModalOpenPanel_forTypes( + &self, + openPanel: &NSOpenPanel, + types: Option<&NSArray>, + ) -> NSInteger; + + #[method(beginOpenPanelWithCompletionHandler:)] + pub unsafe fn beginOpenPanelWithCompletionHandler( + &self, + completionHandler: &Block<(*mut NSArray,), ()>, + ); + + #[method(beginOpenPanel:forTypes:completionHandler:)] + pub unsafe fn beginOpenPanel_forTypes_completionHandler( + &self, + openPanel: &NSOpenPanel, + inTypes: Option<&NSArray>, + completionHandler: &Block<(NSInteger,), ()>, + ); + + #[method(openDocumentWithContentsOfURL:display:completionHandler:)] + pub unsafe fn openDocumentWithContentsOfURL_display_completionHandler( + &self, + url: &NSURL, + displayDocument: bool, + completionHandler: &Block<(*mut NSDocument, Bool, *mut NSError), ()>, + ); + + #[method_id(@__retain_semantics Other makeDocumentWithContentsOfURL:ofType:error:)] + pub unsafe fn makeDocumentWithContentsOfURL_ofType_error( + &self, + url: &NSURL, + typeName: &NSString, + ) -> Result, Id>; + + #[method(reopenDocumentForURL:withContentsOfURL:display:completionHandler:)] + pub unsafe fn reopenDocumentForURL_withContentsOfURL_display_completionHandler( + &self, + urlOrNil: Option<&NSURL>, + contentsURL: &NSURL, + displayDocument: bool, + completionHandler: &Block<(*mut NSDocument, Bool, *mut NSError), ()>, + ); + + #[method_id(@__retain_semantics Other makeDocumentForURL:withContentsOfURL:ofType:error:)] + pub unsafe fn makeDocumentForURL_withContentsOfURL_ofType_error( + &self, + urlOrNil: Option<&NSURL>, + contentsURL: &NSURL, + typeName: &NSString, + ) -> Result, Id>; + + #[method(autosavingDelay)] + pub unsafe fn autosavingDelay(&self) -> NSTimeInterval; + + #[method(setAutosavingDelay:)] + pub unsafe fn setAutosavingDelay(&self, autosavingDelay: NSTimeInterval); + + #[method(saveAllDocuments:)] + pub unsafe fn saveAllDocuments(&self, sender: Option<&Object>); + + #[method(hasEditedDocuments)] + pub unsafe fn hasEditedDocuments(&self) -> bool; + + #[method(reviewUnsavedDocumentsWithAlertTitle:cancellable:delegate:didReviewAllSelector:contextInfo:)] + pub unsafe fn reviewUnsavedDocumentsWithAlertTitle_cancellable_delegate_didReviewAllSelector_contextInfo( + &self, + title: Option<&NSString>, + cancellable: bool, + delegate: Option<&Object>, + didReviewAllSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:)] + pub unsafe fn closeAllDocumentsWithDelegate_didCloseAllSelector_contextInfo( + &self, + delegate: Option<&Object>, + didCloseAllSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method_id(@__retain_semantics Other duplicateDocumentWithContentsOfURL:copying:displayName:error:)] + pub unsafe fn duplicateDocumentWithContentsOfURL_copying_displayName_error( + &self, + url: &NSURL, + duplicateByCopying: bool, + displayNameOrNil: Option<&NSString>, + ) -> Result, Id>; + + #[method(allowsAutomaticShareMenu)] + pub unsafe fn allowsAutomaticShareMenu(&self) -> bool; + + #[method_id(@__retain_semantics Other standardShareMenuItem)] + pub unsafe fn standardShareMenuItem(&self) -> Id; + + #[method(presentError:modalForWindow:delegate:didPresentSelector:contextInfo:)] + pub unsafe fn presentError_modalForWindow_delegate_didPresentSelector_contextInfo( + &self, + error: &NSError, + window: &NSWindow, + delegate: Option<&Object>, + didPresentSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(presentError:)] + pub unsafe fn presentError(&self, error: &NSError) -> bool; + + #[method_id(@__retain_semantics Other willPresentError:)] + pub unsafe fn willPresentError(&self, error: &NSError) -> Id; + + #[method(maximumRecentDocumentCount)] + pub unsafe fn maximumRecentDocumentCount(&self) -> NSUInteger; + + #[method(clearRecentDocuments:)] + pub unsafe fn clearRecentDocuments(&self, sender: Option<&Object>); + + #[method(noteNewRecentDocument:)] + pub unsafe fn noteNewRecentDocument(&self, document: &NSDocument); + + #[method(noteNewRecentDocumentURL:)] + pub unsafe fn noteNewRecentDocumentURL(&self, url: &NSURL); + + #[method_id(@__retain_semantics Other recentDocumentURLs)] + pub unsafe fn recentDocumentURLs(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other defaultType)] + pub unsafe fn defaultType(&self) -> Option>; + + #[method_id(@__retain_semantics Other typeForContentsOfURL:error:)] + pub unsafe fn typeForContentsOfURL_error( + &self, + url: &NSURL, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other documentClassNames)] + pub unsafe fn documentClassNames(&self) -> Id, Shared>; + + #[method(documentClassForType:)] + pub unsafe fn documentClassForType(&self, typeName: &NSString) -> Option<&'static Class>; + + #[method_id(@__retain_semantics Other displayNameForType:)] + pub unsafe fn displayNameForType( + &self, + typeName: &NSString, + ) -> Option>; + + #[method(validateUserInterfaceItem:)] + pub unsafe fn validateUserInterfaceItem(&self, item: &NSValidatedUserInterfaceItem) + -> bool; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSDocumentController { + #[method_id(@__retain_semantics Other openDocumentWithContentsOfURL:display:error:)] + pub unsafe fn openDocumentWithContentsOfURL_display_error( + &self, + url: &NSURL, + displayDocument: bool, + ) -> Result, Id>; + + #[method(reopenDocumentForURL:withContentsOfURL:error:)] + pub unsafe fn reopenDocumentForURL_withContentsOfURL_error( + &self, + url: Option<&NSURL>, + contentsURL: &NSURL, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other fileExtensionsFromType:)] + pub unsafe fn fileExtensionsFromType( + &self, + typeName: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other typeFromFileExtension:)] + pub unsafe fn typeFromFileExtension( + &self, + fileNameExtensionOrHFSFileType: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other documentForFileName:)] + pub unsafe fn documentForFileName(&self, fileName: &NSString) + -> Option>; + + #[method_id(@__retain_semantics Other fileNamesFromRunningOpenPanel)] + pub unsafe fn fileNamesFromRunningOpenPanel(&self) -> Option>; + + #[method_id(@__retain_semantics Other makeDocumentWithContentsOfFile:ofType:)] + pub unsafe fn makeDocumentWithContentsOfFile_ofType( + &self, + fileName: &NSString, + type_: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other makeDocumentWithContentsOfURL:ofType:)] + pub unsafe fn makeDocumentWithContentsOfURL_ofType( + &self, + url: &NSURL, + type_: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Other makeUntitledDocumentOfType:)] + pub unsafe fn makeUntitledDocumentOfType( + &self, + type_: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other openDocumentWithContentsOfFile:display:)] + pub unsafe fn openDocumentWithContentsOfFile_display( + &self, + fileName: &NSString, + display: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other openDocumentWithContentsOfURL:display:)] + pub unsafe fn openDocumentWithContentsOfURL_display( + &self, + url: &NSURL, + display: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other openUntitledDocumentOfType:display:)] + pub unsafe fn openUntitledDocumentOfType_display( + &self, + type_: &NSString, + display: bool, + ) -> Option>; + + #[method(setShouldCreateUI:)] + pub unsafe fn setShouldCreateUI(&self, flag: bool); + + #[method(shouldCreateUI)] + pub unsafe fn shouldCreateUI(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSDocumentScripting.rs b/crates/icrate/src/generated/AppKit/NSDocumentScripting.rs new file mode 100644 index 000000000..4f6e48ff7 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDocumentScripting.rs @@ -0,0 +1,38 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_methods!( + /// NSScripting + unsafe impl NSDocument { + #[method_id(@__retain_semantics Other lastComponentOfFileName)] + pub unsafe fn lastComponentOfFileName(&self) -> Id; + + #[method(setLastComponentOfFileName:)] + pub unsafe fn setLastComponentOfFileName(&self, lastComponentOfFileName: &NSString); + + #[method_id(@__retain_semantics Other handleSaveScriptCommand:)] + pub unsafe fn handleSaveScriptCommand( + &self, + command: &NSScriptCommand, + ) -> Option>; + + #[method_id(@__retain_semantics Other handleCloseScriptCommand:)] + pub unsafe fn handleCloseScriptCommand( + &self, + command: &NSCloseCommand, + ) -> Option>; + + #[method_id(@__retain_semantics Other handlePrintScriptCommand:)] + pub unsafe fn handlePrintScriptCommand( + &self, + command: &NSScriptCommand, + ) -> Option>; + + #[method_id(@__retain_semantics Other objectSpecifier)] + pub unsafe fn objectSpecifier(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSDragging.rs b/crates/icrate/src/generated/AppKit/NSDragging.rs new file mode 100644 index 000000000..77dd3190a --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDragging.rs @@ -0,0 +1,305 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSDragOperation { + NSDragOperationNone = 0, + NSDragOperationCopy = 1, + NSDragOperationLink = 2, + NSDragOperationGeneric = 4, + NSDragOperationPrivate = 8, + NSDragOperationMove = 16, + NSDragOperationDelete = 32, + NSDragOperationEvery = 18446744073709551615, + NSDragOperationAll_Obsolete = 15, + NSDragOperationAll = NSDragOperationAll_Obsolete, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSDraggingFormation { + NSDraggingFormationDefault = 0, + NSDraggingFormationNone = 1, + NSDraggingFormationPile = 2, + NSDraggingFormationList = 3, + NSDraggingFormationStack = 4, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSDraggingContext { + NSDraggingContextOutsideApplication = 0, + NSDraggingContextWithinApplication = 1, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSDraggingItemEnumerationOptions { + NSDraggingItemEnumerationConcurrent = NSEnumerationConcurrent, + NSDraggingItemEnumerationClearNonenumeratedImages = 1 << 16, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSSpringLoadingHighlight { + NSSpringLoadingHighlightNone = 0, + NSSpringLoadingHighlightStandard = 1, + NSSpringLoadingHighlightEmphasized = 2, + } +); + +extern_protocol!( + pub struct NSDraggingInfo; + + unsafe impl NSDraggingInfo { + #[method_id(@__retain_semantics Other draggingDestinationWindow)] + pub unsafe fn draggingDestinationWindow(&self) -> Option>; + + #[method(draggingSourceOperationMask)] + pub unsafe fn draggingSourceOperationMask(&self) -> NSDragOperation; + + #[method(draggingLocation)] + pub unsafe fn draggingLocation(&self) -> NSPoint; + + #[method(draggedImageLocation)] + pub unsafe fn draggedImageLocation(&self) -> NSPoint; + + #[method_id(@__retain_semantics Other draggedImage)] + pub unsafe fn draggedImage(&self) -> Option>; + + #[method_id(@__retain_semantics Other draggingPasteboard)] + pub unsafe fn draggingPasteboard(&self) -> Id; + + #[method_id(@__retain_semantics Other draggingSource)] + pub unsafe fn draggingSource(&self) -> Option>; + + #[method(draggingSequenceNumber)] + pub unsafe fn draggingSequenceNumber(&self) -> NSInteger; + + #[method(slideDraggedImageTo:)] + pub unsafe fn slideDraggedImageTo(&self, screenPoint: NSPoint); + + #[method_id(@__retain_semantics Other namesOfPromisedFilesDroppedAtDestination:)] + pub unsafe fn namesOfPromisedFilesDroppedAtDestination( + &self, + dropDestination: &NSURL, + ) -> Option, Shared>>; + + #[method(draggingFormation)] + pub unsafe fn draggingFormation(&self) -> NSDraggingFormation; + + #[method(setDraggingFormation:)] + pub unsafe fn setDraggingFormation(&self, draggingFormation: NSDraggingFormation); + + #[method(animatesToDestination)] + pub unsafe fn animatesToDestination(&self) -> bool; + + #[method(setAnimatesToDestination:)] + pub unsafe fn setAnimatesToDestination(&self, animatesToDestination: bool); + + #[method(numberOfValidItemsForDrop)] + pub unsafe fn numberOfValidItemsForDrop(&self) -> NSInteger; + + #[method(setNumberOfValidItemsForDrop:)] + pub unsafe fn setNumberOfValidItemsForDrop(&self, numberOfValidItemsForDrop: NSInteger); + + #[method(enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:)] + pub unsafe fn enumerateDraggingItemsWithOptions_forView_classes_searchOptions_usingBlock( + &self, + enumOpts: NSDraggingItemEnumerationOptions, + view: Option<&NSView>, + classArray: &NSArray, + searchOptions: &NSDictionary, + block: &Block<(NonNull, NSInteger, NonNull), ()>, + ); + + #[method(springLoadingHighlight)] + pub unsafe fn springLoadingHighlight(&self) -> NSSpringLoadingHighlight; + + #[method(resetSpringLoading)] + pub unsafe fn resetSpringLoading(&self); + } +); + +extern_protocol!( + pub struct NSDraggingDestination; + + unsafe impl NSDraggingDestination { + #[optional] + #[method(draggingEntered:)] + pub unsafe fn draggingEntered(&self, sender: &NSDraggingInfo) -> NSDragOperation; + + #[optional] + #[method(draggingUpdated:)] + pub unsafe fn draggingUpdated(&self, sender: &NSDraggingInfo) -> NSDragOperation; + + #[optional] + #[method(draggingExited:)] + pub unsafe fn draggingExited(&self, sender: Option<&NSDraggingInfo>); + + #[optional] + #[method(prepareForDragOperation:)] + pub unsafe fn prepareForDragOperation(&self, sender: &NSDraggingInfo) -> bool; + + #[optional] + #[method(performDragOperation:)] + pub unsafe fn performDragOperation(&self, sender: &NSDraggingInfo) -> bool; + + #[optional] + #[method(concludeDragOperation:)] + pub unsafe fn concludeDragOperation(&self, sender: Option<&NSDraggingInfo>); + + #[optional] + #[method(draggingEnded:)] + pub unsafe fn draggingEnded(&self, sender: &NSDraggingInfo); + + #[optional] + #[method(wantsPeriodicDraggingUpdates)] + pub unsafe fn wantsPeriodicDraggingUpdates(&self) -> bool; + + #[optional] + #[method(updateDraggingItemsForDrag:)] + pub unsafe fn updateDraggingItemsForDrag(&self, sender: Option<&NSDraggingInfo>); + } +); + +extern_protocol!( + pub struct NSDraggingSource; + + unsafe impl NSDraggingSource { + #[method(draggingSession:sourceOperationMaskForDraggingContext:)] + pub unsafe fn draggingSession_sourceOperationMaskForDraggingContext( + &self, + session: &NSDraggingSession, + context: NSDraggingContext, + ) -> NSDragOperation; + + #[optional] + #[method(draggingSession:willBeginAtPoint:)] + pub unsafe fn draggingSession_willBeginAtPoint( + &self, + session: &NSDraggingSession, + screenPoint: NSPoint, + ); + + #[optional] + #[method(draggingSession:movedToPoint:)] + pub unsafe fn draggingSession_movedToPoint( + &self, + session: &NSDraggingSession, + screenPoint: NSPoint, + ); + + #[optional] + #[method(draggingSession:endedAtPoint:operation:)] + pub unsafe fn draggingSession_endedAtPoint_operation( + &self, + session: &NSDraggingSession, + screenPoint: NSPoint, + operation: NSDragOperation, + ); + + #[optional] + #[method(ignoreModifierKeysForDraggingSession:)] + pub unsafe fn ignoreModifierKeysForDraggingSession( + &self, + session: &NSDraggingSession, + ) -> bool; + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSSpringLoadingOptions { + NSSpringLoadingDisabled = 0, + NSSpringLoadingEnabled = 1 << 0, + NSSpringLoadingContinuousActivation = 1 << 1, + NSSpringLoadingNoHover = 1 << 3, + } +); + +extern_protocol!( + pub struct NSSpringLoadingDestination; + + unsafe impl NSSpringLoadingDestination { + #[method(springLoadingActivated:draggingInfo:)] + pub unsafe fn springLoadingActivated_draggingInfo( + &self, + activated: bool, + draggingInfo: &NSDraggingInfo, + ); + + #[method(springLoadingHighlightChanged:)] + pub unsafe fn springLoadingHighlightChanged(&self, draggingInfo: &NSDraggingInfo); + + #[optional] + #[method(springLoadingEntered:)] + pub unsafe fn springLoadingEntered( + &self, + draggingInfo: &NSDraggingInfo, + ) -> NSSpringLoadingOptions; + + #[optional] + #[method(springLoadingUpdated:)] + pub unsafe fn springLoadingUpdated( + &self, + draggingInfo: &NSDraggingInfo, + ) -> NSSpringLoadingOptions; + + #[optional] + #[method(springLoadingExited:)] + pub unsafe fn springLoadingExited(&self, draggingInfo: &NSDraggingInfo); + + #[optional] + #[method(draggingEnded:)] + pub unsafe fn draggingEnded(&self, draggingInfo: &NSDraggingInfo); + } +); + +extern_methods!( + /// NSDraggingSourceDeprecated + unsafe impl NSObject { + #[method_id(@__retain_semantics Other namesOfPromisedFilesDroppedAtDestination:)] + pub unsafe fn namesOfPromisedFilesDroppedAtDestination( + &self, + dropDestination: &NSURL, + ) -> Option, Shared>>; + + #[method(draggingSourceOperationMaskForLocal:)] + pub unsafe fn draggingSourceOperationMaskForLocal(&self, flag: bool) -> NSDragOperation; + + #[method(draggedImage:beganAt:)] + pub unsafe fn draggedImage_beganAt(&self, image: Option<&NSImage>, screenPoint: NSPoint); + + #[method(draggedImage:endedAt:operation:)] + pub unsafe fn draggedImage_endedAt_operation( + &self, + image: Option<&NSImage>, + screenPoint: NSPoint, + operation: NSDragOperation, + ); + + #[method(draggedImage:movedTo:)] + pub unsafe fn draggedImage_movedTo(&self, image: Option<&NSImage>, screenPoint: NSPoint); + + #[method(ignoreModifierKeysWhileDragging)] + pub unsafe fn ignoreModifierKeysWhileDragging(&self) -> bool; + + #[method(draggedImage:endedAt:deposited:)] + pub unsafe fn draggedImage_endedAt_deposited( + &self, + image: Option<&NSImage>, + screenPoint: NSPoint, + flag: bool, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSDraggingItem.rs b/crates/icrate/src/generated/AppKit/NSDraggingItem.rs new file mode 100644 index 000000000..c69a67fe1 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDraggingItem.rs @@ -0,0 +1,107 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSDraggingImageComponentKey = NSString; + +extern_static!(NSDraggingImageComponentIconKey: &'static NSDraggingImageComponentKey); + +extern_static!(NSDraggingImageComponentLabelKey: &'static NSDraggingImageComponentKey); + +extern_class!( + #[derive(Debug)] + pub struct NSDraggingImageComponent; + + unsafe impl ClassType for NSDraggingImageComponent { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDraggingImageComponent { + #[method_id(@__retain_semantics Other draggingImageComponentWithKey:)] + pub unsafe fn draggingImageComponentWithKey( + key: &NSDraggingImageComponentKey, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithKey:)] + pub unsafe fn initWithKey( + this: Option>, + key: &NSDraggingImageComponentKey, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other key)] + pub unsafe fn key(&self) -> Id; + + #[method(setKey:)] + pub unsafe fn setKey(&self, key: &NSDraggingImageComponentKey); + + #[method_id(@__retain_semantics Other contents)] + pub unsafe fn contents(&self) -> Option>; + + #[method(setContents:)] + pub unsafe fn setContents(&self, contents: Option<&Object>); + + #[method(frame)] + pub unsafe fn frame(&self) -> NSRect; + + #[method(setFrame:)] + pub unsafe fn setFrame(&self, frame: NSRect); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDraggingItem; + + unsafe impl ClassType for NSDraggingItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDraggingItem { + #[method_id(@__retain_semantics Init initWithPasteboardWriter:)] + pub unsafe fn initWithPasteboardWriter( + this: Option>, + pasteboardWriter: &NSPasteboardWriting, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other item)] + pub unsafe fn item(&self) -> Id; + + #[method(draggingFrame)] + pub unsafe fn draggingFrame(&self) -> NSRect; + + #[method(setDraggingFrame:)] + pub unsafe fn setDraggingFrame(&self, draggingFrame: NSRect); + + #[method(imageComponentsProvider)] + pub unsafe fn imageComponentsProvider( + &self, + ) -> *mut Block<(), NonNull>>; + + #[method(setImageComponentsProvider:)] + pub unsafe fn setImageComponentsProvider( + &self, + imageComponentsProvider: Option<&Block<(), NonNull>>>, + ); + + #[method(setDraggingFrame:contents:)] + pub unsafe fn setDraggingFrame_contents(&self, frame: NSRect, contents: Option<&Object>); + + #[method_id(@__retain_semantics Other imageComponents)] + pub unsafe fn imageComponents( + &self, + ) -> Option, Shared>>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSDraggingSession.rs b/crates/icrate/src/generated/AppKit/NSDraggingSession.rs new file mode 100644 index 000000000..a7a5cfa7f --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDraggingSession.rs @@ -0,0 +1,59 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSDraggingSession; + + unsafe impl ClassType for NSDraggingSession { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDraggingSession { + #[method(draggingFormation)] + pub unsafe fn draggingFormation(&self) -> NSDraggingFormation; + + #[method(setDraggingFormation:)] + pub unsafe fn setDraggingFormation(&self, draggingFormation: NSDraggingFormation); + + #[method(animatesToStartingPositionsOnCancelOrFail)] + pub unsafe fn animatesToStartingPositionsOnCancelOrFail(&self) -> bool; + + #[method(setAnimatesToStartingPositionsOnCancelOrFail:)] + pub unsafe fn setAnimatesToStartingPositionsOnCancelOrFail( + &self, + animatesToStartingPositionsOnCancelOrFail: bool, + ); + + #[method(draggingLeaderIndex)] + pub unsafe fn draggingLeaderIndex(&self) -> NSInteger; + + #[method(setDraggingLeaderIndex:)] + pub unsafe fn setDraggingLeaderIndex(&self, draggingLeaderIndex: NSInteger); + + #[method_id(@__retain_semantics Other draggingPasteboard)] + pub unsafe fn draggingPasteboard(&self) -> Id; + + #[method(draggingSequenceNumber)] + pub unsafe fn draggingSequenceNumber(&self) -> NSInteger; + + #[method(draggingLocation)] + pub unsafe fn draggingLocation(&self) -> NSPoint; + + #[method(enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:)] + pub unsafe fn enumerateDraggingItemsWithOptions_forView_classes_searchOptions_usingBlock( + &self, + enumOpts: NSDraggingItemEnumerationOptions, + view: Option<&NSView>, + classArray: &NSArray, + searchOptions: &NSDictionary, + block: &Block<(NonNull, NSInteger, NonNull), ()>, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSDrawer.rs b/crates/icrate/src/generated/AppKit/NSDrawer.rs new file mode 100644 index 000000000..de7913131 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSDrawer.rs @@ -0,0 +1,156 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSDrawerState { + NSDrawerClosedState = 0, + NSDrawerOpeningState = 1, + NSDrawerOpenState = 2, + NSDrawerClosingState = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDrawer; + + unsafe impl ClassType for NSDrawer { + type Super = NSResponder; + } +); + +extern_methods!( + unsafe impl NSDrawer { + #[method_id(@__retain_semantics Init initWithContentSize:preferredEdge:)] + pub unsafe fn initWithContentSize_preferredEdge( + this: Option>, + contentSize: NSSize, + edge: NSRectEdge, + ) -> Id; + + #[method_id(@__retain_semantics Other parentWindow)] + pub unsafe fn parentWindow(&self) -> Option>; + + #[method(setParentWindow:)] + pub unsafe fn setParentWindow(&self, parentWindow: Option<&NSWindow>); + + #[method_id(@__retain_semantics Other contentView)] + pub unsafe fn contentView(&self) -> Option>; + + #[method(setContentView:)] + pub unsafe fn setContentView(&self, contentView: Option<&NSView>); + + #[method(preferredEdge)] + pub unsafe fn preferredEdge(&self) -> NSRectEdge; + + #[method(setPreferredEdge:)] + pub unsafe fn setPreferredEdge(&self, preferredEdge: NSRectEdge); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSDrawerDelegate>); + + #[method(openOnEdge:)] + pub unsafe fn openOnEdge(&self, edge: NSRectEdge); + + #[method(toggle:)] + pub unsafe fn toggle(&self, sender: Option<&Object>); + + #[method(state)] + pub unsafe fn state(&self) -> NSInteger; + + #[method(edge)] + pub unsafe fn edge(&self) -> NSRectEdge; + + #[method(contentSize)] + pub unsafe fn contentSize(&self) -> NSSize; + + #[method(setContentSize:)] + pub unsafe fn setContentSize(&self, contentSize: NSSize); + + #[method(minContentSize)] + pub unsafe fn minContentSize(&self) -> NSSize; + + #[method(setMinContentSize:)] + pub unsafe fn setMinContentSize(&self, minContentSize: NSSize); + + #[method(maxContentSize)] + pub unsafe fn maxContentSize(&self) -> NSSize; + + #[method(setMaxContentSize:)] + pub unsafe fn setMaxContentSize(&self, maxContentSize: NSSize); + + #[method(leadingOffset)] + pub unsafe fn leadingOffset(&self) -> CGFloat; + + #[method(setLeadingOffset:)] + pub unsafe fn setLeadingOffset(&self, leadingOffset: CGFloat); + + #[method(trailingOffset)] + pub unsafe fn trailingOffset(&self) -> CGFloat; + + #[method(setTrailingOffset:)] + pub unsafe fn setTrailingOffset(&self, trailingOffset: CGFloat); + } +); + +extern_methods!( + /// NSDrawers + unsafe impl NSWindow { + #[method_id(@__retain_semantics Other drawers)] + pub unsafe fn drawers(&self) -> Option, Shared>>; + } +); + +extern_protocol!( + pub struct NSDrawerDelegate; + + unsafe impl NSDrawerDelegate { + #[optional] + #[method(drawerShouldOpen:)] + pub unsafe fn drawerShouldOpen(&self, sender: &NSDrawer) -> bool; + + #[optional] + #[method(drawerShouldClose:)] + pub unsafe fn drawerShouldClose(&self, sender: &NSDrawer) -> bool; + + #[optional] + #[method(drawerWillResizeContents:toSize:)] + pub unsafe fn drawerWillResizeContents_toSize( + &self, + sender: &NSDrawer, + contentSize: NSSize, + ) -> NSSize; + + #[optional] + #[method(drawerWillOpen:)] + pub unsafe fn drawerWillOpen(&self, notification: &NSNotification); + + #[optional] + #[method(drawerDidOpen:)] + pub unsafe fn drawerDidOpen(&self, notification: &NSNotification); + + #[optional] + #[method(drawerWillClose:)] + pub unsafe fn drawerWillClose(&self, notification: &NSNotification); + + #[optional] + #[method(drawerDidClose:)] + pub unsafe fn drawerDidClose(&self, notification: &NSNotification); + } +); + +extern_static!(NSDrawerWillOpenNotification: &'static NSNotificationName); + +extern_static!(NSDrawerDidOpenNotification: &'static NSNotificationName); + +extern_static!(NSDrawerWillCloseNotification: &'static NSNotificationName); + +extern_static!(NSDrawerDidCloseNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/AppKit/NSEPSImageRep.rs b/crates/icrate/src/generated/AppKit/NSEPSImageRep.rs new file mode 100644 index 000000000..9de95e267 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSEPSImageRep.rs @@ -0,0 +1,37 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSEPSImageRep; + + unsafe impl ClassType for NSEPSImageRep { + type Super = NSImageRep; + } +); + +extern_methods!( + unsafe impl NSEPSImageRep { + #[method_id(@__retain_semantics Other imageRepWithData:)] + pub unsafe fn imageRepWithData(epsData: &NSData) -> Option>; + + #[method_id(@__retain_semantics Init initWithData:)] + pub unsafe fn initWithData( + this: Option>, + epsData: &NSData, + ) -> Option>; + + #[method(prepareGState)] + pub unsafe fn prepareGState(&self); + + #[method_id(@__retain_semantics Other EPSRepresentation)] + pub unsafe fn EPSRepresentation(&self) -> Id; + + #[method(boundingBox)] + pub unsafe fn boundingBox(&self) -> NSRect; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSErrors.rs b/crates/icrate/src/generated/AppKit/NSErrors.rs new file mode 100644 index 000000000..6decaf947 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSErrors.rs @@ -0,0 +1,78 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSTextLineTooLongException: &'static NSExceptionName); + +extern_static!(NSTextNoSelectionException: &'static NSExceptionName); + +extern_static!(NSWordTablesWriteException: &'static NSExceptionName); + +extern_static!(NSWordTablesReadException: &'static NSExceptionName); + +extern_static!(NSTextReadException: &'static NSExceptionName); + +extern_static!(NSTextWriteException: &'static NSExceptionName); + +extern_static!(NSPasteboardCommunicationException: &'static NSExceptionName); + +extern_static!(NSPrintingCommunicationException: &'static NSExceptionName); + +extern_static!(NSAbortModalException: &'static NSExceptionName); + +extern_static!(NSAbortPrintingException: &'static NSExceptionName); + +extern_static!(NSIllegalSelectorException: &'static NSExceptionName); + +extern_static!(NSAppKitVirtualMemoryException: &'static NSExceptionName); + +extern_static!(NSBadRTFDirectiveException: &'static NSExceptionName); + +extern_static!(NSBadRTFFontTableException: &'static NSExceptionName); + +extern_static!(NSBadRTFStyleSheetException: &'static NSExceptionName); + +extern_static!(NSTypedStreamVersionException: &'static NSExceptionName); + +extern_static!(NSTIFFException: &'static NSExceptionName); + +extern_static!(NSPrintPackageException: &'static NSExceptionName); + +extern_static!(NSBadRTFColorTableException: &'static NSExceptionName); + +extern_static!(NSDraggingException: &'static NSExceptionName); + +extern_static!(NSColorListIOException: &'static NSExceptionName); + +extern_static!(NSColorListNotEditableException: &'static NSExceptionName); + +extern_static!(NSBadBitmapParametersException: &'static NSExceptionName); + +extern_static!(NSWindowServerCommunicationException: &'static NSExceptionName); + +extern_static!(NSFontUnavailableException: &'static NSExceptionName); + +extern_static!(NSPPDIncludeNotFoundException: &'static NSExceptionName); + +extern_static!(NSPPDParseException: &'static NSExceptionName); + +extern_static!(NSPPDIncludeStackOverflowException: &'static NSExceptionName); + +extern_static!(NSPPDIncludeStackUnderflowException: &'static NSExceptionName); + +extern_static!(NSRTFPropertyStackOverflowException: &'static NSExceptionName); + +extern_static!(NSAppKitIgnoredException: &'static NSExceptionName); + +extern_static!(NSBadComparisonException: &'static NSExceptionName); + +extern_static!(NSImageCacheException: &'static NSExceptionName); + +extern_static!(NSNibLoadingException: &'static NSExceptionName); + +extern_static!(NSBrowserIllegalDelegateException: &'static NSExceptionName); + +extern_static!(NSAccessibilityException: &'static NSExceptionName); diff --git a/crates/icrate/src/generated/AppKit/NSEvent.rs b/crates/icrate/src/generated/AppKit/NSEvent.rs new file mode 100644 index 000000000..c57a7113a --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSEvent.rs @@ -0,0 +1,729 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSEventType { + NSEventTypeLeftMouseDown = 1, + NSEventTypeLeftMouseUp = 2, + NSEventTypeRightMouseDown = 3, + NSEventTypeRightMouseUp = 4, + NSEventTypeMouseMoved = 5, + NSEventTypeLeftMouseDragged = 6, + NSEventTypeRightMouseDragged = 7, + NSEventTypeMouseEntered = 8, + NSEventTypeMouseExited = 9, + NSEventTypeKeyDown = 10, + NSEventTypeKeyUp = 11, + NSEventTypeFlagsChanged = 12, + NSEventTypeAppKitDefined = 13, + NSEventTypeSystemDefined = 14, + NSEventTypeApplicationDefined = 15, + NSEventTypePeriodic = 16, + NSEventTypeCursorUpdate = 17, + NSEventTypeScrollWheel = 22, + NSEventTypeTabletPoint = 23, + NSEventTypeTabletProximity = 24, + NSEventTypeOtherMouseDown = 25, + NSEventTypeOtherMouseUp = 26, + NSEventTypeOtherMouseDragged = 27, + NSEventTypeGesture = 29, + NSEventTypeMagnify = 30, + NSEventTypeSwipe = 31, + NSEventTypeRotate = 18, + NSEventTypeBeginGesture = 19, + NSEventTypeEndGesture = 20, + NSEventTypeSmartMagnify = 32, + NSEventTypeQuickLook = 33, + NSEventTypePressure = 34, + NSEventTypeDirectTouch = 37, + NSEventTypeChangeMode = 38, + } +); + +extern_static!(NSLeftMouseDown: NSEventType = NSEventTypeLeftMouseDown); + +extern_static!(NSLeftMouseUp: NSEventType = NSEventTypeLeftMouseUp); + +extern_static!(NSRightMouseDown: NSEventType = NSEventTypeRightMouseDown); + +extern_static!(NSRightMouseUp: NSEventType = NSEventTypeRightMouseUp); + +extern_static!(NSMouseMoved: NSEventType = NSEventTypeMouseMoved); + +extern_static!(NSLeftMouseDragged: NSEventType = NSEventTypeLeftMouseDragged); + +extern_static!(NSRightMouseDragged: NSEventType = NSEventTypeRightMouseDragged); + +extern_static!(NSMouseEntered: NSEventType = NSEventTypeMouseEntered); + +extern_static!(NSMouseExited: NSEventType = NSEventTypeMouseExited); + +extern_static!(NSKeyDown: NSEventType = NSEventTypeKeyDown); + +extern_static!(NSKeyUp: NSEventType = NSEventTypeKeyUp); + +extern_static!(NSFlagsChanged: NSEventType = NSEventTypeFlagsChanged); + +extern_static!(NSAppKitDefined: NSEventType = NSEventTypeAppKitDefined); + +extern_static!(NSSystemDefined: NSEventType = NSEventTypeSystemDefined); + +extern_static!(NSApplicationDefined: NSEventType = NSEventTypeApplicationDefined); + +extern_static!(NSPeriodic: NSEventType = NSEventTypePeriodic); + +extern_static!(NSCursorUpdate: NSEventType = NSEventTypeCursorUpdate); + +extern_static!(NSScrollWheel: NSEventType = NSEventTypeScrollWheel); + +extern_static!(NSTabletPoint: NSEventType = NSEventTypeTabletPoint); + +extern_static!(NSTabletProximity: NSEventType = NSEventTypeTabletProximity); + +extern_static!(NSOtherMouseDown: NSEventType = NSEventTypeOtherMouseDown); + +extern_static!(NSOtherMouseUp: NSEventType = NSEventTypeOtherMouseUp); + +extern_static!(NSOtherMouseDragged: NSEventType = NSEventTypeOtherMouseDragged); + +ns_options!( + #[underlying(c_ulonglong)] + pub enum NSEventMask { + NSEventMaskLeftMouseDown = 1 << NSEventTypeLeftMouseDown, + NSEventMaskLeftMouseUp = 1 << NSEventTypeLeftMouseUp, + NSEventMaskRightMouseDown = 1 << NSEventTypeRightMouseDown, + NSEventMaskRightMouseUp = 1 << NSEventTypeRightMouseUp, + NSEventMaskMouseMoved = 1 << NSEventTypeMouseMoved, + NSEventMaskLeftMouseDragged = 1 << NSEventTypeLeftMouseDragged, + NSEventMaskRightMouseDragged = 1 << NSEventTypeRightMouseDragged, + NSEventMaskMouseEntered = 1 << NSEventTypeMouseEntered, + NSEventMaskMouseExited = 1 << NSEventTypeMouseExited, + NSEventMaskKeyDown = 1 << NSEventTypeKeyDown, + NSEventMaskKeyUp = 1 << NSEventTypeKeyUp, + NSEventMaskFlagsChanged = 1 << NSEventTypeFlagsChanged, + NSEventMaskAppKitDefined = 1 << NSEventTypeAppKitDefined, + NSEventMaskSystemDefined = 1 << NSEventTypeSystemDefined, + NSEventMaskApplicationDefined = 1 << NSEventTypeApplicationDefined, + NSEventMaskPeriodic = 1 << NSEventTypePeriodic, + NSEventMaskCursorUpdate = 1 << NSEventTypeCursorUpdate, + NSEventMaskScrollWheel = 1 << NSEventTypeScrollWheel, + NSEventMaskTabletPoint = 1 << NSEventTypeTabletPoint, + NSEventMaskTabletProximity = 1 << NSEventTypeTabletProximity, + NSEventMaskOtherMouseDown = 1 << NSEventTypeOtherMouseDown, + NSEventMaskOtherMouseUp = 1 << NSEventTypeOtherMouseUp, + NSEventMaskOtherMouseDragged = 1 << NSEventTypeOtherMouseDragged, + NSEventMaskGesture = 1 << NSEventTypeGesture, + NSEventMaskMagnify = 1 << NSEventTypeMagnify, + NSEventMaskSwipe = 1 << NSEventTypeSwipe, + NSEventMaskRotate = 1 << NSEventTypeRotate, + NSEventMaskBeginGesture = 1 << NSEventTypeBeginGesture, + NSEventMaskEndGesture = 1 << NSEventTypeEndGesture, + NSEventMaskSmartMagnify = 1 << NSEventTypeSmartMagnify, + NSEventMaskPressure = 1 << NSEventTypePressure, + NSEventMaskDirectTouch = 1 << NSEventTypeDirectTouch, + NSEventMaskChangeMode = 1 << NSEventTypeChangeMode, + NSEventMaskAny = 18446744073709551615, + } +); + +extern_static!(NSLeftMouseDownMask: NSEventMask = NSEventMaskLeftMouseDown); + +extern_static!(NSLeftMouseUpMask: NSEventMask = NSEventMaskLeftMouseUp); + +extern_static!(NSRightMouseDownMask: NSEventMask = NSEventMaskRightMouseDown); + +extern_static!(NSRightMouseUpMask: NSEventMask = NSEventMaskRightMouseUp); + +extern_static!(NSMouseMovedMask: NSEventMask = NSEventMaskMouseMoved); + +extern_static!(NSLeftMouseDraggedMask: NSEventMask = NSEventMaskLeftMouseDragged); + +extern_static!(NSRightMouseDraggedMask: NSEventMask = NSEventMaskRightMouseDragged); + +extern_static!(NSMouseEnteredMask: NSEventMask = NSEventMaskMouseEntered); + +extern_static!(NSMouseExitedMask: NSEventMask = NSEventMaskMouseExited); + +extern_static!(NSKeyDownMask: NSEventMask = NSEventMaskKeyDown); + +extern_static!(NSKeyUpMask: NSEventMask = NSEventMaskKeyUp); + +extern_static!(NSFlagsChangedMask: NSEventMask = NSEventMaskFlagsChanged); + +extern_static!(NSAppKitDefinedMask: NSEventMask = NSEventMaskAppKitDefined); + +extern_static!(NSSystemDefinedMask: NSEventMask = NSEventMaskSystemDefined); + +extern_static!(NSApplicationDefinedMask: NSEventMask = NSEventMaskApplicationDefined); + +extern_static!(NSPeriodicMask: NSEventMask = NSEventMaskPeriodic); + +extern_static!(NSCursorUpdateMask: NSEventMask = NSEventMaskCursorUpdate); + +extern_static!(NSScrollWheelMask: NSEventMask = NSEventMaskScrollWheel); + +extern_static!(NSTabletPointMask: NSEventMask = NSEventMaskTabletPoint); + +extern_static!(NSTabletProximityMask: NSEventMask = NSEventMaskTabletProximity); + +extern_static!(NSOtherMouseDownMask: NSEventMask = NSEventMaskOtherMouseDown); + +extern_static!(NSOtherMouseUpMask: NSEventMask = NSEventMaskOtherMouseUp); + +extern_static!(NSOtherMouseDraggedMask: NSEventMask = NSEventMaskOtherMouseDragged); + +inline_fn!( + pub unsafe fn NSEventMaskFromType(type_: NSEventType) -> NSEventMask { + todo!() + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSEventModifierFlags { + NSEventModifierFlagCapsLock = 1 << 16, + NSEventModifierFlagShift = 1 << 17, + NSEventModifierFlagControl = 1 << 18, + NSEventModifierFlagOption = 1 << 19, + NSEventModifierFlagCommand = 1 << 20, + NSEventModifierFlagNumericPad = 1 << 21, + NSEventModifierFlagHelp = 1 << 22, + NSEventModifierFlagFunction = 1 << 23, + NSEventModifierFlagDeviceIndependentFlagsMask = 0xffff0000, + } +); + +extern_static!(NSAlphaShiftKeyMask: NSEventModifierFlags = NSEventModifierFlagCapsLock); + +extern_static!(NSShiftKeyMask: NSEventModifierFlags = NSEventModifierFlagShift); + +extern_static!(NSControlKeyMask: NSEventModifierFlags = NSEventModifierFlagControl); + +extern_static!(NSAlternateKeyMask: NSEventModifierFlags = NSEventModifierFlagOption); + +extern_static!(NSCommandKeyMask: NSEventModifierFlags = NSEventModifierFlagCommand); + +extern_static!(NSNumericPadKeyMask: NSEventModifierFlags = NSEventModifierFlagNumericPad); + +extern_static!(NSHelpKeyMask: NSEventModifierFlags = NSEventModifierFlagHelp); + +extern_static!(NSFunctionKeyMask: NSEventModifierFlags = NSEventModifierFlagFunction); + +extern_static!( + NSDeviceIndependentModifierFlagsMask: NSEventModifierFlags = + NSEventModifierFlagDeviceIndependentFlagsMask +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSPointingDeviceType { + NSPointingDeviceTypeUnknown = 0, + NSPointingDeviceTypePen = 1, + NSPointingDeviceTypeCursor = 2, + NSPointingDeviceTypeEraser = 3, + } +); + +extern_static!(NSUnknownPointingDevice: NSPointingDeviceType = NSPointingDeviceTypeUnknown); + +extern_static!(NSPenPointingDevice: NSPointingDeviceType = NSPointingDeviceTypePen); + +extern_static!(NSCursorPointingDevice: NSPointingDeviceType = NSPointingDeviceTypeCursor); + +extern_static!(NSEraserPointingDevice: NSPointingDeviceType = NSPointingDeviceTypeEraser); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSEventButtonMask { + NSEventButtonMaskPenTip = 1, + NSEventButtonMaskPenLowerSide = 2, + NSEventButtonMaskPenUpperSide = 4, + } +); + +extern_static!(NSPenTipMask: NSEventButtonMask = NSEventButtonMaskPenTip); + +extern_static!(NSPenLowerSideMask: NSEventButtonMask = NSEventButtonMaskPenLowerSide); + +extern_static!(NSPenUpperSideMask: NSEventButtonMask = NSEventButtonMaskPenUpperSide); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSEventPhase { + NSEventPhaseNone = 0, + NSEventPhaseBegan = 0x1 << 0, + NSEventPhaseStationary = 0x1 << 1, + NSEventPhaseChanged = 0x1 << 2, + NSEventPhaseEnded = 0x1 << 3, + NSEventPhaseCancelled = 0x1 << 4, + NSEventPhaseMayBegin = 0x1 << 5, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSEventGestureAxis { + NSEventGestureAxisNone = 0, + NSEventGestureAxisHorizontal = 1, + NSEventGestureAxisVertical = 2, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSEventSwipeTrackingOptions { + NSEventSwipeTrackingLockDirection = 0x1 << 0, + NSEventSwipeTrackingClampGestureAmount = 0x1 << 1, + } +); + +ns_enum!( + #[underlying(c_short)] + pub enum NSEventSubtype { + NSEventSubtypeWindowExposed = 0, + NSEventSubtypeApplicationActivated = 1, + NSEventSubtypeApplicationDeactivated = 2, + NSEventSubtypeWindowMoved = 4, + NSEventSubtypeScreenChanged = 8, + NSEventSubtypePowerOff = 1, + NSEventSubtypeMouseEvent = 0, + NSEventSubtypeTabletPoint = 1, + NSEventSubtypeTabletProximity = 2, + NSEventSubtypeTouch = 3, + } +); + +extern_static!(NSWindowExposedEventType: NSEventSubtype = NSEventSubtypeWindowExposed); + +extern_static!( + NSApplicationActivatedEventType: NSEventSubtype = NSEventSubtypeApplicationActivated +); + +extern_static!( + NSApplicationDeactivatedEventType: NSEventSubtype = NSEventSubtypeApplicationDeactivated +); + +extern_static!(NSWindowMovedEventType: NSEventSubtype = NSEventSubtypeWindowMoved); + +extern_static!(NSScreenChangedEventType: NSEventSubtype = NSEventSubtypeScreenChanged); + +extern_static!(NSAWTEventType: NSEventSubtype = 16); + +extern_static!(NSPowerOffEventType: NSEventSubtype = NSEventSubtypePowerOff); + +extern_static!(NSMouseEventSubtype: NSEventSubtype = NSEventSubtypeMouseEvent); + +extern_static!(NSTabletPointEventSubtype: NSEventSubtype = NSEventSubtypeTabletPoint); + +extern_static!(NSTabletProximityEventSubtype: NSEventSubtype = NSEventSubtypeTabletProximity); + +extern_static!(NSTouchEventSubtype: NSEventSubtype = NSEventSubtypeTouch); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPressureBehavior { + NSPressureBehaviorUnknown = -1, + NSPressureBehaviorPrimaryDefault = 0, + NSPressureBehaviorPrimaryClick = 1, + NSPressureBehaviorPrimaryGeneric = 2, + NSPressureBehaviorPrimaryAccelerator = 3, + NSPressureBehaviorPrimaryDeepClick = 5, + NSPressureBehaviorPrimaryDeepDrag = 6, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSEvent; + + unsafe impl ClassType for NSEvent { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSEvent { + #[method(type)] + pub unsafe fn type_(&self) -> NSEventType; + + #[method(timestamp)] + pub unsafe fn timestamp(&self) -> NSTimeInterval; + + #[method_id(@__retain_semantics Other window)] + pub unsafe fn window(&self) -> Option>; + + #[method(windowNumber)] + pub unsafe fn windowNumber(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other context)] + pub unsafe fn context(&self) -> Option>; + + #[method(clickCount)] + pub unsafe fn clickCount(&self) -> NSInteger; + + #[method(buttonNumber)] + pub unsafe fn buttonNumber(&self) -> NSInteger; + + #[method(eventNumber)] + pub unsafe fn eventNumber(&self) -> NSInteger; + + #[method(pressure)] + pub unsafe fn pressure(&self) -> c_float; + + #[method(locationInWindow)] + pub unsafe fn locationInWindow(&self) -> NSPoint; + + #[method(deltaX)] + pub unsafe fn deltaX(&self) -> CGFloat; + + #[method(deltaY)] + pub unsafe fn deltaY(&self) -> CGFloat; + + #[method(deltaZ)] + pub unsafe fn deltaZ(&self) -> CGFloat; + + #[method(hasPreciseScrollingDeltas)] + pub unsafe fn hasPreciseScrollingDeltas(&self) -> bool; + + #[method(scrollingDeltaX)] + pub unsafe fn scrollingDeltaX(&self) -> CGFloat; + + #[method(scrollingDeltaY)] + pub unsafe fn scrollingDeltaY(&self) -> CGFloat; + + #[method(momentumPhase)] + pub unsafe fn momentumPhase(&self) -> NSEventPhase; + + #[method(isDirectionInvertedFromDevice)] + pub unsafe fn isDirectionInvertedFromDevice(&self) -> bool; + + #[method_id(@__retain_semantics Other characters)] + pub unsafe fn characters(&self) -> Option>; + + #[method_id(@__retain_semantics Other charactersIgnoringModifiers)] + pub unsafe fn charactersIgnoringModifiers(&self) -> Option>; + + #[method_id(@__retain_semantics Other charactersByApplyingModifiers:)] + pub unsafe fn charactersByApplyingModifiers( + &self, + modifiers: NSEventModifierFlags, + ) -> Option>; + + #[method(isARepeat)] + pub unsafe fn isARepeat(&self) -> bool; + + #[method(keyCode)] + pub unsafe fn keyCode(&self) -> c_ushort; + + #[method(trackingNumber)] + pub unsafe fn trackingNumber(&self) -> NSInteger; + + #[method(userData)] + pub unsafe fn userData(&self) -> *mut c_void; + + #[method_id(@__retain_semantics Other trackingArea)] + pub unsafe fn trackingArea(&self) -> Option>; + + #[method(subtype)] + pub unsafe fn subtype(&self) -> NSEventSubtype; + + #[method(data1)] + pub unsafe fn data1(&self) -> NSInteger; + + #[method(data2)] + pub unsafe fn data2(&self) -> NSInteger; + + #[method(eventRef)] + pub unsafe fn eventRef(&self) -> *mut c_void; + + #[method_id(@__retain_semantics Other eventWithEventRef:)] + pub unsafe fn eventWithEventRef(eventRef: NonNull) -> Option>; + + #[method(isMouseCoalescingEnabled)] + pub unsafe fn isMouseCoalescingEnabled() -> bool; + + #[method(setMouseCoalescingEnabled:)] + pub unsafe fn setMouseCoalescingEnabled(mouseCoalescingEnabled: bool); + + #[method(magnification)] + pub unsafe fn magnification(&self) -> CGFloat; + + #[method(deviceID)] + pub unsafe fn deviceID(&self) -> NSUInteger; + + #[method(rotation)] + pub unsafe fn rotation(&self) -> c_float; + + #[method(absoluteX)] + pub unsafe fn absoluteX(&self) -> NSInteger; + + #[method(absoluteY)] + pub unsafe fn absoluteY(&self) -> NSInteger; + + #[method(absoluteZ)] + pub unsafe fn absoluteZ(&self) -> NSInteger; + + #[method(buttonMask)] + pub unsafe fn buttonMask(&self) -> NSEventButtonMask; + + #[method(tilt)] + pub unsafe fn tilt(&self) -> NSPoint; + + #[method(tangentialPressure)] + pub unsafe fn tangentialPressure(&self) -> c_float; + + #[method_id(@__retain_semantics Other vendorDefined)] + pub unsafe fn vendorDefined(&self) -> Id; + + #[method(vendorID)] + pub unsafe fn vendorID(&self) -> NSUInteger; + + #[method(tabletID)] + pub unsafe fn tabletID(&self) -> NSUInteger; + + #[method(pointingDeviceID)] + pub unsafe fn pointingDeviceID(&self) -> NSUInteger; + + #[method(systemTabletID)] + pub unsafe fn systemTabletID(&self) -> NSUInteger; + + #[method(vendorPointingDeviceType)] + pub unsafe fn vendorPointingDeviceType(&self) -> NSUInteger; + + #[method(pointingDeviceSerialNumber)] + pub unsafe fn pointingDeviceSerialNumber(&self) -> NSUInteger; + + #[method(uniqueID)] + pub unsafe fn uniqueID(&self) -> c_ulonglong; + + #[method(capabilityMask)] + pub unsafe fn capabilityMask(&self) -> NSUInteger; + + #[method(pointingDeviceType)] + pub unsafe fn pointingDeviceType(&self) -> NSPointingDeviceType; + + #[method(isEnteringProximity)] + pub unsafe fn isEnteringProximity(&self) -> bool; + + #[method_id(@__retain_semantics Other touchesMatchingPhase:inView:)] + pub unsafe fn touchesMatchingPhase_inView( + &self, + phase: NSTouchPhase, + view: Option<&NSView>, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other allTouches)] + pub unsafe fn allTouches(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other touchesForView:)] + pub unsafe fn touchesForView(&self, view: &NSView) -> Id, Shared>; + + #[method_id(@__retain_semantics Other coalescedTouchesForTouch:)] + pub unsafe fn coalescedTouchesForTouch( + &self, + touch: &NSTouch, + ) -> Id, Shared>; + + #[method(phase)] + pub unsafe fn phase(&self) -> NSEventPhase; + + #[method(stage)] + pub unsafe fn stage(&self) -> NSInteger; + + #[method(stageTransition)] + pub unsafe fn stageTransition(&self) -> CGFloat; + + #[method(associatedEventsMask)] + pub unsafe fn associatedEventsMask(&self) -> NSEventMask; + + #[method(pressureBehavior)] + pub unsafe fn pressureBehavior(&self) -> NSPressureBehavior; + + #[method(isSwipeTrackingFromScrollEventsEnabled)] + pub unsafe fn isSwipeTrackingFromScrollEventsEnabled() -> bool; + + #[method(trackSwipeEventWithOptions:dampenAmountThresholdMin:max:usingHandler:)] + pub unsafe fn trackSwipeEventWithOptions_dampenAmountThresholdMin_max_usingHandler( + &self, + options: NSEventSwipeTrackingOptions, + minDampenThreshold: CGFloat, + maxDampenThreshold: CGFloat, + trackingHandler: &Block<(CGFloat, NSEventPhase, Bool, NonNull), ()>, + ); + + #[method(startPeriodicEventsAfterDelay:withPeriod:)] + pub unsafe fn startPeriodicEventsAfterDelay_withPeriod( + delay: NSTimeInterval, + period: NSTimeInterval, + ); + + #[method(stopPeriodicEvents)] + pub unsafe fn stopPeriodicEvents(); + + #[method_id(@__retain_semantics Other mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:)] + pub unsafe fn mouseEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_clickCount_pressure( + type_: NSEventType, + location: NSPoint, + flags: NSEventModifierFlags, + time: NSTimeInterval, + wNum: NSInteger, + unusedPassNil: Option<&NSGraphicsContext>, + eNum: NSInteger, + cNum: NSInteger, + pressure: c_float, + ) -> Option>; + + #[method_id(@__retain_semantics Other keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:)] + pub unsafe fn keyEventWithType_location_modifierFlags_timestamp_windowNumber_context_characters_charactersIgnoringModifiers_isARepeat_keyCode( + type_: NSEventType, + location: NSPoint, + flags: NSEventModifierFlags, + time: NSTimeInterval, + wNum: NSInteger, + unusedPassNil: Option<&NSGraphicsContext>, + keys: &NSString, + ukeys: &NSString, + flag: bool, + code: c_ushort, + ) -> Option>; + + #[method_id(@__retain_semantics Other enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:)] + pub unsafe fn enterExitEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_trackingNumber_userData( + type_: NSEventType, + location: NSPoint, + flags: NSEventModifierFlags, + time: NSTimeInterval, + wNum: NSInteger, + unusedPassNil: Option<&NSGraphicsContext>, + eNum: NSInteger, + tNum: NSInteger, + data: *mut c_void, + ) -> Option>; + + #[method_id(@__retain_semantics Other otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:)] + pub unsafe fn otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2( + type_: NSEventType, + location: NSPoint, + flags: NSEventModifierFlags, + time: NSTimeInterval, + wNum: NSInteger, + unusedPassNil: Option<&NSGraphicsContext>, + subtype: c_short, + d1: NSInteger, + d2: NSInteger, + ) -> Option>; + + #[method(mouseLocation)] + pub unsafe fn mouseLocation() -> NSPoint; + + #[method(pressedMouseButtons)] + pub unsafe fn pressedMouseButtons() -> NSUInteger; + + #[method(doubleClickInterval)] + pub unsafe fn doubleClickInterval() -> NSTimeInterval; + + #[method(keyRepeatDelay)] + pub unsafe fn keyRepeatDelay() -> NSTimeInterval; + + #[method(keyRepeatInterval)] + pub unsafe fn keyRepeatInterval() -> NSTimeInterval; + + #[method_id(@__retain_semantics Other addGlobalMonitorForEventsMatchingMask:handler:)] + pub unsafe fn addGlobalMonitorForEventsMatchingMask_handler( + mask: NSEventMask, + block: &Block<(NonNull,), ()>, + ) -> Option>; + + #[method_id(@__retain_semantics Other addLocalMonitorForEventsMatchingMask:handler:)] + pub unsafe fn addLocalMonitorForEventsMatchingMask_handler( + mask: NSEventMask, + block: &Block<(NonNull,), *mut NSEvent>, + ) -> Option>; + + #[method(removeMonitor:)] + pub unsafe fn removeMonitor(eventMonitor: &Object); + } +); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSUpArrowFunctionKey = 0xF700, + NSDownArrowFunctionKey = 0xF701, + NSLeftArrowFunctionKey = 0xF702, + NSRightArrowFunctionKey = 0xF703, + NSF1FunctionKey = 0xF704, + NSF2FunctionKey = 0xF705, + NSF3FunctionKey = 0xF706, + NSF4FunctionKey = 0xF707, + NSF5FunctionKey = 0xF708, + NSF6FunctionKey = 0xF709, + NSF7FunctionKey = 0xF70A, + NSF8FunctionKey = 0xF70B, + NSF9FunctionKey = 0xF70C, + NSF10FunctionKey = 0xF70D, + NSF11FunctionKey = 0xF70E, + NSF12FunctionKey = 0xF70F, + NSF13FunctionKey = 0xF710, + NSF14FunctionKey = 0xF711, + NSF15FunctionKey = 0xF712, + NSF16FunctionKey = 0xF713, + NSF17FunctionKey = 0xF714, + NSF18FunctionKey = 0xF715, + NSF19FunctionKey = 0xF716, + NSF20FunctionKey = 0xF717, + NSF21FunctionKey = 0xF718, + NSF22FunctionKey = 0xF719, + NSF23FunctionKey = 0xF71A, + NSF24FunctionKey = 0xF71B, + NSF25FunctionKey = 0xF71C, + NSF26FunctionKey = 0xF71D, + NSF27FunctionKey = 0xF71E, + NSF28FunctionKey = 0xF71F, + NSF29FunctionKey = 0xF720, + NSF30FunctionKey = 0xF721, + NSF31FunctionKey = 0xF722, + NSF32FunctionKey = 0xF723, + NSF33FunctionKey = 0xF724, + NSF34FunctionKey = 0xF725, + NSF35FunctionKey = 0xF726, + NSInsertFunctionKey = 0xF727, + NSDeleteFunctionKey = 0xF728, + NSHomeFunctionKey = 0xF729, + NSBeginFunctionKey = 0xF72A, + NSEndFunctionKey = 0xF72B, + NSPageUpFunctionKey = 0xF72C, + NSPageDownFunctionKey = 0xF72D, + NSPrintScreenFunctionKey = 0xF72E, + NSScrollLockFunctionKey = 0xF72F, + NSPauseFunctionKey = 0xF730, + NSSysReqFunctionKey = 0xF731, + NSBreakFunctionKey = 0xF732, + NSResetFunctionKey = 0xF733, + NSStopFunctionKey = 0xF734, + NSMenuFunctionKey = 0xF735, + NSUserFunctionKey = 0xF736, + NSSystemFunctionKey = 0xF737, + NSPrintFunctionKey = 0xF738, + NSClearLineFunctionKey = 0xF739, + NSClearDisplayFunctionKey = 0xF73A, + NSInsertLineFunctionKey = 0xF73B, + NSDeleteLineFunctionKey = 0xF73C, + NSInsertCharFunctionKey = 0xF73D, + NSDeleteCharFunctionKey = 0xF73E, + NSPrevFunctionKey = 0xF73F, + NSNextFunctionKey = 0xF740, + NSSelectFunctionKey = 0xF741, + NSExecuteFunctionKey = 0xF742, + NSUndoFunctionKey = 0xF743, + NSRedoFunctionKey = 0xF744, + NSFindFunctionKey = 0xF745, + NSHelpFunctionKey = 0xF746, + NSModeSwitchFunctionKey = 0xF747, + } +); diff --git a/crates/icrate/src/generated/AppKit/NSFilePromiseProvider.rs b/crates/icrate/src/generated/AppKit/NSFilePromiseProvider.rs new file mode 100644 index 000000000..a63fbd176 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSFilePromiseProvider.rs @@ -0,0 +1,75 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSFilePromiseProvider; + + unsafe impl ClassType for NSFilePromiseProvider { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFilePromiseProvider { + #[method_id(@__retain_semantics Other fileType)] + pub unsafe fn fileType(&self) -> Id; + + #[method(setFileType:)] + pub unsafe fn setFileType(&self, fileType: &NSString); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSFilePromiseProviderDelegate>); + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + + #[method(setUserInfo:)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&Object>); + + #[method_id(@__retain_semantics Init initWithFileType:delegate:)] + pub unsafe fn initWithFileType_delegate( + this: Option>, + fileType: &NSString, + delegate: &NSFilePromiseProviderDelegate, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); + +extern_protocol!( + pub struct NSFilePromiseProviderDelegate; + + unsafe impl NSFilePromiseProviderDelegate { + #[method_id(@__retain_semantics Other filePromiseProvider:fileNameForType:)] + pub unsafe fn filePromiseProvider_fileNameForType( + &self, + filePromiseProvider: &NSFilePromiseProvider, + fileType: &NSString, + ) -> Id; + + #[method(filePromiseProvider:writePromiseToURL:completionHandler:)] + pub unsafe fn filePromiseProvider_writePromiseToURL_completionHandler( + &self, + filePromiseProvider: &NSFilePromiseProvider, + url: &NSURL, + completionHandler: &Block<(*mut NSError,), ()>, + ); + + #[optional] + #[method_id(@__retain_semantics Other operationQueueForFilePromiseProvider:)] + pub unsafe fn operationQueueForFilePromiseProvider( + &self, + filePromiseProvider: &NSFilePromiseProvider, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSFilePromiseReceiver.rs b/crates/icrate/src/generated/AppKit/NSFilePromiseReceiver.rs new file mode 100644 index 000000000..d16186265 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSFilePromiseReceiver.rs @@ -0,0 +1,37 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSFilePromiseReceiver; + + unsafe impl ClassType for NSFilePromiseReceiver { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFilePromiseReceiver { + #[method_id(@__retain_semantics Other readableDraggedTypes)] + pub unsafe fn readableDraggedTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other fileTypes)] + pub unsafe fn fileTypes(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other fileNames)] + pub unsafe fn fileNames(&self) -> Id, Shared>; + + #[method(receivePromisedFilesAtDestination:options:operationQueue:reader:)] + pub unsafe fn receivePromisedFilesAtDestination_options_operationQueue_reader( + &self, + destinationDir: &NSURL, + options: &NSDictionary, + operationQueue: &NSOperationQueue, + reader: &Block<(NonNull, *mut NSError), ()>, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSFileWrapperExtensions.rs b/crates/icrate/src/generated/AppKit/NSFileWrapperExtensions.rs new file mode 100644 index 000000000..a32edd1e4 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSFileWrapperExtensions.rs @@ -0,0 +1,17 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_methods!( + /// NSExtensions + unsafe impl NSFileWrapper { + #[method_id(@__retain_semantics Other icon)] + pub unsafe fn icon(&self) -> Option>; + + #[method(setIcon:)] + pub unsafe fn setIcon(&self, icon: Option<&NSImage>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSFont.rs b/crates/icrate/src/generated/AppKit/NSFont.rs new file mode 100644 index 000000000..781793478 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSFont.rs @@ -0,0 +1,299 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSFontIdentityMatrix: NonNull); + +extern_class!( + #[derive(Debug)] + pub struct NSFont; + + unsafe impl ClassType for NSFont { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFont { + #[method_id(@__retain_semantics Other fontWithName:size:)] + pub unsafe fn fontWithName_size( + fontName: &NSString, + fontSize: CGFloat, + ) -> Option>; + + #[method_id(@__retain_semantics Other fontWithName:matrix:)] + pub unsafe fn fontWithName_matrix( + fontName: &NSString, + fontMatrix: NonNull, + ) -> Option>; + + #[method_id(@__retain_semantics Other fontWithDescriptor:size:)] + pub unsafe fn fontWithDescriptor_size( + fontDescriptor: &NSFontDescriptor, + fontSize: CGFloat, + ) -> Option>; + + #[method_id(@__retain_semantics Other fontWithDescriptor:textTransform:)] + pub unsafe fn fontWithDescriptor_textTransform( + fontDescriptor: &NSFontDescriptor, + textTransform: Option<&NSAffineTransform>, + ) -> Option>; + + #[method_id(@__retain_semantics Other userFontOfSize:)] + pub unsafe fn userFontOfSize(fontSize: CGFloat) -> Option>; + + #[method_id(@__retain_semantics Other userFixedPitchFontOfSize:)] + pub unsafe fn userFixedPitchFontOfSize(fontSize: CGFloat) -> Option>; + + #[method(setUserFont:)] + pub unsafe fn setUserFont(font: Option<&NSFont>); + + #[method(setUserFixedPitchFont:)] + pub unsafe fn setUserFixedPitchFont(font: Option<&NSFont>); + + #[method_id(@__retain_semantics Other systemFontOfSize:)] + pub unsafe fn systemFontOfSize(fontSize: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other boldSystemFontOfSize:)] + pub unsafe fn boldSystemFontOfSize(fontSize: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other labelFontOfSize:)] + pub unsafe fn labelFontOfSize(fontSize: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other titleBarFontOfSize:)] + pub unsafe fn titleBarFontOfSize(fontSize: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other menuFontOfSize:)] + pub unsafe fn menuFontOfSize(fontSize: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other menuBarFontOfSize:)] + pub unsafe fn menuBarFontOfSize(fontSize: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other messageFontOfSize:)] + pub unsafe fn messageFontOfSize(fontSize: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other paletteFontOfSize:)] + pub unsafe fn paletteFontOfSize(fontSize: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other toolTipsFontOfSize:)] + pub unsafe fn toolTipsFontOfSize(fontSize: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other controlContentFontOfSize:)] + pub unsafe fn controlContentFontOfSize(fontSize: CGFloat) -> Id; + + #[method_id(@__retain_semantics Other systemFontOfSize:weight:)] + pub unsafe fn systemFontOfSize_weight( + fontSize: CGFloat, + weight: NSFontWeight, + ) -> Id; + + #[method_id(@__retain_semantics Other monospacedDigitSystemFontOfSize:weight:)] + pub unsafe fn monospacedDigitSystemFontOfSize_weight( + fontSize: CGFloat, + weight: NSFontWeight, + ) -> Id; + + #[method_id(@__retain_semantics Other monospacedSystemFontOfSize:weight:)] + pub unsafe fn monospacedSystemFontOfSize_weight( + fontSize: CGFloat, + weight: NSFontWeight, + ) -> Id; + + #[method_id(@__retain_semantics Other fontWithSize:)] + pub unsafe fn fontWithSize(&self, fontSize: CGFloat) -> Id; + + #[method(systemFontSize)] + pub unsafe fn systemFontSize() -> CGFloat; + + #[method(smallSystemFontSize)] + pub unsafe fn smallSystemFontSize() -> CGFloat; + + #[method(labelFontSize)] + pub unsafe fn labelFontSize() -> CGFloat; + + #[method(systemFontSizeForControlSize:)] + pub unsafe fn systemFontSizeForControlSize(controlSize: NSControlSize) -> CGFloat; + + #[method_id(@__retain_semantics Other fontName)] + pub unsafe fn fontName(&self) -> Id; + + #[method(pointSize)] + pub unsafe fn pointSize(&self) -> CGFloat; + + #[method(matrix)] + pub unsafe fn matrix(&self) -> NonNull; + + #[method_id(@__retain_semantics Other familyName)] + pub unsafe fn familyName(&self) -> Option>; + + #[method_id(@__retain_semantics Other displayName)] + pub unsafe fn displayName(&self) -> Option>; + + #[method_id(@__retain_semantics Other fontDescriptor)] + pub unsafe fn fontDescriptor(&self) -> Id; + + #[method_id(@__retain_semantics Other textTransform)] + pub unsafe fn textTransform(&self) -> Id; + + #[method(numberOfGlyphs)] + pub unsafe fn numberOfGlyphs(&self) -> NSUInteger; + + #[method(mostCompatibleStringEncoding)] + pub unsafe fn mostCompatibleStringEncoding(&self) -> NSStringEncoding; + + #[method_id(@__retain_semantics Other coveredCharacterSet)] + pub unsafe fn coveredCharacterSet(&self) -> Id; + + #[method(boundingRectForFont)] + pub unsafe fn boundingRectForFont(&self) -> NSRect; + + #[method(maximumAdvancement)] + pub unsafe fn maximumAdvancement(&self) -> NSSize; + + #[method(ascender)] + pub unsafe fn ascender(&self) -> CGFloat; + + #[method(descender)] + pub unsafe fn descender(&self) -> CGFloat; + + #[method(leading)] + pub unsafe fn leading(&self) -> CGFloat; + + #[method(underlinePosition)] + pub unsafe fn underlinePosition(&self) -> CGFloat; + + #[method(underlineThickness)] + pub unsafe fn underlineThickness(&self) -> CGFloat; + + #[method(italicAngle)] + pub unsafe fn italicAngle(&self) -> CGFloat; + + #[method(capHeight)] + pub unsafe fn capHeight(&self) -> CGFloat; + + #[method(xHeight)] + pub unsafe fn xHeight(&self) -> CGFloat; + + #[method(isFixedPitch)] + pub unsafe fn isFixedPitch(&self) -> bool; + + #[method(set)] + pub unsafe fn set(&self); + + #[method(setInContext:)] + pub unsafe fn setInContext(&self, graphicsContext: &NSGraphicsContext); + + #[method_id(@__retain_semantics Other verticalFont)] + pub unsafe fn verticalFont(&self) -> Id; + + #[method(isVertical)] + pub unsafe fn isVertical(&self) -> bool; + } +); + +extern_static!(NSAntialiasThresholdChangedNotification: &'static NSNotificationName); + +extern_static!(NSFontSetChangedNotification: &'static NSNotificationName); + +pub type NSGlyph = c_uint; + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSControlGlyph = 0x00FFFFFF, + NSNullGlyph = 0x0, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSFontRenderingMode { + NSFontDefaultRenderingMode = 0, + NSFontAntialiasedRenderingMode = 1, + NSFontIntegerAdvancementsRenderingMode = 2, + NSFontAntialiasedIntegerAdvancementsRenderingMode = 3, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSMultibyteGlyphPacking { + NSNativeShortGlyphPacking = 5, + } +); + +extern_fn!( + pub unsafe fn NSConvertGlyphsToPackedGlyphs( + glBuf: NonNull, + count: NSInteger, + packing: NSMultibyteGlyphPacking, + packedGlyphs: NonNull, + ) -> NSInteger; +); + +extern_methods!( + /// NSFont_Deprecated + unsafe impl NSFont { + #[method(glyphWithName:)] + pub unsafe fn glyphWithName(&self, name: &NSString) -> NSGlyph; + + #[method(boundingRectForGlyph:)] + pub unsafe fn boundingRectForGlyph(&self, glyph: NSGlyph) -> NSRect; + + #[method(advancementForGlyph:)] + pub unsafe fn advancementForGlyph(&self, glyph: NSGlyph) -> NSSize; + + #[method(getBoundingRects:forGlyphs:count:)] + pub unsafe fn getBoundingRects_forGlyphs_count( + &self, + bounds: NSRectArray, + glyphs: NonNull, + glyphCount: NSUInteger, + ); + + #[method(getAdvancements:forGlyphs:count:)] + pub unsafe fn getAdvancements_forGlyphs_count( + &self, + advancements: NSSizeArray, + glyphs: NonNull, + glyphCount: NSUInteger, + ); + + #[method(getAdvancements:forPackedGlyphs:length:)] + pub unsafe fn getAdvancements_forPackedGlyphs_length( + &self, + advancements: NSSizeArray, + packedGlyphs: NonNull, + length: NSUInteger, + ); + + #[method_id(@__retain_semantics Other printerFont)] + pub unsafe fn printerFont(&self) -> Id; + + #[method_id(@__retain_semantics Other screenFont)] + pub unsafe fn screenFont(&self) -> Id; + + #[method_id(@__retain_semantics Other screenFontWithRenderingMode:)] + pub unsafe fn screenFontWithRenderingMode( + &self, + renderingMode: NSFontRenderingMode, + ) -> Id; + + #[method(renderingMode)] + pub unsafe fn renderingMode(&self) -> NSFontRenderingMode; + } +); + +extern_methods!( + /// NSFont_TextStyles + unsafe impl NSFont { + #[method_id(@__retain_semantics Other preferredFontForTextStyle:options:)] + pub unsafe fn preferredFontForTextStyle_options( + style: &NSFontTextStyle, + options: &NSDictionary, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSFontAssetRequest.rs b/crates/icrate/src/generated/AppKit/NSFontAssetRequest.rs new file mode 100644 index 000000000..6972416d8 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSFontAssetRequest.rs @@ -0,0 +1,48 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFontAssetRequestOptions { + NSFontAssetRequestOptionUsesStandardUI = 1 << 0, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSFontAssetRequest; + + unsafe impl ClassType for NSFontAssetRequest { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFontAssetRequest { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithFontDescriptors:options:)] + pub unsafe fn initWithFontDescriptors_options( + this: Option>, + fontDescriptors: &NSArray, + options: NSFontAssetRequestOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other downloadedFontDescriptors)] + pub unsafe fn downloadedFontDescriptors(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other progress)] + pub unsafe fn progress(&self) -> Id; + + #[method(downloadFontAssetsWithCompletionHandler:)] + pub unsafe fn downloadFontAssetsWithCompletionHandler( + &self, + completionHandler: &Block<(*mut NSError,), Bool>, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSFontCollection.rs b/crates/icrate/src/generated/AppKit/NSFontCollection.rs new file mode 100644 index 000000000..62b4d459f --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSFontCollection.rs @@ -0,0 +1,207 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFontCollectionVisibility { + NSFontCollectionVisibilityProcess = 1 << 0, + NSFontCollectionVisibilityUser = 1 << 1, + NSFontCollectionVisibilityComputer = 1 << 2, + } +); + +pub type NSFontCollectionMatchingOptionKey = NSString; + +extern_static!( + NSFontCollectionIncludeDisabledFontsOption: &'static NSFontCollectionMatchingOptionKey +); + +extern_static!(NSFontCollectionRemoveDuplicatesOption: &'static NSFontCollectionMatchingOptionKey); + +extern_static!( + NSFontCollectionDisallowAutoActivationOption: &'static NSFontCollectionMatchingOptionKey +); + +pub type NSFontCollectionName = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSFontCollection; + + unsafe impl ClassType for NSFontCollection { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFontCollection { + #[method_id(@__retain_semantics Other fontCollectionWithDescriptors:)] + pub unsafe fn fontCollectionWithDescriptors( + queryDescriptors: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other fontCollectionWithAllAvailableDescriptors)] + pub unsafe fn fontCollectionWithAllAvailableDescriptors() -> Id; + + #[method_id(@__retain_semantics Other fontCollectionWithLocale:)] + pub unsafe fn fontCollectionWithLocale( + locale: &NSLocale, + ) -> Option>; + + #[method(showFontCollection:withName:visibility:error:)] + pub unsafe fn showFontCollection_withName_visibility_error( + collection: &NSFontCollection, + name: &NSFontCollectionName, + visibility: NSFontCollectionVisibility, + ) -> Result<(), Id>; + + #[method(hideFontCollectionWithName:visibility:error:)] + pub unsafe fn hideFontCollectionWithName_visibility_error( + name: &NSFontCollectionName, + visibility: NSFontCollectionVisibility, + ) -> Result<(), Id>; + + #[method(renameFontCollectionWithName:visibility:toName:error:)] + pub unsafe fn renameFontCollectionWithName_visibility_toName_error( + oldName: &NSFontCollectionName, + visibility: NSFontCollectionVisibility, + newName: &NSFontCollectionName, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other allFontCollectionNames)] + pub unsafe fn allFontCollectionNames() -> Id, Shared>; + + #[method_id(@__retain_semantics Other fontCollectionWithName:)] + pub unsafe fn fontCollectionWithName( + name: &NSFontCollectionName, + ) -> Option>; + + #[method_id(@__retain_semantics Other fontCollectionWithName:visibility:)] + pub unsafe fn fontCollectionWithName_visibility( + name: &NSFontCollectionName, + visibility: NSFontCollectionVisibility, + ) -> Option>; + + #[method_id(@__retain_semantics Other queryDescriptors)] + pub unsafe fn queryDescriptors(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other exclusionDescriptors)] + pub unsafe fn exclusionDescriptors(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other matchingDescriptors)] + pub unsafe fn matchingDescriptors(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other matchingDescriptorsWithOptions:)] + pub unsafe fn matchingDescriptorsWithOptions( + &self, + options: Option<&NSDictionary>, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other matchingDescriptorsForFamily:)] + pub unsafe fn matchingDescriptorsForFamily( + &self, + family: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other matchingDescriptorsForFamily:options:)] + pub unsafe fn matchingDescriptorsForFamily_options( + &self, + family: &NSString, + options: Option<&NSDictionary>, + ) -> Option, Shared>>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMutableFontCollection; + + unsafe impl ClassType for NSMutableFontCollection { + type Super = NSFontCollection; + } +); + +extern_methods!( + unsafe impl NSMutableFontCollection { + #[method_id(@__retain_semantics Other fontCollectionWithDescriptors:)] + pub unsafe fn fontCollectionWithDescriptors( + queryDescriptors: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other fontCollectionWithAllAvailableDescriptors)] + pub unsafe fn fontCollectionWithAllAvailableDescriptors( + ) -> Id; + + #[method_id(@__retain_semantics Other fontCollectionWithLocale:)] + pub unsafe fn fontCollectionWithLocale( + locale: &NSLocale, + ) -> Id; + + #[method_id(@__retain_semantics Other fontCollectionWithName:)] + pub unsafe fn fontCollectionWithName( + name: &NSFontCollectionName, + ) -> Option>; + + #[method_id(@__retain_semantics Other fontCollectionWithName:visibility:)] + pub unsafe fn fontCollectionWithName_visibility( + name: &NSFontCollectionName, + visibility: NSFontCollectionVisibility, + ) -> Option>; + + #[method_id(@__retain_semantics Other queryDescriptors)] + pub unsafe fn queryDescriptors(&self) -> Option, Shared>>; + + #[method(setQueryDescriptors:)] + pub unsafe fn setQueryDescriptors( + &self, + queryDescriptors: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other exclusionDescriptors)] + pub unsafe fn exclusionDescriptors(&self) -> Option, Shared>>; + + #[method(setExclusionDescriptors:)] + pub unsafe fn setExclusionDescriptors( + &self, + exclusionDescriptors: Option<&NSArray>, + ); + + #[method(addQueryForDescriptors:)] + pub unsafe fn addQueryForDescriptors(&self, descriptors: &NSArray); + + #[method(removeQueryForDescriptors:)] + pub unsafe fn removeQueryForDescriptors(&self, descriptors: &NSArray); + } +); + +extern_static!(NSFontCollectionDidChangeNotification: &'static NSNotificationName); + +pub type NSFontCollectionUserInfoKey = NSString; + +extern_static!(NSFontCollectionActionKey: &'static NSFontCollectionUserInfoKey); + +extern_static!(NSFontCollectionNameKey: &'static NSFontCollectionUserInfoKey); + +extern_static!(NSFontCollectionOldNameKey: &'static NSFontCollectionUserInfoKey); + +extern_static!(NSFontCollectionVisibilityKey: &'static NSFontCollectionUserInfoKey); + +pub type NSFontCollectionActionTypeKey = NSString; + +extern_static!(NSFontCollectionWasShown: &'static NSFontCollectionActionTypeKey); + +extern_static!(NSFontCollectionWasHidden: &'static NSFontCollectionActionTypeKey); + +extern_static!(NSFontCollectionWasRenamed: &'static NSFontCollectionActionTypeKey); + +extern_static!(NSFontCollectionAllFonts: &'static NSFontCollectionName); + +extern_static!(NSFontCollectionUser: &'static NSFontCollectionName); + +extern_static!(NSFontCollectionFavorites: &'static NSFontCollectionName); + +extern_static!(NSFontCollectionRecentlyUsed: &'static NSFontCollectionName); diff --git a/crates/icrate/src/generated/AppKit/NSFontDescriptor.rs b/crates/icrate/src/generated/AppKit/NSFontDescriptor.rs new file mode 100644 index 000000000..877cda83c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSFontDescriptor.rs @@ -0,0 +1,314 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSFontSymbolicTraits = u32; + +ns_options!( + #[underlying(u32)] + pub enum NSFontDescriptorSymbolicTraits { + NSFontDescriptorTraitItalic = 1 << 0, + NSFontDescriptorTraitBold = 1 << 1, + NSFontDescriptorTraitExpanded = 1 << 5, + NSFontDescriptorTraitCondensed = 1 << 6, + NSFontDescriptorTraitMonoSpace = 1 << 10, + NSFontDescriptorTraitVertical = 1 << 11, + NSFontDescriptorTraitUIOptimized = 1 << 12, + NSFontDescriptorTraitTightLeading = 1 << 15, + NSFontDescriptorTraitLooseLeading = 1 << 16, + NSFontDescriptorTraitEmphasized = NSFontDescriptorTraitBold, + NSFontDescriptorClassMask = 0xF0000000, + NSFontDescriptorClassUnknown = 0 << 28, + NSFontDescriptorClassOldStyleSerifs = 1 << 28, + NSFontDescriptorClassTransitionalSerifs = 2 << 28, + NSFontDescriptorClassModernSerifs = 3 << 28, + NSFontDescriptorClassClarendonSerifs = 4 << 28, + NSFontDescriptorClassSlabSerifs = 5 << 28, + NSFontDescriptorClassFreeformSerifs = 7 << 28, + NSFontDescriptorClassSansSerif = 8 << 28, + NSFontDescriptorClassOrnamentals = 9 << 28, + NSFontDescriptorClassScripts = 10 << 28, + NSFontDescriptorClassSymbolic = 12 << 28, + } +); + +pub type NSFontDescriptorAttributeName = NSString; + +pub type NSFontDescriptorTraitKey = NSString; + +pub type NSFontDescriptorVariationKey = NSString; + +pub type NSFontDescriptorFeatureKey = NSString; + +pub type NSFontWeight = CGFloat; + +pub type NSFontDescriptorSystemDesign = NSString; + +pub type NSFontTextStyle = NSString; + +pub type NSFontTextStyleOptionKey = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSFontDescriptor; + + unsafe impl ClassType for NSFontDescriptor { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFontDescriptor { + #[method_id(@__retain_semantics Other postscriptName)] + pub unsafe fn postscriptName(&self) -> Option>; + + #[method(pointSize)] + pub unsafe fn pointSize(&self) -> CGFloat; + + #[method_id(@__retain_semantics Other matrix)] + pub unsafe fn matrix(&self) -> Option>; + + #[method(symbolicTraits)] + pub unsafe fn symbolicTraits(&self) -> NSFontDescriptorSymbolicTraits; + + #[method(requiresFontAssetRequest)] + pub unsafe fn requiresFontAssetRequest(&self) -> bool; + + #[method_id(@__retain_semantics Other objectForKey:)] + pub unsafe fn objectForKey( + &self, + attribute: &NSFontDescriptorAttributeName, + ) -> Option>; + + #[method_id(@__retain_semantics Other fontAttributes)] + pub unsafe fn fontAttributes( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other fontDescriptorWithFontAttributes:)] + pub unsafe fn fontDescriptorWithFontAttributes( + attributes: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Other fontDescriptorWithName:size:)] + pub unsafe fn fontDescriptorWithName_size( + fontName: &NSString, + size: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other fontDescriptorWithName:matrix:)] + pub unsafe fn fontDescriptorWithName_matrix( + fontName: &NSString, + matrix: &NSAffineTransform, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithFontAttributes:)] + pub unsafe fn initWithFontAttributes( + this: Option>, + attributes: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Other matchingFontDescriptorsWithMandatoryKeys:)] + pub unsafe fn matchingFontDescriptorsWithMandatoryKeys( + &self, + mandatoryKeys: Option<&NSSet>, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other matchingFontDescriptorWithMandatoryKeys:)] + pub unsafe fn matchingFontDescriptorWithMandatoryKeys( + &self, + mandatoryKeys: Option<&NSSet>, + ) -> Option>; + + #[method_id(@__retain_semantics Other fontDescriptorByAddingAttributes:)] + pub unsafe fn fontDescriptorByAddingAttributes( + &self, + attributes: &NSDictionary, + ) -> Id; + + #[method_id(@__retain_semantics Other fontDescriptorWithSymbolicTraits:)] + pub unsafe fn fontDescriptorWithSymbolicTraits( + &self, + symbolicTraits: NSFontDescriptorSymbolicTraits, + ) -> Id; + + #[method_id(@__retain_semantics Other fontDescriptorWithSize:)] + pub unsafe fn fontDescriptorWithSize( + &self, + newPointSize: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other fontDescriptorWithMatrix:)] + pub unsafe fn fontDescriptorWithMatrix( + &self, + matrix: &NSAffineTransform, + ) -> Id; + + #[method_id(@__retain_semantics Other fontDescriptorWithFace:)] + pub unsafe fn fontDescriptorWithFace( + &self, + newFace: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other fontDescriptorWithFamily:)] + pub unsafe fn fontDescriptorWithFamily( + &self, + newFamily: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other fontDescriptorWithDesign:)] + pub unsafe fn fontDescriptorWithDesign( + &self, + design: &NSFontDescriptorSystemDesign, + ) -> Option>; + } +); + +extern_static!(NSFontFamilyAttribute: &'static NSFontDescriptorAttributeName); + +extern_static!(NSFontNameAttribute: &'static NSFontDescriptorAttributeName); + +extern_static!(NSFontFaceAttribute: &'static NSFontDescriptorAttributeName); + +extern_static!(NSFontSizeAttribute: &'static NSFontDescriptorAttributeName); + +extern_static!(NSFontVisibleNameAttribute: &'static NSFontDescriptorAttributeName); + +extern_static!(NSFontMatrixAttribute: &'static NSFontDescriptorAttributeName); + +extern_static!(NSFontVariationAttribute: &'static NSFontDescriptorAttributeName); + +extern_static!(NSFontCharacterSetAttribute: &'static NSFontDescriptorAttributeName); + +extern_static!(NSFontCascadeListAttribute: &'static NSFontDescriptorAttributeName); + +extern_static!(NSFontTraitsAttribute: &'static NSFontDescriptorAttributeName); + +extern_static!(NSFontFixedAdvanceAttribute: &'static NSFontDescriptorAttributeName); + +extern_static!(NSFontFeatureSettingsAttribute: &'static NSFontDescriptorAttributeName); + +extern_static!(NSFontSymbolicTrait: &'static NSFontDescriptorTraitKey); + +extern_static!(NSFontWeightTrait: &'static NSFontDescriptorTraitKey); + +extern_static!(NSFontWidthTrait: &'static NSFontDescriptorTraitKey); + +extern_static!(NSFontSlantTrait: &'static NSFontDescriptorTraitKey); + +extern_static!(NSFontVariationAxisIdentifierKey: &'static NSFontDescriptorVariationKey); + +extern_static!(NSFontVariationAxisMinimumValueKey: &'static NSFontDescriptorVariationKey); + +extern_static!(NSFontVariationAxisMaximumValueKey: &'static NSFontDescriptorVariationKey); + +extern_static!(NSFontVariationAxisDefaultValueKey: &'static NSFontDescriptorVariationKey); + +extern_static!(NSFontVariationAxisNameKey: &'static NSFontDescriptorVariationKey); + +extern_static!(NSFontFeatureTypeIdentifierKey: &'static NSFontDescriptorFeatureKey); + +extern_static!(NSFontFeatureSelectorIdentifierKey: &'static NSFontDescriptorFeatureKey); + +extern_static!(NSFontWeightUltraLight: NSFontWeight); + +extern_static!(NSFontWeightThin: NSFontWeight); + +extern_static!(NSFontWeightLight: NSFontWeight); + +extern_static!(NSFontWeightRegular: NSFontWeight); + +extern_static!(NSFontWeightMedium: NSFontWeight); + +extern_static!(NSFontWeightSemibold: NSFontWeight); + +extern_static!(NSFontWeightBold: NSFontWeight); + +extern_static!(NSFontWeightHeavy: NSFontWeight); + +extern_static!(NSFontWeightBlack: NSFontWeight); + +extern_static!(NSFontDescriptorSystemDesignDefault: &'static NSFontDescriptorSystemDesign); + +extern_static!(NSFontDescriptorSystemDesignSerif: &'static NSFontDescriptorSystemDesign); + +extern_static!(NSFontDescriptorSystemDesignMonospaced: &'static NSFontDescriptorSystemDesign); + +extern_static!(NSFontDescriptorSystemDesignRounded: &'static NSFontDescriptorSystemDesign); + +extern_static!(NSFontTextStyleLargeTitle: &'static NSFontTextStyle); + +extern_static!(NSFontTextStyleTitle1: &'static NSFontTextStyle); + +extern_static!(NSFontTextStyleTitle2: &'static NSFontTextStyle); + +extern_static!(NSFontTextStyleTitle3: &'static NSFontTextStyle); + +extern_static!(NSFontTextStyleHeadline: &'static NSFontTextStyle); + +extern_static!(NSFontTextStyleSubheadline: &'static NSFontTextStyle); + +extern_static!(NSFontTextStyleBody: &'static NSFontTextStyle); + +extern_static!(NSFontTextStyleCallout: &'static NSFontTextStyle); + +extern_static!(NSFontTextStyleFootnote: &'static NSFontTextStyle); + +extern_static!(NSFontTextStyleCaption1: &'static NSFontTextStyle); + +extern_static!(NSFontTextStyleCaption2: &'static NSFontTextStyle); + +pub type NSFontFamilyClass = u32; + +extern_enum!( + #[underlying(c_int)] + pub enum { + NSFontUnknownClass = 0<<28, + NSFontOldStyleSerifsClass = 1<<28, + NSFontTransitionalSerifsClass = 2<<28, + NSFontModernSerifsClass = 3<<28, + NSFontClarendonSerifsClass = 4<<28, + NSFontSlabSerifsClass = 5<<28, + NSFontFreeformSerifsClass = 7<<28, + NSFontSansSerifClass = 8<<28, + NSFontOrnamentalsClass = 9<<28, + NSFontScriptsClass = 10<<28, + NSFontSymbolicClass = 12<<28, + } +); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSFontFamilyClassMask = 0xF0000000, + } +); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSFontItalicTrait = 1<<0, + NSFontBoldTrait = 1<<1, + NSFontExpandedTrait = 1<<5, + NSFontCondensedTrait = 1<<6, + NSFontMonoSpaceTrait = 1<<10, + NSFontVerticalTrait = 1<<11, + NSFontUIOptimizedTrait = 1<<12, + } +); + +extern_static!(NSFontColorAttribute: &'static NSString); + +extern_methods!( + /// NSFontDescriptor_TextStyles + unsafe impl NSFontDescriptor { + #[method_id(@__retain_semantics Other preferredFontDescriptorForTextStyle:options:)] + pub unsafe fn preferredFontDescriptorForTextStyle_options( + style: &NSFontTextStyle, + options: &NSDictionary, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSFontManager.rs b/crates/icrate/src/generated/AppKit/NSFontManager.rs new file mode 100644 index 000000000..a6b48746b --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSFontManager.rs @@ -0,0 +1,305 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFontTraitMask { + NSItalicFontMask = 0x00000001, + NSBoldFontMask = 0x00000002, + NSUnboldFontMask = 0x00000004, + NSNonStandardCharacterSetFontMask = 0x00000008, + NSNarrowFontMask = 0x00000010, + NSExpandedFontMask = 0x00000020, + NSCondensedFontMask = 0x00000040, + NSSmallCapsFontMask = 0x00000080, + NSPosterFontMask = 0x00000100, + NSCompressedFontMask = 0x00000200, + NSFixedPitchFontMask = 0x00000400, + NSUnitalicFontMask = 0x01000000, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFontCollectionOptions { + NSFontCollectionApplicationOnlyMask = 1 << 0, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSFontAction { + NSNoFontChangeAction = 0, + NSViaPanelFontAction = 1, + NSAddTraitFontAction = 2, + NSSizeUpFontAction = 3, + NSSizeDownFontAction = 4, + NSHeavierFontAction = 5, + NSLighterFontAction = 6, + NSRemoveTraitFontAction = 7, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSFontManager; + + unsafe impl ClassType for NSFontManager { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFontManager { + #[method(setFontPanelFactory:)] + pub unsafe fn setFontPanelFactory(factoryId: Option<&Class>); + + #[method(setFontManagerFactory:)] + pub unsafe fn setFontManagerFactory(factoryId: Option<&Class>); + + #[method_id(@__retain_semantics Other sharedFontManager)] + pub unsafe fn sharedFontManager() -> Id; + + #[method(isMultiple)] + pub unsafe fn isMultiple(&self) -> bool; + + #[method_id(@__retain_semantics Other selectedFont)] + pub unsafe fn selectedFont(&self) -> Option>; + + #[method(setSelectedFont:isMultiple:)] + pub unsafe fn setSelectedFont_isMultiple(&self, fontObj: &NSFont, flag: bool); + + #[method(setFontMenu:)] + pub unsafe fn setFontMenu(&self, newMenu: &NSMenu); + + #[method_id(@__retain_semantics Other fontMenu:)] + pub unsafe fn fontMenu(&self, create: bool) -> Option>; + + #[method_id(@__retain_semantics Other fontPanel:)] + pub unsafe fn fontPanel(&self, create: bool) -> Option>; + + #[method_id(@__retain_semantics Other fontWithFamily:traits:weight:size:)] + pub unsafe fn fontWithFamily_traits_weight_size( + &self, + family: &NSString, + traits: NSFontTraitMask, + weight: NSInteger, + size: CGFloat, + ) -> Option>; + + #[method(traitsOfFont:)] + pub unsafe fn traitsOfFont(&self, fontObj: &NSFont) -> NSFontTraitMask; + + #[method(weightOfFont:)] + pub unsafe fn weightOfFont(&self, fontObj: &NSFont) -> NSInteger; + + #[method_id(@__retain_semantics Other availableFonts)] + pub unsafe fn availableFonts(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other availableFontFamilies)] + pub unsafe fn availableFontFamilies(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other availableMembersOfFontFamily:)] + pub unsafe fn availableMembersOfFontFamily( + &self, + fam: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other convertFont:)] + pub unsafe fn convertFont(&self, fontObj: &NSFont) -> Id; + + #[method_id(@__retain_semantics Other convertFont:toSize:)] + pub unsafe fn convertFont_toSize( + &self, + fontObj: &NSFont, + size: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other convertFont:toFace:)] + pub unsafe fn convertFont_toFace( + &self, + fontObj: &NSFont, + typeface: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other convertFont:toFamily:)] + pub unsafe fn convertFont_toFamily( + &self, + fontObj: &NSFont, + family: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other convertFont:toHaveTrait:)] + pub unsafe fn convertFont_toHaveTrait( + &self, + fontObj: &NSFont, + trait_: NSFontTraitMask, + ) -> Id; + + #[method_id(@__retain_semantics Other convertFont:toNotHaveTrait:)] + pub unsafe fn convertFont_toNotHaveTrait( + &self, + fontObj: &NSFont, + trait_: NSFontTraitMask, + ) -> Id; + + #[method_id(@__retain_semantics Other convertWeight:ofFont:)] + pub unsafe fn convertWeight_ofFont( + &self, + upFlag: bool, + fontObj: &NSFont, + ) -> Id; + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + + #[method(action)] + pub unsafe fn action(&self) -> Sel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: Sel); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&Object>); + + #[method(sendAction)] + pub unsafe fn sendAction(&self) -> bool; + + #[method_id(@__retain_semantics Other localizedNameForFamily:face:)] + pub unsafe fn localizedNameForFamily_face( + &self, + family: &NSString, + faceKey: Option<&NSString>, + ) -> Id; + + #[method(setSelectedAttributes:isMultiple:)] + pub unsafe fn setSelectedAttributes_isMultiple( + &self, + attributes: &NSDictionary, + flag: bool, + ); + + #[method_id(@__retain_semantics Other convertAttributes:)] + pub unsafe fn convertAttributes( + &self, + attributes: &NSDictionary, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other availableFontNamesMatchingFontDescriptor:)] + pub unsafe fn availableFontNamesMatchingFontDescriptor( + &self, + descriptor: &NSFontDescriptor, + ) -> Option>; + + #[method_id(@__retain_semantics Other collectionNames)] + pub unsafe fn collectionNames(&self) -> Id; + + #[method_id(@__retain_semantics Other fontDescriptorsInCollection:)] + pub unsafe fn fontDescriptorsInCollection( + &self, + collectionNames: &NSString, + ) -> Option>; + + #[method(addCollection:options:)] + pub unsafe fn addCollection_options( + &self, + collectionName: &NSString, + collectionOptions: NSFontCollectionOptions, + ) -> bool; + + #[method(removeCollection:)] + pub unsafe fn removeCollection(&self, collectionName: &NSString) -> bool; + + #[method(addFontDescriptors:toCollection:)] + pub unsafe fn addFontDescriptors_toCollection( + &self, + descriptors: &NSArray, + collectionName: &NSString, + ); + + #[method(removeFontDescriptor:fromCollection:)] + pub unsafe fn removeFontDescriptor_fromCollection( + &self, + descriptor: &NSFontDescriptor, + collection: &NSString, + ); + + #[method(currentFontAction)] + pub unsafe fn currentFontAction(&self) -> NSFontAction; + + #[method(convertFontTraits:)] + pub unsafe fn convertFontTraits(&self, traits: NSFontTraitMask) -> NSFontTraitMask; + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + } +); + +extern_methods!( + /// NSFontManagerMenuActionMethods + unsafe impl NSFontManager { + #[method(fontNamed:hasTraits:)] + pub unsafe fn fontNamed_hasTraits( + &self, + fName: &NSString, + someTraits: NSFontTraitMask, + ) -> bool; + + #[method_id(@__retain_semantics Other availableFontNamesWithTraits:)] + pub unsafe fn availableFontNamesWithTraits( + &self, + someTraits: NSFontTraitMask, + ) -> Option, Shared>>; + + #[method(addFontTrait:)] + pub unsafe fn addFontTrait(&self, sender: Option<&Object>); + + #[method(removeFontTrait:)] + pub unsafe fn removeFontTrait(&self, sender: Option<&Object>); + + #[method(modifyFontViaPanel:)] + pub unsafe fn modifyFontViaPanel(&self, sender: Option<&Object>); + + #[method(modifyFont:)] + pub unsafe fn modifyFont(&self, sender: Option<&Object>); + + #[method(orderFrontFontPanel:)] + pub unsafe fn orderFrontFontPanel(&self, sender: Option<&Object>); + + #[method(orderFrontStylesPanel:)] + pub unsafe fn orderFrontStylesPanel(&self, sender: Option<&Object>); + } +); + +extern_methods!( + /// NSFontManagerDelegate + unsafe impl NSObject { + #[method(fontManager:willIncludeFont:)] + pub unsafe fn fontManager_willIncludeFont( + &self, + sender: &Object, + fontName: &NSString, + ) -> bool; + } +); + +extern_methods!( + /// NSFontManagerResponderMethod + unsafe impl NSObject { + #[method(changeFont:)] + pub unsafe fn changeFont(&self, sender: Option<&Object>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSFontPanel.rs b/crates/icrate/src/generated/AppKit/NSFontPanel.rs new file mode 100644 index 000000000..de6e86d54 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSFontPanel.rs @@ -0,0 +1,123 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFontPanelModeMask { + NSFontPanelModeMaskFace = 1 << 0, + NSFontPanelModeMaskSize = 1 << 1, + NSFontPanelModeMaskCollection = 1 << 2, + NSFontPanelModeMaskUnderlineEffect = 1 << 8, + NSFontPanelModeMaskStrikethroughEffect = 1 << 9, + NSFontPanelModeMaskTextColorEffect = 1 << 10, + NSFontPanelModeMaskDocumentColorEffect = 1 << 11, + NSFontPanelModeMaskShadowEffect = 1 << 12, + NSFontPanelModeMaskAllEffects = 0xFFF00, + NSFontPanelModesMaskStandardModes = 0xFFFF, + NSFontPanelModesMaskAllModes = 0xFFFFFFFF, + } +); + +extern_protocol!( + pub struct NSFontChanging; + + unsafe impl NSFontChanging { + #[optional] + #[method(changeFont:)] + pub unsafe fn changeFont(&self, sender: Option<&NSFontManager>); + + #[optional] + #[method(validModesForFontPanel:)] + pub unsafe fn validModesForFontPanel(&self, fontPanel: &NSFontPanel) + -> NSFontPanelModeMask; + } +); + +extern_methods!( + /// NSFontPanelValidationAdditions + unsafe impl NSObject { + #[method(validModesForFontPanel:)] + pub unsafe fn validModesForFontPanel(&self, fontPanel: &NSFontPanel) + -> NSFontPanelModeMask; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSFontPanel; + + unsafe impl ClassType for NSFontPanel { + type Super = NSPanel; + } +); + +extern_methods!( + unsafe impl NSFontPanel { + #[method_id(@__retain_semantics Other sharedFontPanel)] + pub unsafe fn sharedFontPanel() -> Id; + + #[method(sharedFontPanelExists)] + pub unsafe fn sharedFontPanelExists() -> bool; + + #[method_id(@__retain_semantics Other accessoryView)] + pub unsafe fn accessoryView(&self) -> Option>; + + #[method(setAccessoryView:)] + pub unsafe fn setAccessoryView(&self, accessoryView: Option<&NSView>); + + #[method(setPanelFont:isMultiple:)] + pub unsafe fn setPanelFont_isMultiple(&self, fontObj: &NSFont, flag: bool); + + #[method_id(@__retain_semantics Other panelConvertFont:)] + pub unsafe fn panelConvertFont(&self, fontObj: &NSFont) -> Id; + + #[method(worksWhenModal)] + pub unsafe fn worksWhenModal(&self) -> bool; + + #[method(setWorksWhenModal:)] + pub unsafe fn setWorksWhenModal(&self, worksWhenModal: bool); + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + + #[method(reloadDefaultFontFamilies)] + pub unsafe fn reloadDefaultFontFamilies(&self); + } +); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSFontPanelFaceModeMask = 1<<0, + NSFontPanelSizeModeMask = 1<<1, + NSFontPanelCollectionModeMask = 1<<2, + NSFontPanelUnderlineEffectModeMask = 1<<8, + NSFontPanelStrikethroughEffectModeMask = 1<<9, + NSFontPanelTextColorEffectModeMask = 1<<10, + NSFontPanelDocumentColorEffectModeMask = 1<<11, + NSFontPanelShadowEffectModeMask = 1<<12, + NSFontPanelAllEffectsModeMask = 0xFFF00, + NSFontPanelStandardModesMask = 0xFFFF, + NSFontPanelAllModesMask = 0xFFFFFFFF, + } +); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSFPPreviewButton = 131, + NSFPRevertButton = 130, + NSFPSetButton = 132, + NSFPPreviewField = 128, + NSFPSizeField = 129, + NSFPSizeTitle = 133, + NSFPCurrentField = 134, + } +); diff --git a/crates/icrate/src/generated/AppKit/NSForm.rs b/crates/icrate/src/generated/AppKit/NSForm.rs new file mode 100644 index 000000000..71c8a0951 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSForm.rs @@ -0,0 +1,86 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSForm; + + unsafe impl ClassType for NSForm { + type Super = NSMatrix; + } +); + +extern_methods!( + unsafe impl NSForm { + #[method(indexOfSelectedItem)] + pub unsafe fn indexOfSelectedItem(&self) -> NSInteger; + + #[method(setEntryWidth:)] + pub unsafe fn setEntryWidth(&self, width: CGFloat); + + #[method(setInterlineSpacing:)] + pub unsafe fn setInterlineSpacing(&self, spacing: CGFloat); + + #[method(setBordered:)] + pub unsafe fn setBordered(&self, flag: bool); + + #[method(setBezeled:)] + pub unsafe fn setBezeled(&self, flag: bool); + + #[method(setTitleAlignment:)] + pub unsafe fn setTitleAlignment(&self, mode: NSTextAlignment); + + #[method(setTextAlignment:)] + pub unsafe fn setTextAlignment(&self, mode: NSTextAlignment); + + #[method(setTitleFont:)] + pub unsafe fn setTitleFont(&self, fontObj: &NSFont); + + #[method(setTextFont:)] + pub unsafe fn setTextFont(&self, fontObj: &NSFont); + + #[method_id(@__retain_semantics Other cellAtIndex:)] + pub unsafe fn cellAtIndex(&self, index: NSInteger) -> Option>; + + #[method(drawCellAtIndex:)] + pub unsafe fn drawCellAtIndex(&self, index: NSInteger); + + #[method_id(@__retain_semantics Other addEntry:)] + pub unsafe fn addEntry(&self, title: &NSString) -> Id; + + #[method_id(@__retain_semantics Other insertEntry:atIndex:)] + pub unsafe fn insertEntry_atIndex( + &self, + title: &NSString, + index: NSInteger, + ) -> Option>; + + #[method(removeEntryAtIndex:)] + pub unsafe fn removeEntryAtIndex(&self, index: NSInteger); + + #[method(indexOfCellWithTag:)] + pub unsafe fn indexOfCellWithTag(&self, tag: NSInteger) -> NSInteger; + + #[method(selectTextAtIndex:)] + pub unsafe fn selectTextAtIndex(&self, index: NSInteger); + + #[method(setFrameSize:)] + pub unsafe fn setFrameSize(&self, newSize: NSSize); + + #[method(setTitleBaseWritingDirection:)] + pub unsafe fn setTitleBaseWritingDirection(&self, writingDirection: NSWritingDirection); + + #[method(setTextBaseWritingDirection:)] + pub unsafe fn setTextBaseWritingDirection(&self, writingDirection: NSWritingDirection); + + #[method(setPreferredTextFieldWidth:)] + pub unsafe fn setPreferredTextFieldWidth(&self, preferredWidth: CGFloat); + + #[method(preferredTextFieldWidth)] + pub unsafe fn preferredTextFieldWidth(&self) -> CGFloat; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSFormCell.rs b/crates/icrate/src/generated/AppKit/NSFormCell.rs new file mode 100644 index 000000000..6b55b0853 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSFormCell.rs @@ -0,0 +1,113 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSFormCell; + + unsafe impl ClassType for NSFormCell { + type Super = NSActionCell; + } +); + +extern_methods!( + unsafe impl NSFormCell { + #[method_id(@__retain_semantics Init initTextCell:)] + pub unsafe fn initTextCell( + this: Option>, + string: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Init initImageCell:)] + pub unsafe fn initImageCell( + this: Option>, + image: Option<&NSImage>, + ) -> Id; + + #[method(titleWidth)] + pub unsafe fn titleWidth(&self) -> CGFloat; + + #[method(setTitleWidth:)] + pub unsafe fn setTitleWidth(&self, titleWidth: CGFloat); + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + + #[method_id(@__retain_semantics Other titleFont)] + pub unsafe fn titleFont(&self) -> Id; + + #[method(setTitleFont:)] + pub unsafe fn setTitleFont(&self, titleFont: &NSFont); + + #[method(isOpaque)] + pub unsafe fn isOpaque(&self) -> bool; + + #[method_id(@__retain_semantics Other placeholderString)] + pub unsafe fn placeholderString(&self) -> Option>; + + #[method(setPlaceholderString:)] + pub unsafe fn setPlaceholderString(&self, placeholderString: Option<&NSString>); + + #[method_id(@__retain_semantics Other placeholderAttributedString)] + pub unsafe fn placeholderAttributedString(&self) -> Option>; + + #[method(setPlaceholderAttributedString:)] + pub unsafe fn setPlaceholderAttributedString( + &self, + placeholderAttributedString: Option<&NSAttributedString>, + ); + + #[method(titleAlignment)] + pub unsafe fn titleAlignment(&self) -> NSTextAlignment; + + #[method(setTitleAlignment:)] + pub unsafe fn setTitleAlignment(&self, titleAlignment: NSTextAlignment); + + #[method(titleBaseWritingDirection)] + pub unsafe fn titleBaseWritingDirection(&self) -> NSWritingDirection; + + #[method(setTitleBaseWritingDirection:)] + pub unsafe fn setTitleBaseWritingDirection( + &self, + titleBaseWritingDirection: NSWritingDirection, + ); + + #[method(preferredTextFieldWidth)] + pub unsafe fn preferredTextFieldWidth(&self) -> CGFloat; + + #[method(setPreferredTextFieldWidth:)] + pub unsafe fn setPreferredTextFieldWidth(&self, preferredTextFieldWidth: CGFloat); + } +); + +extern_methods!( + /// NSKeyboardUI + unsafe impl NSFormCell { + #[method(setTitleWithMnemonic:)] + pub unsafe fn setTitleWithMnemonic(&self, stringWithAmpersand: Option<&NSString>); + } +); + +extern_methods!( + /// NSFormCellAttributedStringMethods + unsafe impl NSFormCell { + #[method_id(@__retain_semantics Other attributedTitle)] + pub unsafe fn attributedTitle(&self) -> Id; + + #[method(setAttributedTitle:)] + pub unsafe fn setAttributedTitle(&self, attributedTitle: &NSAttributedString); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSGestureRecognizer.rs b/crates/icrate/src/generated/AppKit/NSGestureRecognizer.rs new file mode 100644 index 000000000..9045d9717 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSGestureRecognizer.rs @@ -0,0 +1,282 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSGestureRecognizerState { + NSGestureRecognizerStatePossible = 0, + NSGestureRecognizerStateBegan = 1, + NSGestureRecognizerStateChanged = 2, + NSGestureRecognizerStateEnded = 3, + NSGestureRecognizerStateCancelled = 4, + NSGestureRecognizerStateFailed = 5, + NSGestureRecognizerStateRecognized = NSGestureRecognizerStateEnded, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSGestureRecognizer; + + unsafe impl ClassType for NSGestureRecognizer { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSGestureRecognizer { + #[method_id(@__retain_semantics Init initWithTarget:action:)] + pub unsafe fn initWithTarget_action( + this: Option>, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: OptionSel); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSGestureRecognizerDelegate>); + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + + #[method_id(@__retain_semantics Other view)] + pub unsafe fn view(&self) -> Option>; + + #[method_id(@__retain_semantics Other pressureConfiguration)] + pub unsafe fn pressureConfiguration(&self) -> Id; + + #[method(setPressureConfiguration:)] + pub unsafe fn setPressureConfiguration( + &self, + pressureConfiguration: &NSPressureConfiguration, + ); + + #[method(delaysPrimaryMouseButtonEvents)] + pub unsafe fn delaysPrimaryMouseButtonEvents(&self) -> bool; + + #[method(setDelaysPrimaryMouseButtonEvents:)] + pub unsafe fn setDelaysPrimaryMouseButtonEvents( + &self, + delaysPrimaryMouseButtonEvents: bool, + ); + + #[method(delaysSecondaryMouseButtonEvents)] + pub unsafe fn delaysSecondaryMouseButtonEvents(&self) -> bool; + + #[method(setDelaysSecondaryMouseButtonEvents:)] + pub unsafe fn setDelaysSecondaryMouseButtonEvents( + &self, + delaysSecondaryMouseButtonEvents: bool, + ); + + #[method(delaysOtherMouseButtonEvents)] + pub unsafe fn delaysOtherMouseButtonEvents(&self) -> bool; + + #[method(setDelaysOtherMouseButtonEvents:)] + pub unsafe fn setDelaysOtherMouseButtonEvents(&self, delaysOtherMouseButtonEvents: bool); + + #[method(delaysKeyEvents)] + pub unsafe fn delaysKeyEvents(&self) -> bool; + + #[method(setDelaysKeyEvents:)] + pub unsafe fn setDelaysKeyEvents(&self, delaysKeyEvents: bool); + + #[method(delaysMagnificationEvents)] + pub unsafe fn delaysMagnificationEvents(&self) -> bool; + + #[method(setDelaysMagnificationEvents:)] + pub unsafe fn setDelaysMagnificationEvents(&self, delaysMagnificationEvents: bool); + + #[method(delaysRotationEvents)] + pub unsafe fn delaysRotationEvents(&self) -> bool; + + #[method(setDelaysRotationEvents:)] + pub unsafe fn setDelaysRotationEvents(&self, delaysRotationEvents: bool); + + #[method(locationInView:)] + pub unsafe fn locationInView(&self, view: Option<&NSView>) -> NSPoint; + } +); + +extern_methods!( + /// NSTouchBar + unsafe impl NSGestureRecognizer { + #[method(allowedTouchTypes)] + pub unsafe fn allowedTouchTypes(&self) -> NSTouchTypeMask; + + #[method(setAllowedTouchTypes:)] + pub unsafe fn setAllowedTouchTypes(&self, allowedTouchTypes: NSTouchTypeMask); + } +); + +extern_protocol!( + pub struct NSGestureRecognizerDelegate; + + unsafe impl NSGestureRecognizerDelegate { + #[optional] + #[method(gestureRecognizer:shouldAttemptToRecognizeWithEvent:)] + pub unsafe fn gestureRecognizer_shouldAttemptToRecognizeWithEvent( + &self, + gestureRecognizer: &NSGestureRecognizer, + event: &NSEvent, + ) -> bool; + + #[optional] + #[method(gestureRecognizerShouldBegin:)] + pub unsafe fn gestureRecognizerShouldBegin( + &self, + gestureRecognizer: &NSGestureRecognizer, + ) -> bool; + + #[optional] + #[method(gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:)] + pub unsafe fn gestureRecognizer_shouldRecognizeSimultaneouslyWithGestureRecognizer( + &self, + gestureRecognizer: &NSGestureRecognizer, + otherGestureRecognizer: &NSGestureRecognizer, + ) -> bool; + + #[optional] + #[method(gestureRecognizer:shouldRequireFailureOfGestureRecognizer:)] + pub unsafe fn gestureRecognizer_shouldRequireFailureOfGestureRecognizer( + &self, + gestureRecognizer: &NSGestureRecognizer, + otherGestureRecognizer: &NSGestureRecognizer, + ) -> bool; + + #[optional] + #[method(gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:)] + pub unsafe fn gestureRecognizer_shouldBeRequiredToFailByGestureRecognizer( + &self, + gestureRecognizer: &NSGestureRecognizer, + otherGestureRecognizer: &NSGestureRecognizer, + ) -> bool; + + #[optional] + #[method(gestureRecognizer:shouldReceiveTouch:)] + pub unsafe fn gestureRecognizer_shouldReceiveTouch( + &self, + gestureRecognizer: &NSGestureRecognizer, + touch: &NSTouch, + ) -> bool; + } +); + +extern_methods!( + /// NSSubclassUse + unsafe impl NSGestureRecognizer { + #[method(reset)] + pub unsafe fn reset(&self); + + #[method(canPreventGestureRecognizer:)] + pub unsafe fn canPreventGestureRecognizer( + &self, + preventedGestureRecognizer: &NSGestureRecognizer, + ) -> bool; + + #[method(canBePreventedByGestureRecognizer:)] + pub unsafe fn canBePreventedByGestureRecognizer( + &self, + preventingGestureRecognizer: &NSGestureRecognizer, + ) -> bool; + + #[method(shouldRequireFailureOfGestureRecognizer:)] + pub unsafe fn shouldRequireFailureOfGestureRecognizer( + &self, + otherGestureRecognizer: &NSGestureRecognizer, + ) -> bool; + + #[method(shouldBeRequiredToFailByGestureRecognizer:)] + pub unsafe fn shouldBeRequiredToFailByGestureRecognizer( + &self, + otherGestureRecognizer: &NSGestureRecognizer, + ) -> bool; + + #[method(mouseDown:)] + pub unsafe fn mouseDown(&self, event: &NSEvent); + + #[method(rightMouseDown:)] + pub unsafe fn rightMouseDown(&self, event: &NSEvent); + + #[method(otherMouseDown:)] + pub unsafe fn otherMouseDown(&self, event: &NSEvent); + + #[method(mouseUp:)] + pub unsafe fn mouseUp(&self, event: &NSEvent); + + #[method(rightMouseUp:)] + pub unsafe fn rightMouseUp(&self, event: &NSEvent); + + #[method(otherMouseUp:)] + pub unsafe fn otherMouseUp(&self, event: &NSEvent); + + #[method(mouseDragged:)] + pub unsafe fn mouseDragged(&self, event: &NSEvent); + + #[method(rightMouseDragged:)] + pub unsafe fn rightMouseDragged(&self, event: &NSEvent); + + #[method(otherMouseDragged:)] + pub unsafe fn otherMouseDragged(&self, event: &NSEvent); + + #[method(keyDown:)] + pub unsafe fn keyDown(&self, event: &NSEvent); + + #[method(keyUp:)] + pub unsafe fn keyUp(&self, event: &NSEvent); + + #[method(flagsChanged:)] + pub unsafe fn flagsChanged(&self, event: &NSEvent); + + #[method(tabletPoint:)] + pub unsafe fn tabletPoint(&self, event: &NSEvent); + + #[method(magnifyWithEvent:)] + pub unsafe fn magnifyWithEvent(&self, event: &NSEvent); + + #[method(rotateWithEvent:)] + pub unsafe fn rotateWithEvent(&self, event: &NSEvent); + + #[method(pressureChangeWithEvent:)] + pub unsafe fn pressureChangeWithEvent(&self, event: &NSEvent); + + #[method(touchesBeganWithEvent:)] + pub unsafe fn touchesBeganWithEvent(&self, event: &NSEvent); + + #[method(touchesMovedWithEvent:)] + pub unsafe fn touchesMovedWithEvent(&self, event: &NSEvent); + + #[method(touchesEndedWithEvent:)] + pub unsafe fn touchesEndedWithEvent(&self, event: &NSEvent); + + #[method(touchesCancelledWithEvent:)] + pub unsafe fn touchesCancelledWithEvent(&self, event: &NSEvent); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSGlyphGenerator.rs b/crates/icrate/src/generated/AppKit/NSGlyphGenerator.rs new file mode 100644 index 000000000..45be3bd00 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSGlyphGenerator.rs @@ -0,0 +1,69 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSShowControlGlyphs = 1<<0, + NSShowInvisibleGlyphs = 1<<1, + NSWantsBidiLevels = 1<<2, + } +); + +extern_protocol!( + pub struct NSGlyphStorage; + + unsafe impl NSGlyphStorage { + #[method(insertGlyphs:length:forStartingGlyphAtIndex:characterIndex:)] + pub unsafe fn insertGlyphs_length_forStartingGlyphAtIndex_characterIndex( + &self, + glyphs: NonNull, + length: NSUInteger, + glyphIndex: NSUInteger, + charIndex: NSUInteger, + ); + + #[method(setIntAttribute:value:forGlyphAtIndex:)] + pub unsafe fn setIntAttribute_value_forGlyphAtIndex( + &self, + attributeTag: NSInteger, + val: NSInteger, + glyphIndex: NSUInteger, + ); + + #[method_id(@__retain_semantics Other attributedString)] + pub unsafe fn attributedString(&self) -> Id; + + #[method(layoutOptions)] + pub unsafe fn layoutOptions(&self) -> NSUInteger; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSGlyphGenerator; + + unsafe impl ClassType for NSGlyphGenerator { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSGlyphGenerator { + #[method(generateGlyphsForGlyphStorage:desiredNumberOfCharacters:glyphIndex:characterIndex:)] + pub unsafe fn generateGlyphsForGlyphStorage_desiredNumberOfCharacters_glyphIndex_characterIndex( + &self, + glyphStorage: &NSGlyphStorage, + nChars: NSUInteger, + glyphIndex: *mut NSUInteger, + charIndex: *mut NSUInteger, + ); + + #[method_id(@__retain_semantics Other sharedGlyphGenerator)] + pub unsafe fn sharedGlyphGenerator() -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSGlyphInfo.rs b/crates/icrate/src/generated/AppKit/NSGlyphInfo.rs new file mode 100644 index 000000000..336f5cf28 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSGlyphInfo.rs @@ -0,0 +1,69 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSGlyphInfo; + + unsafe impl ClassType for NSGlyphInfo { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSGlyphInfo { + #[method_id(@__retain_semantics Other baseString)] + pub unsafe fn baseString(&self) -> Id; + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSCharacterCollection { + NSIdentityMappingCharacterCollection = 0, + NSAdobeCNS1CharacterCollection = 1, + NSAdobeGB1CharacterCollection = 2, + NSAdobeJapan1CharacterCollection = 3, + NSAdobeJapan2CharacterCollection = 4, + NSAdobeKorea1CharacterCollection = 5, + } +); + +extern_methods!( + /// NSGlyphInfo_Deprecated + unsafe impl NSGlyphInfo { + #[method_id(@__retain_semantics Other glyphInfoWithGlyphName:forFont:baseString:)] + pub unsafe fn glyphInfoWithGlyphName_forFont_baseString( + glyphName: &NSString, + font: &NSFont, + string: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other glyphInfoWithGlyph:forFont:baseString:)] + pub unsafe fn glyphInfoWithGlyph_forFont_baseString( + glyph: NSGlyph, + font: &NSFont, + string: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other glyphInfoWithCharacterIdentifier:collection:baseString:)] + pub unsafe fn glyphInfoWithCharacterIdentifier_collection_baseString( + cid: NSUInteger, + characterCollection: NSCharacterCollection, + string: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other glyphName)] + pub unsafe fn glyphName(&self) -> Option>; + + #[method(characterIdentifier)] + pub unsafe fn characterIdentifier(&self) -> NSUInteger; + + #[method(characterCollection)] + pub unsafe fn characterCollection(&self) -> NSCharacterCollection; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSGradient.rs b/crates/icrate/src/generated/AppKit/NSGradient.rs new file mode 100644 index 000000000..9276f0caa --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSGradient.rs @@ -0,0 +1,109 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSGradientDrawingOptions { + NSGradientDrawsBeforeStartingLocation = 1 << 0, + NSGradientDrawsAfterEndingLocation = 1 << 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSGradient; + + unsafe impl ClassType for NSGradient { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSGradient { + #[method_id(@__retain_semantics Init initWithStartingColor:endingColor:)] + pub unsafe fn initWithStartingColor_endingColor( + this: Option>, + startingColor: &NSColor, + endingColor: &NSColor, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithColors:)] + pub unsafe fn initWithColors( + this: Option>, + colorArray: &NSArray, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithColors:atLocations:colorSpace:)] + pub unsafe fn initWithColors_atLocations_colorSpace( + this: Option>, + colorArray: &NSArray, + locations: *mut CGFloat, + colorSpace: &NSColorSpace, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method(drawFromPoint:toPoint:options:)] + pub unsafe fn drawFromPoint_toPoint_options( + &self, + startingPoint: NSPoint, + endingPoint: NSPoint, + options: NSGradientDrawingOptions, + ); + + #[method(drawInRect:angle:)] + pub unsafe fn drawInRect_angle(&self, rect: NSRect, angle: CGFloat); + + #[method(drawInBezierPath:angle:)] + pub unsafe fn drawInBezierPath_angle(&self, path: &NSBezierPath, angle: CGFloat); + + #[method(drawFromCenter:radius:toCenter:radius:options:)] + pub unsafe fn drawFromCenter_radius_toCenter_radius_options( + &self, + startCenter: NSPoint, + startRadius: CGFloat, + endCenter: NSPoint, + endRadius: CGFloat, + options: NSGradientDrawingOptions, + ); + + #[method(drawInRect:relativeCenterPosition:)] + pub unsafe fn drawInRect_relativeCenterPosition( + &self, + rect: NSRect, + relativeCenterPosition: NSPoint, + ); + + #[method(drawInBezierPath:relativeCenterPosition:)] + pub unsafe fn drawInBezierPath_relativeCenterPosition( + &self, + path: &NSBezierPath, + relativeCenterPosition: NSPoint, + ); + + #[method_id(@__retain_semantics Other colorSpace)] + pub unsafe fn colorSpace(&self) -> Id; + + #[method(numberOfColorStops)] + pub unsafe fn numberOfColorStops(&self) -> NSInteger; + + #[method(getColor:location:atIndex:)] + pub unsafe fn getColor_location_atIndex( + &self, + color: *mut NonNull, + location: *mut CGFloat, + index: NSInteger, + ); + + #[method_id(@__retain_semantics Other interpolatedColorAtLocation:)] + pub unsafe fn interpolatedColorAtLocation(&self, location: CGFloat) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSGraphics.rs b/crates/icrate/src/generated/AppKit/NSGraphics.rs new file mode 100644 index 000000000..007bc8efd --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSGraphics.rs @@ -0,0 +1,466 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSCompositingOperation { + NSCompositingOperationClear = 0, + NSCompositingOperationCopy = 1, + NSCompositingOperationSourceOver = 2, + NSCompositingOperationSourceIn = 3, + NSCompositingOperationSourceOut = 4, + NSCompositingOperationSourceAtop = 5, + NSCompositingOperationDestinationOver = 6, + NSCompositingOperationDestinationIn = 7, + NSCompositingOperationDestinationOut = 8, + NSCompositingOperationDestinationAtop = 9, + NSCompositingOperationXOR = 10, + NSCompositingOperationPlusDarker = 11, + NSCompositingOperationHighlight = 12, + NSCompositingOperationPlusLighter = 13, + NSCompositingOperationMultiply = 14, + NSCompositingOperationScreen = 15, + NSCompositingOperationOverlay = 16, + NSCompositingOperationDarken = 17, + NSCompositingOperationLighten = 18, + NSCompositingOperationColorDodge = 19, + NSCompositingOperationColorBurn = 20, + NSCompositingOperationSoftLight = 21, + NSCompositingOperationHardLight = 22, + NSCompositingOperationDifference = 23, + NSCompositingOperationExclusion = 24, + NSCompositingOperationHue = 25, + NSCompositingOperationSaturation = 26, + NSCompositingOperationColor = 27, + NSCompositingOperationLuminosity = 28, + } +); + +extern_static!(NSCompositeClear: NSCompositingOperation = NSCompositingOperationClear); + +extern_static!(NSCompositeCopy: NSCompositingOperation = NSCompositingOperationCopy); + +extern_static!(NSCompositeSourceOver: NSCompositingOperation = NSCompositingOperationSourceOver); + +extern_static!(NSCompositeSourceIn: NSCompositingOperation = NSCompositingOperationSourceIn); + +extern_static!(NSCompositeSourceOut: NSCompositingOperation = NSCompositingOperationSourceOut); + +extern_static!(NSCompositeSourceAtop: NSCompositingOperation = NSCompositingOperationSourceAtop); + +extern_static!( + NSCompositeDestinationOver: NSCompositingOperation = NSCompositingOperationDestinationOver +); + +extern_static!( + NSCompositeDestinationIn: NSCompositingOperation = NSCompositingOperationDestinationIn +); + +extern_static!( + NSCompositeDestinationOut: NSCompositingOperation = NSCompositingOperationDestinationOut +); + +extern_static!( + NSCompositeDestinationAtop: NSCompositingOperation = NSCompositingOperationDestinationAtop +); + +extern_static!(NSCompositeXOR: NSCompositingOperation = NSCompositingOperationXOR); + +extern_static!(NSCompositePlusDarker: NSCompositingOperation = NSCompositingOperationPlusDarker); + +extern_static!(NSCompositeHighlight: NSCompositingOperation = NSCompositingOperationHighlight); + +extern_static!(NSCompositePlusLighter: NSCompositingOperation = NSCompositingOperationPlusLighter); + +extern_static!(NSCompositeMultiply: NSCompositingOperation = NSCompositingOperationMultiply); + +extern_static!(NSCompositeScreen: NSCompositingOperation = NSCompositingOperationScreen); + +extern_static!(NSCompositeOverlay: NSCompositingOperation = NSCompositingOperationOverlay); + +extern_static!(NSCompositeDarken: NSCompositingOperation = NSCompositingOperationDarken); + +extern_static!(NSCompositeLighten: NSCompositingOperation = NSCompositingOperationLighten); + +extern_static!(NSCompositeColorDodge: NSCompositingOperation = NSCompositingOperationColorDodge); + +extern_static!(NSCompositeColorBurn: NSCompositingOperation = NSCompositingOperationColorBurn); + +extern_static!(NSCompositeSoftLight: NSCompositingOperation = NSCompositingOperationSoftLight); + +extern_static!(NSCompositeHardLight: NSCompositingOperation = NSCompositingOperationHardLight); + +extern_static!(NSCompositeDifference: NSCompositingOperation = NSCompositingOperationDifference); + +extern_static!(NSCompositeExclusion: NSCompositingOperation = NSCompositingOperationExclusion); + +extern_static!(NSCompositeHue: NSCompositingOperation = NSCompositingOperationHue); + +extern_static!(NSCompositeSaturation: NSCompositingOperation = NSCompositingOperationSaturation); + +extern_static!(NSCompositeColor: NSCompositingOperation = NSCompositingOperationColor); + +extern_static!(NSCompositeLuminosity: NSCompositingOperation = NSCompositingOperationLuminosity); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSBackingStoreType { + NSBackingStoreRetained = 0, + NSBackingStoreNonretained = 1, + NSBackingStoreBuffered = 2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSWindowOrderingMode { + NSWindowAbove = 1, + NSWindowBelow = -1, + NSWindowOut = 0, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSFocusRingPlacement { + NSFocusRingOnly = 0, + NSFocusRingBelow = 1, + NSFocusRingAbove = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSFocusRingType { + NSFocusRingTypeDefault = 0, + NSFocusRingTypeNone = 1, + NSFocusRingTypeExterior = 2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSColorRenderingIntent { + NSColorRenderingIntentDefault = 0, + NSColorRenderingIntentAbsoluteColorimetric = 1, + NSColorRenderingIntentRelativeColorimetric = 2, + NSColorRenderingIntentPerceptual = 3, + NSColorRenderingIntentSaturation = 4, + } +); + +pub type NSColorSpaceName = NSString; + +extern_static!(NSCalibratedWhiteColorSpace: &'static NSColorSpaceName); + +extern_static!(NSCalibratedRGBColorSpace: &'static NSColorSpaceName); + +extern_static!(NSDeviceWhiteColorSpace: &'static NSColorSpaceName); + +extern_static!(NSDeviceRGBColorSpace: &'static NSColorSpaceName); + +extern_static!(NSDeviceCMYKColorSpace: &'static NSColorSpaceName); + +extern_static!(NSNamedColorSpace: &'static NSColorSpaceName); + +extern_static!(NSPatternColorSpace: &'static NSColorSpaceName); + +extern_static!(NSCustomColorSpace: &'static NSColorSpaceName); + +extern_static!(NSCalibratedBlackColorSpace: &'static NSColorSpaceName); + +extern_static!(NSDeviceBlackColorSpace: &'static NSColorSpaceName); + +ns_enum!( + #[underlying(i32)] + pub enum NSWindowDepth { + NSWindowDepthTwentyfourBitRGB = 0x208, + NSWindowDepthSixtyfourBitRGB = 0x210, + NSWindowDepthOnehundredtwentyeightBitRGB = 0x220, + } +); + +extern_fn!( + pub unsafe fn NSBestDepth( + colorSpace: &NSColorSpaceName, + bps: NSInteger, + bpp: NSInteger, + planar: Bool, + exactMatch: *mut Bool, + ) -> NSWindowDepth; +); + +extern_fn!( + pub unsafe fn NSPlanarFromDepth(depth: NSWindowDepth) -> Bool; +); + +extern_fn!( + pub unsafe fn NSColorSpaceFromDepth(depth: NSWindowDepth) -> *mut NSColorSpaceName; +); + +extern_fn!( + pub unsafe fn NSBitsPerSampleFromDepth(depth: NSWindowDepth) -> NSInteger; +); + +extern_fn!( + pub unsafe fn NSBitsPerPixelFromDepth(depth: NSWindowDepth) -> NSInteger; +); + +extern_fn!( + pub unsafe fn NSNumberOfColorComponents(colorSpaceName: &NSColorSpaceName) -> NSInteger; +); + +extern_fn!( + pub unsafe fn NSAvailableWindowDepths() -> NonNull; +); + +extern_static!(NSWhite: CGFloat); + +extern_static!(NSLightGray: CGFloat); + +extern_static!(NSDarkGray: CGFloat); + +extern_static!(NSBlack: CGFloat); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSDisplayGamut { + NSDisplayGamutSRGB = 1, + NSDisplayGamutP3 = 2, + } +); + +pub type NSDeviceDescriptionKey = NSString; + +extern_static!(NSDeviceResolution: &'static NSDeviceDescriptionKey); + +extern_static!(NSDeviceColorSpaceName: &'static NSDeviceDescriptionKey); + +extern_static!(NSDeviceBitsPerSample: &'static NSDeviceDescriptionKey); + +extern_static!(NSDeviceIsScreen: &'static NSDeviceDescriptionKey); + +extern_static!(NSDeviceIsPrinter: &'static NSDeviceDescriptionKey); + +extern_static!(NSDeviceSize: &'static NSDeviceDescriptionKey); + +extern_fn!( + pub unsafe fn NSRectFill(rect: NSRect); +); + +extern_fn!( + pub unsafe fn NSRectFillList(rects: NonNull, count: NSInteger); +); + +extern_fn!( + pub unsafe fn NSRectFillListWithGrays( + rects: NonNull, + grays: NonNull, + num: NSInteger, + ); +); + +extern_fn!( + pub unsafe fn NSRectFillListWithColors( + rects: NonNull, + colors: NonNull>, + num: NSInteger, + ); +); + +extern_fn!( + pub unsafe fn NSRectFillUsingOperation(rect: NSRect, op: NSCompositingOperation); +); + +extern_fn!( + pub unsafe fn NSRectFillListUsingOperation( + rects: NonNull, + count: NSInteger, + op: NSCompositingOperation, + ); +); + +extern_fn!( + pub unsafe fn NSRectFillListWithColorsUsingOperation( + rects: NonNull, + colors: NonNull>, + num: NSInteger, + op: NSCompositingOperation, + ); +); + +extern_fn!( + pub unsafe fn NSFrameRect(rect: NSRect); +); + +extern_fn!( + pub unsafe fn NSFrameRectWithWidth(rect: NSRect, frameWidth: CGFloat); +); + +extern_fn!( + pub unsafe fn NSFrameRectWithWidthUsingOperation( + rect: NSRect, + frameWidth: CGFloat, + op: NSCompositingOperation, + ); +); + +extern_fn!( + pub unsafe fn NSRectClip(rect: NSRect); +); + +extern_fn!( + pub unsafe fn NSRectClipList(rects: NonNull, count: NSInteger); +); + +extern_fn!( + pub unsafe fn NSDrawTiledRects( + boundsRect: NSRect, + clipRect: NSRect, + sides: NonNull, + grays: NonNull, + count: NSInteger, + ) -> NSRect; +); + +extern_fn!( + pub unsafe fn NSDrawGrayBezel(rect: NSRect, clipRect: NSRect); +); + +extern_fn!( + pub unsafe fn NSDrawGroove(rect: NSRect, clipRect: NSRect); +); + +extern_fn!( + pub unsafe fn NSDrawWhiteBezel(rect: NSRect, clipRect: NSRect); +); + +extern_fn!( + pub unsafe fn NSDrawButton(rect: NSRect, clipRect: NSRect); +); + +extern_fn!( + pub unsafe fn NSEraseRect(rect: NSRect); +); + +extern_fn!( + pub unsafe fn NSReadPixel(passedPoint: NSPoint) -> *mut NSColor; +); + +extern_fn!( + pub unsafe fn NSDrawBitmap( + rect: NSRect, + width: NSInteger, + height: NSInteger, + bps: NSInteger, + spp: NSInteger, + bpp: NSInteger, + bpr: NSInteger, + isPlanar: Bool, + hasAlpha: Bool, + colorSpaceName: &NSColorSpaceName, + data: [*const c_uchar; 5], + ); +); + +extern_fn!( + pub unsafe fn NSHighlightRect(rect: NSRect); +); + +extern_fn!( + pub unsafe fn NSBeep(); +); + +extern_fn!( + pub unsafe fn NSGetWindowServerMemory( + context: NSInteger, + virtualMemory: NonNull, + windowBackingMemory: NonNull, + windowDumpString: NonNull>, + ) -> NSInteger; +); + +extern_fn!( + pub unsafe fn NSDrawColorTiledRects( + boundsRect: NSRect, + clipRect: NSRect, + sides: NonNull, + colors: NonNull>, + count: NSInteger, + ) -> NSRect; +); + +extern_fn!( + pub unsafe fn NSDrawDarkBezel(rect: NSRect, clipRect: NSRect); +); + +extern_fn!( + pub unsafe fn NSDrawLightBezel(rect: NSRect, clipRect: NSRect); +); + +extern_fn!( + pub unsafe fn NSDottedFrameRect(rect: NSRect); +); + +extern_fn!( + pub unsafe fn NSDrawWindowBackground(rect: NSRect); +); + +extern_fn!( + pub unsafe fn NSSetFocusRingStyle(placement: NSFocusRingPlacement); +); + +extern_fn!( + pub unsafe fn NSDisableScreenUpdates(); +); + +extern_fn!( + pub unsafe fn NSEnableScreenUpdates(); +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSAnimationEffect { + NSAnimationEffectDisappearingItemDefault = 0, + NSAnimationEffectPoof = 10, + } +); + +extern_fn!( + pub unsafe fn NSShowAnimationEffect( + animationEffect: NSAnimationEffect, + centerLocation: NSPoint, + size: NSSize, + animationDelegate: Option<&Object>, + didEndSelector: OptionSel, + contextInfo: *mut c_void, + ); +); + +extern_fn!( + pub unsafe fn NSCountWindows(count: NonNull); +); + +extern_fn!( + pub unsafe fn NSWindowList(size: NSInteger, list: NonNull); +); + +extern_fn!( + pub unsafe fn NSCountWindowsForContext(context: NSInteger, count: NonNull); +); + +extern_fn!( + pub unsafe fn NSWindowListForContext( + context: NSInteger, + size: NSInteger, + list: NonNull, + ); +); + +extern_fn!( + pub unsafe fn NSCopyBits(srcGState: NSInteger, srcRect: NSRect, destPoint: NSPoint); +); diff --git a/crates/icrate/src/generated/AppKit/NSGraphicsContext.rs b/crates/icrate/src/generated/AppKit/NSGraphicsContext.rs new file mode 100644 index 000000000..c442b204a --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSGraphicsContext.rs @@ -0,0 +1,144 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSGraphicsContextAttributeKey = NSString; + +extern_static!(NSGraphicsContextDestinationAttributeName: &'static NSGraphicsContextAttributeKey); + +extern_static!( + NSGraphicsContextRepresentationFormatAttributeName: &'static NSGraphicsContextAttributeKey +); + +pub type NSGraphicsContextRepresentationFormatName = NSString; + +extern_static!(NSGraphicsContextPSFormat: &'static NSGraphicsContextRepresentationFormatName); + +extern_static!(NSGraphicsContextPDFFormat: &'static NSGraphicsContextRepresentationFormatName); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSImageInterpolation { + NSImageInterpolationDefault = 0, + NSImageInterpolationNone = 1, + NSImageInterpolationLow = 2, + NSImageInterpolationMedium = 4, + NSImageInterpolationHigh = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSGraphicsContext; + + unsafe impl ClassType for NSGraphicsContext { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSGraphicsContext { + #[method_id(@__retain_semantics Other graphicsContextWithAttributes:)] + pub unsafe fn graphicsContextWithAttributes( + attributes: &NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Other graphicsContextWithWindow:)] + pub unsafe fn graphicsContextWithWindow(window: &NSWindow) + -> Id; + + #[method_id(@__retain_semantics Other graphicsContextWithBitmapImageRep:)] + pub unsafe fn graphicsContextWithBitmapImageRep( + bitmapRep: &NSBitmapImageRep, + ) -> Option>; + + #[method_id(@__retain_semantics Other currentContext)] + pub unsafe fn currentContext() -> Option>; + + #[method(setCurrentContext:)] + pub unsafe fn setCurrentContext(currentContext: Option<&NSGraphicsContext>); + + #[method(currentContextDrawingToScreen)] + pub unsafe fn currentContextDrawingToScreen() -> bool; + + #[method_id(@__retain_semantics Other attributes)] + pub unsafe fn attributes( + &self, + ) -> Option, Shared>>; + + #[method(isDrawingToScreen)] + pub unsafe fn isDrawingToScreen(&self) -> bool; + + #[method(flushGraphics)] + pub unsafe fn flushGraphics(&self); + + #[method(isFlipped)] + pub unsafe fn isFlipped(&self) -> bool; + } +); + +extern_methods!( + /// NSGraphicsContext_RenderingOptions + unsafe impl NSGraphicsContext { + #[method(shouldAntialias)] + pub unsafe fn shouldAntialias(&self) -> bool; + + #[method(setShouldAntialias:)] + pub unsafe fn setShouldAntialias(&self, shouldAntialias: bool); + + #[method(imageInterpolation)] + pub unsafe fn imageInterpolation(&self) -> NSImageInterpolation; + + #[method(setImageInterpolation:)] + pub unsafe fn setImageInterpolation(&self, imageInterpolation: NSImageInterpolation); + + #[method(patternPhase)] + pub unsafe fn patternPhase(&self) -> NSPoint; + + #[method(setPatternPhase:)] + pub unsafe fn setPatternPhase(&self, patternPhase: NSPoint); + + #[method(compositingOperation)] + pub unsafe fn compositingOperation(&self) -> NSCompositingOperation; + + #[method(setCompositingOperation:)] + pub unsafe fn setCompositingOperation(&self, compositingOperation: NSCompositingOperation); + + #[method(colorRenderingIntent)] + pub unsafe fn colorRenderingIntent(&self) -> NSColorRenderingIntent; + + #[method(setColorRenderingIntent:)] + pub unsafe fn setColorRenderingIntent(&self, colorRenderingIntent: NSColorRenderingIntent); + } +); + +extern_methods!( + /// NSQuartzCoreAdditions + unsafe impl NSGraphicsContext {} +); + +extern_methods!( + /// NSGraphicsContextDeprecated + unsafe impl NSGraphicsContext { + #[method(setGraphicsState:)] + pub unsafe fn setGraphicsState(gState: NSInteger); + + #[method_id(@__retain_semantics Other focusStack)] + pub unsafe fn focusStack(&self) -> Option>; + + #[method(setFocusStack:)] + pub unsafe fn setFocusStack(&self, stack: Option<&Object>); + + #[method_id(@__retain_semantics Other graphicsContextWithGraphicsPort:flipped:)] + pub unsafe fn graphicsContextWithGraphicsPort_flipped( + graphicsPort: NonNull, + initialFlippedState: bool, + ) -> Id; + + #[method(graphicsPort)] + pub unsafe fn graphicsPort(&self) -> NonNull; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSGridView.rs b/crates/icrate/src/generated/AppKit/NSGridView.rs new file mode 100644 index 000000000..31278321b --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSGridView.rs @@ -0,0 +1,337 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSGridCellPlacement { + NSGridCellPlacementInherited = 0, + NSGridCellPlacementNone = 1, + NSGridCellPlacementLeading = 2, + NSGridCellPlacementTop = NSGridCellPlacementLeading, + NSGridCellPlacementTrailing = 3, + NSGridCellPlacementBottom = NSGridCellPlacementTrailing, + NSGridCellPlacementCenter = 4, + NSGridCellPlacementFill = 5, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSGridRowAlignment { + NSGridRowAlignmentInherited = 0, + NSGridRowAlignmentNone = 1, + NSGridRowAlignmentFirstBaseline = 2, + NSGridRowAlignmentLastBaseline = 3, + } +); + +extern_static!(NSGridViewSizeForContent: CGFloat); + +extern_class!( + #[derive(Debug)] + pub struct NSGridView; + + unsafe impl ClassType for NSGridView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSGridView { + #[method_id(@__retain_semantics Init initWithFrame:)] + pub unsafe fn initWithFrame( + this: Option>, + frameRect: NSRect, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other gridViewWithNumberOfColumns:rows:)] + pub unsafe fn gridViewWithNumberOfColumns_rows( + columnCount: NSInteger, + rowCount: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other gridViewWithViews:)] + pub unsafe fn gridViewWithViews(rows: &NSArray>) -> Id; + + #[method(numberOfRows)] + pub unsafe fn numberOfRows(&self) -> NSInteger; + + #[method(numberOfColumns)] + pub unsafe fn numberOfColumns(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other rowAtIndex:)] + pub unsafe fn rowAtIndex(&self, index: NSInteger) -> Id; + + #[method(indexOfRow:)] + pub unsafe fn indexOfRow(&self, row: &NSGridRow) -> NSInteger; + + #[method_id(@__retain_semantics Other columnAtIndex:)] + pub unsafe fn columnAtIndex(&self, index: NSInteger) -> Id; + + #[method(indexOfColumn:)] + pub unsafe fn indexOfColumn(&self, column: &NSGridColumn) -> NSInteger; + + #[method_id(@__retain_semantics Other cellAtColumnIndex:rowIndex:)] + pub unsafe fn cellAtColumnIndex_rowIndex( + &self, + columnIndex: NSInteger, + rowIndex: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other cellForView:)] + pub unsafe fn cellForView(&self, view: &NSView) -> Option>; + + #[method_id(@__retain_semantics Other addRowWithViews:)] + pub unsafe fn addRowWithViews(&self, views: &NSArray) -> Id; + + #[method_id(@__retain_semantics Other insertRowAtIndex:withViews:)] + pub unsafe fn insertRowAtIndex_withViews( + &self, + index: NSInteger, + views: &NSArray, + ) -> Id; + + #[method(moveRowAtIndex:toIndex:)] + pub unsafe fn moveRowAtIndex_toIndex(&self, fromIndex: NSInteger, toIndex: NSInteger); + + #[method(removeRowAtIndex:)] + pub unsafe fn removeRowAtIndex(&self, index: NSInteger); + + #[method_id(@__retain_semantics Other addColumnWithViews:)] + pub unsafe fn addColumnWithViews( + &self, + views: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other insertColumnAtIndex:withViews:)] + pub unsafe fn insertColumnAtIndex_withViews( + &self, + index: NSInteger, + views: &NSArray, + ) -> Id; + + #[method(moveColumnAtIndex:toIndex:)] + pub unsafe fn moveColumnAtIndex_toIndex(&self, fromIndex: NSInteger, toIndex: NSInteger); + + #[method(removeColumnAtIndex:)] + pub unsafe fn removeColumnAtIndex(&self, index: NSInteger); + + #[method(xPlacement)] + pub unsafe fn xPlacement(&self) -> NSGridCellPlacement; + + #[method(setXPlacement:)] + pub unsafe fn setXPlacement(&self, xPlacement: NSGridCellPlacement); + + #[method(yPlacement)] + pub unsafe fn yPlacement(&self) -> NSGridCellPlacement; + + #[method(setYPlacement:)] + pub unsafe fn setYPlacement(&self, yPlacement: NSGridCellPlacement); + + #[method(rowAlignment)] + pub unsafe fn rowAlignment(&self) -> NSGridRowAlignment; + + #[method(setRowAlignment:)] + pub unsafe fn setRowAlignment(&self, rowAlignment: NSGridRowAlignment); + + #[method(rowSpacing)] + pub unsafe fn rowSpacing(&self) -> CGFloat; + + #[method(setRowSpacing:)] + pub unsafe fn setRowSpacing(&self, rowSpacing: CGFloat); + + #[method(columnSpacing)] + pub unsafe fn columnSpacing(&self) -> CGFloat; + + #[method(setColumnSpacing:)] + pub unsafe fn setColumnSpacing(&self, columnSpacing: CGFloat); + + #[method(mergeCellsInHorizontalRange:verticalRange:)] + pub unsafe fn mergeCellsInHorizontalRange_verticalRange( + &self, + hRange: NSRange, + vRange: NSRange, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSGridRow; + + unsafe impl ClassType for NSGridRow { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSGridRow { + #[method_id(@__retain_semantics Other gridView)] + pub unsafe fn gridView(&self) -> Option>; + + #[method(numberOfCells)] + pub unsafe fn numberOfCells(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other cellAtIndex:)] + pub unsafe fn cellAtIndex(&self, index: NSInteger) -> Id; + + #[method(yPlacement)] + pub unsafe fn yPlacement(&self) -> NSGridCellPlacement; + + #[method(setYPlacement:)] + pub unsafe fn setYPlacement(&self, yPlacement: NSGridCellPlacement); + + #[method(rowAlignment)] + pub unsafe fn rowAlignment(&self) -> NSGridRowAlignment; + + #[method(setRowAlignment:)] + pub unsafe fn setRowAlignment(&self, rowAlignment: NSGridRowAlignment); + + #[method(height)] + pub unsafe fn height(&self) -> CGFloat; + + #[method(setHeight:)] + pub unsafe fn setHeight(&self, height: CGFloat); + + #[method(topPadding)] + pub unsafe fn topPadding(&self) -> CGFloat; + + #[method(setTopPadding:)] + pub unsafe fn setTopPadding(&self, topPadding: CGFloat); + + #[method(bottomPadding)] + pub unsafe fn bottomPadding(&self) -> CGFloat; + + #[method(setBottomPadding:)] + pub unsafe fn setBottomPadding(&self, bottomPadding: CGFloat); + + #[method(isHidden)] + pub unsafe fn isHidden(&self) -> bool; + + #[method(setHidden:)] + pub unsafe fn setHidden(&self, hidden: bool); + + #[method(mergeCellsInRange:)] + pub unsafe fn mergeCellsInRange(&self, range: NSRange); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSGridColumn; + + unsafe impl ClassType for NSGridColumn { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSGridColumn { + #[method_id(@__retain_semantics Other gridView)] + pub unsafe fn gridView(&self) -> Option>; + + #[method(numberOfCells)] + pub unsafe fn numberOfCells(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other cellAtIndex:)] + pub unsafe fn cellAtIndex(&self, index: NSInteger) -> Id; + + #[method(xPlacement)] + pub unsafe fn xPlacement(&self) -> NSGridCellPlacement; + + #[method(setXPlacement:)] + pub unsafe fn setXPlacement(&self, xPlacement: NSGridCellPlacement); + + #[method(width)] + pub unsafe fn width(&self) -> CGFloat; + + #[method(setWidth:)] + pub unsafe fn setWidth(&self, width: CGFloat); + + #[method(leadingPadding)] + pub unsafe fn leadingPadding(&self) -> CGFloat; + + #[method(setLeadingPadding:)] + pub unsafe fn setLeadingPadding(&self, leadingPadding: CGFloat); + + #[method(trailingPadding)] + pub unsafe fn trailingPadding(&self) -> CGFloat; + + #[method(setTrailingPadding:)] + pub unsafe fn setTrailingPadding(&self, trailingPadding: CGFloat); + + #[method(isHidden)] + pub unsafe fn isHidden(&self) -> bool; + + #[method(setHidden:)] + pub unsafe fn setHidden(&self, hidden: bool); + + #[method(mergeCellsInRange:)] + pub unsafe fn mergeCellsInRange(&self, range: NSRange); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSGridCell; + + unsafe impl ClassType for NSGridCell { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSGridCell { + #[method_id(@__retain_semantics Other contentView)] + pub unsafe fn contentView(&self) -> Option>; + + #[method(setContentView:)] + pub unsafe fn setContentView(&self, contentView: Option<&NSView>); + + #[method_id(@__retain_semantics Other emptyContentView)] + pub unsafe fn emptyContentView() -> Id; + + #[method_id(@__retain_semantics Other row)] + pub unsafe fn row(&self) -> Option>; + + #[method_id(@__retain_semantics Other column)] + pub unsafe fn column(&self) -> Option>; + + #[method(xPlacement)] + pub unsafe fn xPlacement(&self) -> NSGridCellPlacement; + + #[method(setXPlacement:)] + pub unsafe fn setXPlacement(&self, xPlacement: NSGridCellPlacement); + + #[method(yPlacement)] + pub unsafe fn yPlacement(&self) -> NSGridCellPlacement; + + #[method(setYPlacement:)] + pub unsafe fn setYPlacement(&self, yPlacement: NSGridCellPlacement); + + #[method(rowAlignment)] + pub unsafe fn rowAlignment(&self) -> NSGridRowAlignment; + + #[method(setRowAlignment:)] + pub unsafe fn setRowAlignment(&self, rowAlignment: NSGridRowAlignment); + + #[method_id(@__retain_semantics Other customPlacementConstraints)] + pub unsafe fn customPlacementConstraints(&self) -> Id, Shared>; + + #[method(setCustomPlacementConstraints:)] + pub unsafe fn setCustomPlacementConstraints( + &self, + customPlacementConstraints: &NSArray, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSGroupTouchBarItem.rs b/crates/icrate/src/generated/AppKit/NSGroupTouchBarItem.rs new file mode 100644 index 000000000..48a577b70 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSGroupTouchBarItem.rs @@ -0,0 +1,86 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSGroupTouchBarItem; + + unsafe impl ClassType for NSGroupTouchBarItem { + type Super = NSTouchBarItem; + } +); + +extern_methods!( + unsafe impl NSGroupTouchBarItem { + #[method_id(@__retain_semantics Other groupItemWithIdentifier:items:)] + pub unsafe fn groupItemWithIdentifier_items( + identifier: &NSTouchBarItemIdentifier, + items: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other groupItemWithIdentifier:items:allowedCompressionOptions:)] + pub unsafe fn groupItemWithIdentifier_items_allowedCompressionOptions( + identifier: &NSTouchBarItemIdentifier, + items: &NSArray, + allowedCompressionOptions: &NSUserInterfaceCompressionOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other alertStyleGroupItemWithIdentifier:)] + pub unsafe fn alertStyleGroupItemWithIdentifier( + identifier: &NSTouchBarItemIdentifier, + ) -> Id; + + #[method_id(@__retain_semantics Other groupTouchBar)] + pub unsafe fn groupTouchBar(&self) -> Id; + + #[method(setGroupTouchBar:)] + pub unsafe fn setGroupTouchBar(&self, groupTouchBar: &NSTouchBar); + + #[method_id(@__retain_semantics Other customizationLabel)] + pub unsafe fn customizationLabel(&self) -> Id; + + #[method(setCustomizationLabel:)] + pub unsafe fn setCustomizationLabel(&self, customizationLabel: Option<&NSString>); + + #[method(groupUserInterfaceLayoutDirection)] + pub unsafe fn groupUserInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection; + + #[method(setGroupUserInterfaceLayoutDirection:)] + pub unsafe fn setGroupUserInterfaceLayoutDirection( + &self, + groupUserInterfaceLayoutDirection: NSUserInterfaceLayoutDirection, + ); + + #[method(prefersEqualWidths)] + pub unsafe fn prefersEqualWidths(&self) -> bool; + + #[method(setPrefersEqualWidths:)] + pub unsafe fn setPrefersEqualWidths(&self, prefersEqualWidths: bool); + + #[method(preferredItemWidth)] + pub unsafe fn preferredItemWidth(&self) -> CGFloat; + + #[method(setPreferredItemWidth:)] + pub unsafe fn setPreferredItemWidth(&self, preferredItemWidth: CGFloat); + + #[method_id(@__retain_semantics Other effectiveCompressionOptions)] + pub unsafe fn effectiveCompressionOptions( + &self, + ) -> Id; + + #[method_id(@__retain_semantics Other prioritizedCompressionOptions)] + pub unsafe fn prioritizedCompressionOptions( + &self, + ) -> Id, Shared>; + + #[method(setPrioritizedCompressionOptions:)] + pub unsafe fn setPrioritizedCompressionOptions( + &self, + prioritizedCompressionOptions: &NSArray, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSHapticFeedback.rs b/crates/icrate/src/generated/AppKit/NSHapticFeedback.rs new file mode 100644 index 000000000..099437a54 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSHapticFeedback.rs @@ -0,0 +1,53 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSHapticFeedbackPattern { + NSHapticFeedbackPatternGeneric = 0, + NSHapticFeedbackPatternAlignment = 1, + NSHapticFeedbackPatternLevelChange = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSHapticFeedbackPerformanceTime { + NSHapticFeedbackPerformanceTimeDefault = 0, + NSHapticFeedbackPerformanceTimeNow = 1, + NSHapticFeedbackPerformanceTimeDrawCompleted = 2, + } +); + +extern_protocol!( + pub struct NSHapticFeedbackPerformer; + + unsafe impl NSHapticFeedbackPerformer { + #[method(performFeedbackPattern:performanceTime:)] + pub unsafe fn performFeedbackPattern_performanceTime( + &self, + pattern: NSHapticFeedbackPattern, + performanceTime: NSHapticFeedbackPerformanceTime, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSHapticFeedbackManager; + + unsafe impl ClassType for NSHapticFeedbackManager { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSHapticFeedbackManager { + #[method_id(@__retain_semantics Other defaultPerformer)] + pub unsafe fn defaultPerformer() -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSHelpManager.rs b/crates/icrate/src/generated/AppKit/NSHelpManager.rs new file mode 100644 index 000000000..65acffa5e --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSHelpManager.rs @@ -0,0 +1,96 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSHelpBookName = NSString; + +pub type NSHelpAnchorName = NSString; + +pub type NSHelpManagerContextHelpKey = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSHelpManager; + + unsafe impl ClassType for NSHelpManager { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSHelpManager { + #[method_id(@__retain_semantics Other sharedHelpManager)] + pub unsafe fn sharedHelpManager() -> Id; + + #[method(isContextHelpModeActive)] + pub unsafe fn isContextHelpModeActive() -> bool; + + #[method(setContextHelpModeActive:)] + pub unsafe fn setContextHelpModeActive(contextHelpModeActive: bool); + + #[method(setContextHelp:forObject:)] + pub unsafe fn setContextHelp_forObject( + &self, + attrString: &NSAttributedString, + object: &Object, + ); + + #[method(removeContextHelpForObject:)] + pub unsafe fn removeContextHelpForObject(&self, object: &Object); + + #[method_id(@__retain_semantics Other contextHelpForObject:)] + pub unsafe fn contextHelpForObject( + &self, + object: &Object, + ) -> Option>; + + #[method(showContextHelpForObject:locationHint:)] + pub unsafe fn showContextHelpForObject_locationHint( + &self, + object: &Object, + pt: NSPoint, + ) -> bool; + + #[method(openHelpAnchor:inBook:)] + pub unsafe fn openHelpAnchor_inBook( + &self, + anchor: &NSHelpAnchorName, + book: Option<&NSHelpBookName>, + ); + + #[method(findString:inBook:)] + pub unsafe fn findString_inBook(&self, query: &NSString, book: Option<&NSHelpBookName>); + + #[method(registerBooksInBundle:)] + pub unsafe fn registerBooksInBundle(&self, bundle: &NSBundle) -> bool; + } +); + +extern_static!(NSContextHelpModeDidActivateNotification: &'static NSNotificationName); + +extern_static!(NSContextHelpModeDidDeactivateNotification: &'static NSNotificationName); + +extern_methods!( + /// NSBundleHelpExtension + unsafe impl NSBundle { + #[method_id(@__retain_semantics Other contextHelpForKey:)] + pub unsafe fn contextHelpForKey( + &self, + key: &NSHelpManagerContextHelpKey, + ) -> Option>; + } +); + +extern_methods!( + /// NSApplicationHelpExtension + unsafe impl NSApplication { + #[method(activateContextHelpMode:)] + pub unsafe fn activateContextHelpMode(&self, sender: Option<&Object>); + + #[method(showHelp:)] + pub unsafe fn showHelp(&self, sender: Option<&Object>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSImage.rs b/crates/icrate/src/generated/AppKit/NSImage.rs new file mode 100644 index 000000000..6abe46015 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSImage.rs @@ -0,0 +1,834 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSImageName = NSString; + +extern_static!(NSImageHintCTM: &'static NSImageHintKey); + +extern_static!(NSImageHintInterpolation: &'static NSImageHintKey); + +extern_static!(NSImageHintUserInterfaceLayoutDirection: &'static NSImageHintKey); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSImageLoadStatus { + NSImageLoadStatusCompleted = 0, + NSImageLoadStatusCancelled = 1, + NSImageLoadStatusInvalidData = 2, + NSImageLoadStatusUnexpectedEOF = 3, + NSImageLoadStatusReadError = 4, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSImageCacheMode { + NSImageCacheDefault = 0, + NSImageCacheAlways = 1, + NSImageCacheBySize = 2, + NSImageCacheNever = 3, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSImageResizingMode { + NSImageResizingModeStretch = 0, + NSImageResizingModeTile = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSImage; + + unsafe impl ClassType for NSImage { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSImage { + #[method_id(@__retain_semantics Other imageNamed:)] + pub unsafe fn imageNamed(name: &NSImageName) -> Option>; + + #[method_id(@__retain_semantics Other imageWithSystemSymbolName:accessibilityDescription:)] + pub unsafe fn imageWithSystemSymbolName_accessibilityDescription( + symbolName: &NSString, + description: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithSize:)] + pub unsafe fn initWithSize(this: Option>, size: NSSize) + -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithData:)] + pub unsafe fn initWithData( + this: Option>, + data: &NSData, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContentsOfFile:)] + pub unsafe fn initWithContentsOfFile( + this: Option>, + fileName: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:)] + pub unsafe fn initWithContentsOfURL( + this: Option>, + url: &NSURL, + ) -> Option>; + + #[method_id(@__retain_semantics Init initByReferencingFile:)] + pub unsafe fn initByReferencingFile( + this: Option>, + fileName: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initByReferencingURL:)] + pub unsafe fn initByReferencingURL( + this: Option>, + url: &NSURL, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithPasteboard:)] + pub unsafe fn initWithPasteboard( + this: Option>, + pasteboard: &NSPasteboard, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithDataIgnoringOrientation:)] + pub unsafe fn initWithDataIgnoringOrientation( + this: Option>, + data: &NSData, + ) -> Option>; + + #[method_id(@__retain_semantics Other imageWithSize:flipped:drawingHandler:)] + pub unsafe fn imageWithSize_flipped_drawingHandler( + size: NSSize, + drawingHandlerShouldBeCalledWithFlippedContext: bool, + drawingHandler: &Block<(NSRect,), Bool>, + ) -> Id; + + #[method(size)] + pub unsafe fn size(&self) -> NSSize; + + #[method(setSize:)] + pub unsafe fn setSize(&self, size: NSSize); + + #[method(setName:)] + pub unsafe fn setName(&self, string: Option<&NSImageName>) -> bool; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Id; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: &NSColor); + + #[method(usesEPSOnResolutionMismatch)] + pub unsafe fn usesEPSOnResolutionMismatch(&self) -> bool; + + #[method(setUsesEPSOnResolutionMismatch:)] + pub unsafe fn setUsesEPSOnResolutionMismatch(&self, usesEPSOnResolutionMismatch: bool); + + #[method(prefersColorMatch)] + pub unsafe fn prefersColorMatch(&self) -> bool; + + #[method(setPrefersColorMatch:)] + pub unsafe fn setPrefersColorMatch(&self, prefersColorMatch: bool); + + #[method(matchesOnMultipleResolution)] + pub unsafe fn matchesOnMultipleResolution(&self) -> bool; + + #[method(setMatchesOnMultipleResolution:)] + pub unsafe fn setMatchesOnMultipleResolution(&self, matchesOnMultipleResolution: bool); + + #[method(matchesOnlyOnBestFittingAxis)] + pub unsafe fn matchesOnlyOnBestFittingAxis(&self) -> bool; + + #[method(setMatchesOnlyOnBestFittingAxis:)] + pub unsafe fn setMatchesOnlyOnBestFittingAxis(&self, matchesOnlyOnBestFittingAxis: bool); + + #[method(drawAtPoint:fromRect:operation:fraction:)] + pub unsafe fn drawAtPoint_fromRect_operation_fraction( + &self, + point: NSPoint, + fromRect: NSRect, + op: NSCompositingOperation, + delta: CGFloat, + ); + + #[method(drawInRect:fromRect:operation:fraction:)] + pub unsafe fn drawInRect_fromRect_operation_fraction( + &self, + rect: NSRect, + fromRect: NSRect, + op: NSCompositingOperation, + delta: CGFloat, + ); + + #[method(drawInRect:fromRect:operation:fraction:respectFlipped:hints:)] + pub unsafe fn drawInRect_fromRect_operation_fraction_respectFlipped_hints( + &self, + dstSpacePortionRect: NSRect, + srcSpacePortionRect: NSRect, + op: NSCompositingOperation, + requestedAlpha: CGFloat, + respectContextIsFlipped: bool, + hints: Option<&NSDictionary>, + ); + + #[method(drawRepresentation:inRect:)] + pub unsafe fn drawRepresentation_inRect(&self, imageRep: &NSImageRep, rect: NSRect) + -> bool; + + #[method(drawInRect:)] + pub unsafe fn drawInRect(&self, rect: NSRect); + + #[method(recache)] + pub unsafe fn recache(&self); + + #[method_id(@__retain_semantics Other TIFFRepresentation)] + pub unsafe fn TIFFRepresentation(&self) -> Option>; + + #[method_id(@__retain_semantics Other TIFFRepresentationUsingCompression:factor:)] + pub unsafe fn TIFFRepresentationUsingCompression_factor( + &self, + comp: NSTIFFCompression, + factor: c_float, + ) -> Option>; + + #[method_id(@__retain_semantics Other representations)] + pub unsafe fn representations(&self) -> Id, Shared>; + + #[method(addRepresentations:)] + pub unsafe fn addRepresentations(&self, imageReps: &NSArray); + + #[method(addRepresentation:)] + pub unsafe fn addRepresentation(&self, imageRep: &NSImageRep); + + #[method(removeRepresentation:)] + pub unsafe fn removeRepresentation(&self, imageRep: &NSImageRep); + + #[method(isValid)] + pub unsafe fn isValid(&self) -> bool; + + #[method(lockFocus)] + pub unsafe fn lockFocus(&self); + + #[method(lockFocusFlipped:)] + pub unsafe fn lockFocusFlipped(&self, flipped: bool); + + #[method(unlockFocus)] + pub unsafe fn unlockFocus(&self); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSImageDelegate>); + + #[method_id(@__retain_semantics Other imageTypes)] + pub unsafe fn imageTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other imageUnfilteredTypes)] + pub unsafe fn imageUnfilteredTypes() -> Id, Shared>; + + #[method(canInitWithPasteboard:)] + pub unsafe fn canInitWithPasteboard(pasteboard: &NSPasteboard) -> bool; + + #[method(cancelIncrementalLoad)] + pub unsafe fn cancelIncrementalLoad(&self); + + #[method(cacheMode)] + pub unsafe fn cacheMode(&self) -> NSImageCacheMode; + + #[method(setCacheMode:)] + pub unsafe fn setCacheMode(&self, cacheMode: NSImageCacheMode); + + #[method(alignmentRect)] + pub unsafe fn alignmentRect(&self) -> NSRect; + + #[method(setAlignmentRect:)] + pub unsafe fn setAlignmentRect(&self, alignmentRect: NSRect); + + #[method(isTemplate)] + pub unsafe fn isTemplate(&self) -> bool; + + #[method(setTemplate:)] + pub unsafe fn setTemplate(&self, template: bool); + + #[method_id(@__retain_semantics Other accessibilityDescription)] + pub unsafe fn accessibilityDescription(&self) -> Option>; + + #[method(setAccessibilityDescription:)] + pub unsafe fn setAccessibilityDescription( + &self, + accessibilityDescription: Option<&NSString>, + ); + + #[method_id(@__retain_semantics Other bestRepresentationForRect:context:hints:)] + pub unsafe fn bestRepresentationForRect_context_hints( + &self, + rect: NSRect, + referenceContext: Option<&NSGraphicsContext>, + hints: Option<&NSDictionary>, + ) -> Option>; + + #[method(hitTestRect:withImageDestinationRect:context:hints:flipped:)] + pub unsafe fn hitTestRect_withImageDestinationRect_context_hints_flipped( + &self, + testRectDestSpace: NSRect, + imageRectDestSpace: NSRect, + context: Option<&NSGraphicsContext>, + hints: Option<&NSDictionary>, + flipped: bool, + ) -> bool; + + #[method(recommendedLayerContentsScale:)] + pub unsafe fn recommendedLayerContentsScale( + &self, + preferredContentsScale: CGFloat, + ) -> CGFloat; + + #[method_id(@__retain_semantics Other layerContentsForContentsScale:)] + pub unsafe fn layerContentsForContentsScale( + &self, + layerContentsScale: CGFloat, + ) -> Id; + + #[method(capInsets)] + pub unsafe fn capInsets(&self) -> NSEdgeInsets; + + #[method(setCapInsets:)] + pub unsafe fn setCapInsets(&self, capInsets: NSEdgeInsets); + + #[method(resizingMode)] + pub unsafe fn resizingMode(&self) -> NSImageResizingMode; + + #[method(setResizingMode:)] + pub unsafe fn setResizingMode(&self, resizingMode: NSImageResizingMode); + + #[method_id(@__retain_semantics Other imageWithSymbolConfiguration:)] + pub unsafe fn imageWithSymbolConfiguration( + &self, + configuration: &NSImageSymbolConfiguration, + ) -> Option>; + + #[method_id(@__retain_semantics Other symbolConfiguration)] + pub unsafe fn symbolConfiguration(&self) -> Id; + } +); + +extern_methods!( + unsafe impl NSImage {} +); + +extern_protocol!( + pub struct NSImageDelegate; + + unsafe impl NSImageDelegate { + #[optional] + #[method_id(@__retain_semantics Other imageDidNotDraw:inRect:)] + pub unsafe fn imageDidNotDraw_inRect( + &self, + sender: &NSImage, + rect: NSRect, + ) -> Option>; + + #[optional] + #[method(image:willLoadRepresentation:)] + pub unsafe fn image_willLoadRepresentation(&self, image: &NSImage, rep: &NSImageRep); + + #[optional] + #[method(image:didLoadRepresentationHeader:)] + pub unsafe fn image_didLoadRepresentationHeader(&self, image: &NSImage, rep: &NSImageRep); + + #[optional] + #[method(image:didLoadPartOfRepresentation:withValidRows:)] + pub unsafe fn image_didLoadPartOfRepresentation_withValidRows( + &self, + image: &NSImage, + rep: &NSImageRep, + rows: NSInteger, + ); + + #[optional] + #[method(image:didLoadRepresentation:withStatus:)] + pub unsafe fn image_didLoadRepresentation_withStatus( + &self, + image: &NSImage, + rep: &NSImageRep, + status: NSImageLoadStatus, + ); + } +); + +extern_methods!( + /// NSBundleImageExtension + unsafe impl NSBundle { + #[method_id(@__retain_semantics Other imageForResource:)] + pub unsafe fn imageForResource(&self, name: &NSImageName) -> Option>; + + #[method_id(@__retain_semantics Other pathForImageResource:)] + pub unsafe fn pathForImageResource( + &self, + name: &NSImageName, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLForImageResource:)] + pub unsafe fn URLForImageResource(&self, name: &NSImageName) -> Option>; + } +); + +extern_methods!( + unsafe impl NSImage { + #[method_id(@__retain_semantics Other bestRepresentationForDevice:)] + pub unsafe fn bestRepresentationForDevice( + &self, + deviceDescription: Option<&NSDictionary>, + ) -> Option>; + + #[method_id(@__retain_semantics Other imageUnfilteredFileTypes)] + pub unsafe fn imageUnfilteredFileTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other imageUnfilteredPasteboardTypes)] + pub unsafe fn imageUnfilteredPasteboardTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other imageFileTypes)] + pub unsafe fn imageFileTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other imagePasteboardTypes)] + pub unsafe fn imagePasteboardTypes() -> Id, Shared>; + + #[method(setFlipped:)] + pub unsafe fn setFlipped(&self, flag: bool); + + #[method(isFlipped)] + pub unsafe fn isFlipped(&self) -> bool; + + #[method(dissolveToPoint:fraction:)] + pub unsafe fn dissolveToPoint_fraction(&self, point: NSPoint, fraction: CGFloat); + + #[method(dissolveToPoint:fromRect:fraction:)] + pub unsafe fn dissolveToPoint_fromRect_fraction( + &self, + point: NSPoint, + rect: NSRect, + fraction: CGFloat, + ); + + #[method(compositeToPoint:operation:)] + pub unsafe fn compositeToPoint_operation(&self, point: NSPoint, op: NSCompositingOperation); + + #[method(compositeToPoint:fromRect:operation:)] + pub unsafe fn compositeToPoint_fromRect_operation( + &self, + point: NSPoint, + rect: NSRect, + op: NSCompositingOperation, + ); + + #[method(compositeToPoint:operation:fraction:)] + pub unsafe fn compositeToPoint_operation_fraction( + &self, + point: NSPoint, + op: NSCompositingOperation, + delta: CGFloat, + ); + + #[method(compositeToPoint:fromRect:operation:fraction:)] + pub unsafe fn compositeToPoint_fromRect_operation_fraction( + &self, + point: NSPoint, + rect: NSRect, + op: NSCompositingOperation, + delta: CGFloat, + ); + + #[method(lockFocusOnRepresentation:)] + pub unsafe fn lockFocusOnRepresentation(&self, imageRepresentation: Option<&NSImageRep>); + + #[method(setScalesWhenResized:)] + pub unsafe fn setScalesWhenResized(&self, flag: bool); + + #[method(scalesWhenResized)] + pub unsafe fn scalesWhenResized(&self) -> bool; + + #[method(setDataRetained:)] + pub unsafe fn setDataRetained(&self, flag: bool); + + #[method(isDataRetained)] + pub unsafe fn isDataRetained(&self) -> bool; + + #[method(setCachedSeparately:)] + pub unsafe fn setCachedSeparately(&self, flag: bool); + + #[method(isCachedSeparately)] + pub unsafe fn isCachedSeparately(&self) -> bool; + + #[method(setCacheDepthMatchesImageDepth:)] + pub unsafe fn setCacheDepthMatchesImageDepth(&self, flag: bool); + + #[method(cacheDepthMatchesImageDepth)] + pub unsafe fn cacheDepthMatchesImageDepth(&self) -> bool; + } +); + +extern_static!(NSImageNameAddTemplate: &'static NSImageName); + +extern_static!(NSImageNameBluetoothTemplate: &'static NSImageName); + +extern_static!(NSImageNameBonjour: &'static NSImageName); + +extern_static!(NSImageNameBookmarksTemplate: &'static NSImageName); + +extern_static!(NSImageNameCaution: &'static NSImageName); + +extern_static!(NSImageNameComputer: &'static NSImageName); + +extern_static!(NSImageNameEnterFullScreenTemplate: &'static NSImageName); + +extern_static!(NSImageNameExitFullScreenTemplate: &'static NSImageName); + +extern_static!(NSImageNameFolder: &'static NSImageName); + +extern_static!(NSImageNameFolderBurnable: &'static NSImageName); + +extern_static!(NSImageNameFolderSmart: &'static NSImageName); + +extern_static!(NSImageNameFollowLinkFreestandingTemplate: &'static NSImageName); + +extern_static!(NSImageNameHomeTemplate: &'static NSImageName); + +extern_static!(NSImageNameIChatTheaterTemplate: &'static NSImageName); + +extern_static!(NSImageNameLockLockedTemplate: &'static NSImageName); + +extern_static!(NSImageNameLockUnlockedTemplate: &'static NSImageName); + +extern_static!(NSImageNameNetwork: &'static NSImageName); + +extern_static!(NSImageNamePathTemplate: &'static NSImageName); + +extern_static!(NSImageNameQuickLookTemplate: &'static NSImageName); + +extern_static!(NSImageNameRefreshFreestandingTemplate: &'static NSImageName); + +extern_static!(NSImageNameRefreshTemplate: &'static NSImageName); + +extern_static!(NSImageNameRemoveTemplate: &'static NSImageName); + +extern_static!(NSImageNameRevealFreestandingTemplate: &'static NSImageName); + +extern_static!(NSImageNameShareTemplate: &'static NSImageName); + +extern_static!(NSImageNameSlideshowTemplate: &'static NSImageName); + +extern_static!(NSImageNameStatusAvailable: &'static NSImageName); + +extern_static!(NSImageNameStatusNone: &'static NSImageName); + +extern_static!(NSImageNameStatusPartiallyAvailable: &'static NSImageName); + +extern_static!(NSImageNameStatusUnavailable: &'static NSImageName); + +extern_static!(NSImageNameStopProgressFreestandingTemplate: &'static NSImageName); + +extern_static!(NSImageNameStopProgressTemplate: &'static NSImageName); + +extern_static!(NSImageNameTrashEmpty: &'static NSImageName); + +extern_static!(NSImageNameTrashFull: &'static NSImageName); + +extern_static!(NSImageNameActionTemplate: &'static NSImageName); + +extern_static!(NSImageNameSmartBadgeTemplate: &'static NSImageName); + +extern_static!(NSImageNameIconViewTemplate: &'static NSImageName); + +extern_static!(NSImageNameListViewTemplate: &'static NSImageName); + +extern_static!(NSImageNameColumnViewTemplate: &'static NSImageName); + +extern_static!(NSImageNameFlowViewTemplate: &'static NSImageName); + +extern_static!(NSImageNameInvalidDataFreestandingTemplate: &'static NSImageName); + +extern_static!(NSImageNameGoForwardTemplate: &'static NSImageName); + +extern_static!(NSImageNameGoBackTemplate: &'static NSImageName); + +extern_static!(NSImageNameGoRightTemplate: &'static NSImageName); + +extern_static!(NSImageNameGoLeftTemplate: &'static NSImageName); + +extern_static!(NSImageNameRightFacingTriangleTemplate: &'static NSImageName); + +extern_static!(NSImageNameLeftFacingTriangleTemplate: &'static NSImageName); + +extern_static!(NSImageNameDotMac: &'static NSImageName); + +extern_static!(NSImageNameMobileMe: &'static NSImageName); + +extern_static!(NSImageNameMultipleDocuments: &'static NSImageName); + +extern_static!(NSImageNameUserAccounts: &'static NSImageName); + +extern_static!(NSImageNamePreferencesGeneral: &'static NSImageName); + +extern_static!(NSImageNameAdvanced: &'static NSImageName); + +extern_static!(NSImageNameInfo: &'static NSImageName); + +extern_static!(NSImageNameFontPanel: &'static NSImageName); + +extern_static!(NSImageNameColorPanel: &'static NSImageName); + +extern_static!(NSImageNameUser: &'static NSImageName); + +extern_static!(NSImageNameUserGroup: &'static NSImageName); + +extern_static!(NSImageNameEveryone: &'static NSImageName); + +extern_static!(NSImageNameUserGuest: &'static NSImageName); + +extern_static!(NSImageNameMenuOnStateTemplate: &'static NSImageName); + +extern_static!(NSImageNameMenuMixedStateTemplate: &'static NSImageName); + +extern_static!(NSImageNameApplicationIcon: &'static NSImageName); + +extern_static!(NSImageNameTouchBarAddDetailTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarAddTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarAlarmTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarAudioInputMuteTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarAudioInputTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarAudioOutputMuteTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarAudioOutputVolumeHighTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarAudioOutputVolumeLowTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarAudioOutputVolumeMediumTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarAudioOutputVolumeOffTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarBookmarksTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarColorPickerFill: &'static NSImageName); + +extern_static!(NSImageNameTouchBarColorPickerFont: &'static NSImageName); + +extern_static!(NSImageNameTouchBarColorPickerStroke: &'static NSImageName); + +extern_static!(NSImageNameTouchBarCommunicationAudioTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarCommunicationVideoTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarComposeTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarDeleteTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarDownloadTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarEnterFullScreenTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarExitFullScreenTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarFastForwardTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarFolderCopyToTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarFolderMoveToTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarFolderTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarGetInfoTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarGoBackTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarGoDownTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarGoForwardTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarGoUpTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarHistoryTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarIconViewTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarListViewTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarMailTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarNewFolderTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarNewMessageTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarOpenInBrowserTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarPauseTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarPlayPauseTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarPlayTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarQuickLookTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarRecordStartTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarRecordStopTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarRefreshTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarRemoveTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarRewindTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarRotateLeftTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarRotateRightTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarSearchTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarShareTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarSidebarTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarSkipAhead15SecondsTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarSkipAhead30SecondsTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarSkipAheadTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarSkipBack15SecondsTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarSkipBack30SecondsTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarSkipBackTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarSkipToEndTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarSkipToStartTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarSlideshowTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarTagIconTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarTextBoldTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarTextBoxTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarTextCenterAlignTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarTextItalicTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarTextJustifiedAlignTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarTextLeftAlignTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarTextListTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarTextRightAlignTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarTextStrikethroughTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarTextUnderlineTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarUserAddTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarUserGroupTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarUserTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarVolumeDownTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarVolumeUpTemplate: &'static NSImageName); + +extern_static!(NSImageNameTouchBarPlayheadTemplate: &'static NSImageName); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSImageSymbolScale { + NSImageSymbolScaleSmall = 1, + NSImageSymbolScaleMedium = 2, + NSImageSymbolScaleLarge = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSImageSymbolConfiguration; + + unsafe impl ClassType for NSImageSymbolConfiguration { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSImageSymbolConfiguration { + #[method_id(@__retain_semantics Other configurationWithPointSize:weight:scale:)] + pub unsafe fn configurationWithPointSize_weight_scale( + pointSize: CGFloat, + weight: NSFontWeight, + scale: NSImageSymbolScale, + ) -> Id; + + #[method_id(@__retain_semantics Other configurationWithPointSize:weight:)] + pub unsafe fn configurationWithPointSize_weight( + pointSize: CGFloat, + weight: NSFontWeight, + ) -> Id; + + #[method_id(@__retain_semantics Other configurationWithTextStyle:scale:)] + pub unsafe fn configurationWithTextStyle_scale( + style: &NSFontTextStyle, + scale: NSImageSymbolScale, + ) -> Id; + + #[method_id(@__retain_semantics Other configurationWithTextStyle:)] + pub unsafe fn configurationWithTextStyle(style: &NSFontTextStyle) -> Id; + + #[method_id(@__retain_semantics Other configurationWithScale:)] + pub unsafe fn configurationWithScale(scale: NSImageSymbolScale) -> Id; + + #[method_id(@__retain_semantics Other configurationWithHierarchicalColor:)] + pub unsafe fn configurationWithHierarchicalColor( + hierarchicalColor: &NSColor, + ) -> Id; + + #[method_id(@__retain_semantics Other configurationWithPaletteColors:)] + pub unsafe fn configurationWithPaletteColors( + paletteColors: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other configurationPreferringMulticolor)] + pub unsafe fn configurationPreferringMulticolor() -> Id; + + #[method_id(@__retain_semantics Other configurationByApplyingConfiguration:)] + pub unsafe fn configurationByApplyingConfiguration( + &self, + configuration: &NSImageSymbolConfiguration, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSImageCell.rs b/crates/icrate/src/generated/AppKit/NSImageCell.rs new file mode 100644 index 000000000..09d8819cf --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSImageCell.rs @@ -0,0 +1,63 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSImageAlignment { + NSImageAlignCenter = 0, + NSImageAlignTop = 1, + NSImageAlignTopLeft = 2, + NSImageAlignTopRight = 3, + NSImageAlignLeft = 4, + NSImageAlignBottom = 5, + NSImageAlignBottomLeft = 6, + NSImageAlignBottomRight = 7, + NSImageAlignRight = 8, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSImageFrameStyle { + NSImageFrameNone = 0, + NSImageFramePhoto = 1, + NSImageFrameGrayBezel = 2, + NSImageFrameGroove = 3, + NSImageFrameButton = 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSImageCell; + + unsafe impl ClassType for NSImageCell { + type Super = NSCell; + } +); + +extern_methods!( + unsafe impl NSImageCell { + #[method(imageAlignment)] + pub unsafe fn imageAlignment(&self) -> NSImageAlignment; + + #[method(setImageAlignment:)] + pub unsafe fn setImageAlignment(&self, imageAlignment: NSImageAlignment); + + #[method(imageScaling)] + pub unsafe fn imageScaling(&self) -> NSImageScaling; + + #[method(setImageScaling:)] + pub unsafe fn setImageScaling(&self, imageScaling: NSImageScaling); + + #[method(imageFrameStyle)] + pub unsafe fn imageFrameStyle(&self) -> NSImageFrameStyle; + + #[method(setImageFrameStyle:)] + pub unsafe fn setImageFrameStyle(&self, imageFrameStyle: NSImageFrameStyle); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSImageRep.rs b/crates/icrate/src/generated/AppKit/NSImageRep.rs new file mode 100644 index 000000000..2bce2abad --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSImageRep.rs @@ -0,0 +1,191 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSImageHintKey = NSString; + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSImageRepMatchesDevice = 0, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSImageLayoutDirection { + NSImageLayoutDirectionUnspecified = -1, + NSImageLayoutDirectionLeftToRight = 2, + NSImageLayoutDirectionRightToLeft = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSImageRep; + + unsafe impl ClassType for NSImageRep { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSImageRep { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method(draw)] + pub unsafe fn draw(&self) -> bool; + + #[method(drawAtPoint:)] + pub unsafe fn drawAtPoint(&self, point: NSPoint) -> bool; + + #[method(drawInRect:)] + pub unsafe fn drawInRect(&self, rect: NSRect) -> bool; + + #[method(drawInRect:fromRect:operation:fraction:respectFlipped:hints:)] + pub unsafe fn drawInRect_fromRect_operation_fraction_respectFlipped_hints( + &self, + dstSpacePortionRect: NSRect, + srcSpacePortionRect: NSRect, + op: NSCompositingOperation, + requestedAlpha: CGFloat, + respectContextIsFlipped: bool, + hints: Option<&NSDictionary>, + ) -> bool; + + #[method(size)] + pub unsafe fn size(&self) -> NSSize; + + #[method(setSize:)] + pub unsafe fn setSize(&self, size: NSSize); + + #[method(hasAlpha)] + pub unsafe fn hasAlpha(&self) -> bool; + + #[method(setAlpha:)] + pub unsafe fn setAlpha(&self, alpha: bool); + + #[method(isOpaque)] + pub unsafe fn isOpaque(&self) -> bool; + + #[method(setOpaque:)] + pub unsafe fn setOpaque(&self, opaque: bool); + + #[method_id(@__retain_semantics Other colorSpaceName)] + pub unsafe fn colorSpaceName(&self) -> Id; + + #[method(setColorSpaceName:)] + pub unsafe fn setColorSpaceName(&self, colorSpaceName: &NSColorSpaceName); + + #[method(bitsPerSample)] + pub unsafe fn bitsPerSample(&self) -> NSInteger; + + #[method(setBitsPerSample:)] + pub unsafe fn setBitsPerSample(&self, bitsPerSample: NSInteger); + + #[method(pixelsWide)] + pub unsafe fn pixelsWide(&self) -> NSInteger; + + #[method(setPixelsWide:)] + pub unsafe fn setPixelsWide(&self, pixelsWide: NSInteger); + + #[method(pixelsHigh)] + pub unsafe fn pixelsHigh(&self) -> NSInteger; + + #[method(setPixelsHigh:)] + pub unsafe fn setPixelsHigh(&self, pixelsHigh: NSInteger); + + #[method(layoutDirection)] + pub unsafe fn layoutDirection(&self) -> NSImageLayoutDirection; + + #[method(setLayoutDirection:)] + pub unsafe fn setLayoutDirection(&self, layoutDirection: NSImageLayoutDirection); + + #[method(registerImageRepClass:)] + pub unsafe fn registerImageRepClass(imageRepClass: &Class); + + #[method(unregisterImageRepClass:)] + pub unsafe fn unregisterImageRepClass(imageRepClass: &Class); + + #[method_id(@__retain_semantics Other registeredImageRepClasses)] + pub unsafe fn registeredImageRepClasses() -> Id, Shared>; + + #[method(imageRepClassForFileType:)] + pub unsafe fn imageRepClassForFileType(type_: &NSString) -> Option<&'static Class>; + + #[method(imageRepClassForPasteboardType:)] + pub unsafe fn imageRepClassForPasteboardType( + type_: &NSPasteboardType, + ) -> Option<&'static Class>; + + #[method(imageRepClassForType:)] + pub unsafe fn imageRepClassForType(type_: &NSString) -> Option<&'static Class>; + + #[method(imageRepClassForData:)] + pub unsafe fn imageRepClassForData(data: &NSData) -> Option<&'static Class>; + + #[method(canInitWithData:)] + pub unsafe fn canInitWithData(data: &NSData) -> bool; + + #[method_id(@__retain_semantics Other imageUnfilteredFileTypes)] + pub unsafe fn imageUnfilteredFileTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other imageUnfilteredPasteboardTypes)] + pub unsafe fn imageUnfilteredPasteboardTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other imageFileTypes)] + pub unsafe fn imageFileTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other imagePasteboardTypes)] + pub unsafe fn imagePasteboardTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other imageUnfilteredTypes)] + pub unsafe fn imageUnfilteredTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other imageTypes)] + pub unsafe fn imageTypes() -> Id, Shared>; + + #[method(canInitWithPasteboard:)] + pub unsafe fn canInitWithPasteboard(pasteboard: &NSPasteboard) -> bool; + + #[method_id(@__retain_semantics Other imageRepsWithContentsOfFile:)] + pub unsafe fn imageRepsWithContentsOfFile( + filename: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other imageRepWithContentsOfFile:)] + pub unsafe fn imageRepWithContentsOfFile( + filename: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other imageRepsWithContentsOfURL:)] + pub unsafe fn imageRepsWithContentsOfURL( + url: &NSURL, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other imageRepWithContentsOfURL:)] + pub unsafe fn imageRepWithContentsOfURL(url: &NSURL) -> Option>; + + #[method_id(@__retain_semantics Other imageRepsWithPasteboard:)] + pub unsafe fn imageRepsWithPasteboard( + pasteboard: &NSPasteboard, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other imageRepWithPasteboard:)] + pub unsafe fn imageRepWithPasteboard( + pasteboard: &NSPasteboard, + ) -> Option>; + } +); + +extern_static!(NSImageRepRegistryDidChangeNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/AppKit/NSImageView.rs b/crates/icrate/src/generated/AppKit/NSImageView.rs new file mode 100644 index 000000000..6fcde1f76 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSImageView.rs @@ -0,0 +1,79 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSImageView; + + unsafe impl ClassType for NSImageView { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSImageView { + #[method_id(@__retain_semantics Other imageViewWithImage:)] + pub unsafe fn imageViewWithImage(image: &NSImage) -> Id; + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + + #[method(isEditable)] + pub unsafe fn isEditable(&self) -> bool; + + #[method(setEditable:)] + pub unsafe fn setEditable(&self, editable: bool); + + #[method(imageAlignment)] + pub unsafe fn imageAlignment(&self) -> NSImageAlignment; + + #[method(setImageAlignment:)] + pub unsafe fn setImageAlignment(&self, imageAlignment: NSImageAlignment); + + #[method(imageScaling)] + pub unsafe fn imageScaling(&self) -> NSImageScaling; + + #[method(setImageScaling:)] + pub unsafe fn setImageScaling(&self, imageScaling: NSImageScaling); + + #[method(imageFrameStyle)] + pub unsafe fn imageFrameStyle(&self) -> NSImageFrameStyle; + + #[method(setImageFrameStyle:)] + pub unsafe fn setImageFrameStyle(&self, imageFrameStyle: NSImageFrameStyle); + + #[method_id(@__retain_semantics Other symbolConfiguration)] + pub unsafe fn symbolConfiguration(&self) -> Option>; + + #[method(setSymbolConfiguration:)] + pub unsafe fn setSymbolConfiguration( + &self, + symbolConfiguration: Option<&NSImageSymbolConfiguration>, + ); + + #[method_id(@__retain_semantics Other contentTintColor)] + pub unsafe fn contentTintColor(&self) -> Option>; + + #[method(setContentTintColor:)] + pub unsafe fn setContentTintColor(&self, contentTintColor: Option<&NSColor>); + + #[method(animates)] + pub unsafe fn animates(&self) -> bool; + + #[method(setAnimates:)] + pub unsafe fn setAnimates(&self, animates: bool); + + #[method(allowsCutCopyPaste)] + pub unsafe fn allowsCutCopyPaste(&self) -> bool; + + #[method(setAllowsCutCopyPaste:)] + pub unsafe fn setAllowsCutCopyPaste(&self, allowsCutCopyPaste: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSInputManager.rs b/crates/icrate/src/generated/AppKit/NSInputManager.rs new file mode 100644 index 000000000..518fd3d9c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSInputManager.rs @@ -0,0 +1,118 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSTextInput; + + unsafe impl NSTextInput { + #[method(insertText:)] + pub unsafe fn insertText(&self, string: Option<&Object>); + + #[method(doCommandBySelector:)] + pub unsafe fn doCommandBySelector(&self, selector: OptionSel); + + #[method(setMarkedText:selectedRange:)] + pub unsafe fn setMarkedText_selectedRange( + &self, + string: Option<&Object>, + selRange: NSRange, + ); + + #[method(unmarkText)] + pub unsafe fn unmarkText(&self); + + #[method(hasMarkedText)] + pub unsafe fn hasMarkedText(&self) -> bool; + + #[method(conversationIdentifier)] + pub unsafe fn conversationIdentifier(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other attributedSubstringFromRange:)] + pub unsafe fn attributedSubstringFromRange( + &self, + range: NSRange, + ) -> Option>; + + #[method(markedRange)] + pub unsafe fn markedRange(&self) -> NSRange; + + #[method(selectedRange)] + pub unsafe fn selectedRange(&self) -> NSRange; + + #[method(firstRectForCharacterRange:)] + pub unsafe fn firstRectForCharacterRange(&self, range: NSRange) -> NSRect; + + #[method(characterIndexForPoint:)] + pub unsafe fn characterIndexForPoint(&self, point: NSPoint) -> NSUInteger; + + #[method_id(@__retain_semantics Other validAttributesForMarkedText)] + pub unsafe fn validAttributesForMarkedText(&self) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSInputManager; + + unsafe impl ClassType for NSInputManager { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSInputManager { + #[method_id(@__retain_semantics Other currentInputManager)] + pub unsafe fn currentInputManager() -> Option>; + + #[method(cycleToNextInputLanguage:)] + pub unsafe fn cycleToNextInputLanguage(sender: Option<&Object>); + + #[method(cycleToNextInputServerInLanguage:)] + pub unsafe fn cycleToNextInputServerInLanguage(sender: Option<&Object>); + + #[method_id(@__retain_semantics Init initWithName:host:)] + pub unsafe fn initWithName_host( + this: Option>, + inputServerName: Option<&NSString>, + hostName: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Other localizedInputManagerName)] + pub unsafe fn localizedInputManagerName(&self) -> Option>; + + #[method(markedTextAbandoned:)] + pub unsafe fn markedTextAbandoned(&self, cli: Option<&Object>); + + #[method(markedTextSelectionChanged:client:)] + pub unsafe fn markedTextSelectionChanged_client( + &self, + newSel: NSRange, + cli: Option<&Object>, + ); + + #[method(wantsToInterpretAllKeystrokes)] + pub unsafe fn wantsToInterpretAllKeystrokes(&self) -> bool; + + #[method_id(@__retain_semantics Other language)] + pub unsafe fn language(&self) -> Option>; + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method_id(@__retain_semantics Other server)] + pub unsafe fn server(&self) -> Option>; + + #[method(wantsToHandleMouseEvents)] + pub unsafe fn wantsToHandleMouseEvents(&self) -> bool; + + #[method(handleMouseEvent:)] + pub unsafe fn handleMouseEvent(&self, mouseEvent: Option<&NSEvent>) -> bool; + + #[method(wantsToDelayTextChangeNotifications)] + pub unsafe fn wantsToDelayTextChangeNotifications(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSInputServer.rs b/crates/icrate/src/generated/AppKit/NSInputServer.rs new file mode 100644 index 000000000..035c641a6 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSInputServer.rs @@ -0,0 +1,126 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSInputServiceProvider; + + unsafe impl NSInputServiceProvider { + #[method(insertText:client:)] + pub unsafe fn insertText_client(&self, string: Option<&Object>, sender: Option<&Object>); + + #[method(doCommandBySelector:client:)] + pub unsafe fn doCommandBySelector_client( + &self, + selector: OptionSel, + sender: Option<&Object>, + ); + + #[method(markedTextAbandoned:)] + pub unsafe fn markedTextAbandoned(&self, sender: Option<&Object>); + + #[method(markedTextSelectionChanged:client:)] + pub unsafe fn markedTextSelectionChanged_client( + &self, + newSel: NSRange, + sender: Option<&Object>, + ); + + #[method(terminate:)] + pub unsafe fn terminate(&self, sender: Option<&Object>); + + #[method(canBeDisabled)] + pub unsafe fn canBeDisabled(&self) -> bool; + + #[method(wantsToInterpretAllKeystrokes)] + pub unsafe fn wantsToInterpretAllKeystrokes(&self) -> bool; + + #[method(wantsToHandleMouseEvents)] + pub unsafe fn wantsToHandleMouseEvents(&self) -> bool; + + #[method(wantsToDelayTextChangeNotifications)] + pub unsafe fn wantsToDelayTextChangeNotifications(&self) -> bool; + + #[method(inputClientBecomeActive:)] + pub unsafe fn inputClientBecomeActive(&self, sender: Option<&Object>); + + #[method(inputClientResignActive:)] + pub unsafe fn inputClientResignActive(&self, sender: Option<&Object>); + + #[method(inputClientEnabled:)] + pub unsafe fn inputClientEnabled(&self, sender: Option<&Object>); + + #[method(inputClientDisabled:)] + pub unsafe fn inputClientDisabled(&self, sender: Option<&Object>); + + #[method(activeConversationWillChange:fromOldConversation:)] + pub unsafe fn activeConversationWillChange_fromOldConversation( + &self, + sender: Option<&Object>, + oldConversation: NSInteger, + ); + + #[method(activeConversationChanged:toNewConversation:)] + pub unsafe fn activeConversationChanged_toNewConversation( + &self, + sender: Option<&Object>, + newConversation: NSInteger, + ); + } +); + +extern_protocol!( + pub struct NSInputServerMouseTracker; + + unsafe impl NSInputServerMouseTracker { + #[method(mouseDownOnCharacterIndex:atCoordinate:withModifier:client:)] + pub unsafe fn mouseDownOnCharacterIndex_atCoordinate_withModifier_client( + &self, + index: NSUInteger, + point: NSPoint, + flags: NSUInteger, + sender: Option<&Object>, + ) -> bool; + + #[method(mouseDraggedOnCharacterIndex:atCoordinate:withModifier:client:)] + pub unsafe fn mouseDraggedOnCharacterIndex_atCoordinate_withModifier_client( + &self, + index: NSUInteger, + point: NSPoint, + flags: NSUInteger, + sender: Option<&Object>, + ) -> bool; + + #[method(mouseUpOnCharacterIndex:atCoordinate:withModifier:client:)] + pub unsafe fn mouseUpOnCharacterIndex_atCoordinate_withModifier_client( + &self, + index: NSUInteger, + point: NSPoint, + flags: NSUInteger, + sender: Option<&Object>, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSInputServer; + + unsafe impl ClassType for NSInputServer { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSInputServer { + #[method_id(@__retain_semantics Init initWithDelegate:name:)] + pub unsafe fn initWithDelegate_name( + this: Option>, + delegate: Option<&Object>, + name: Option<&NSString>, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSInterfaceStyle.rs b/crates/icrate/src/generated/AppKit/NSInterfaceStyle.rs new file mode 100644 index 000000000..0f952c07c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSInterfaceStyle.rs @@ -0,0 +1,38 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSNoInterfaceStyle = 0, + NSNextStepInterfaceStyle = 1, + NSWindows95InterfaceStyle = 2, + NSMacintoshInterfaceStyle = 3, + } +); + +pub type NSInterfaceStyle = NSUInteger; + +extern_fn!( + pub unsafe fn NSInterfaceStyleForKey( + key: Option<&NSString>, + responder: Option<&NSResponder>, + ) -> NSInterfaceStyle; +); + +extern_methods!( + /// NSInterfaceStyle + unsafe impl NSResponder { + #[method(interfaceStyle)] + pub unsafe fn interfaceStyle(&self) -> NSInterfaceStyle; + + #[method(setInterfaceStyle:)] + pub unsafe fn setInterfaceStyle(&self, interfaceStyle: NSInterfaceStyle); + } +); + +extern_static!(NSInterfaceStyleDefault: Option<&'static NSString>); diff --git a/crates/icrate/src/generated/AppKit/NSItemProvider.rs b/crates/icrate/src/generated/AppKit/NSItemProvider.rs new file mode 100644 index 000000000..b89007ffa --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSItemProvider.rs @@ -0,0 +1,28 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_methods!( + /// NSItemSourceInfo + unsafe impl NSItemProvider { + #[method(sourceFrame)] + pub unsafe fn sourceFrame(&self) -> NSRect; + + #[method(containerFrame)] + pub unsafe fn containerFrame(&self) -> NSRect; + + #[method(preferredPresentationSize)] + pub unsafe fn preferredPresentationSize(&self) -> NSSize; + } +); + +extern_static!(NSTypeIdentifierDateText: &'static NSString); + +extern_static!(NSTypeIdentifierAddressText: &'static NSString); + +extern_static!(NSTypeIdentifierPhoneNumberText: &'static NSString); + +extern_static!(NSTypeIdentifierTransitInformationText: &'static NSString); diff --git a/crates/icrate/src/generated/AppKit/NSKeyValueBinding.rs b/crates/icrate/src/generated/AppKit/NSKeyValueBinding.rs new file mode 100644 index 000000000..1a7016a0d --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSKeyValueBinding.rs @@ -0,0 +1,412 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSBindingName = NSString; + +pub type NSBindingOption = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSBindingSelectionMarker; + + unsafe impl ClassType for NSBindingSelectionMarker { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSBindingSelectionMarker { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other multipleValuesSelectionMarker)] + pub unsafe fn multipleValuesSelectionMarker() -> Id; + + #[method_id(@__retain_semantics Other noSelectionMarker)] + pub unsafe fn noSelectionMarker() -> Id; + + #[method_id(@__retain_semantics Other notApplicableSelectionMarker)] + pub unsafe fn notApplicableSelectionMarker() -> Id; + + #[method(setDefaultPlaceholder:forMarker:onClass:withBinding:)] + pub unsafe fn setDefaultPlaceholder_forMarker_onClass_withBinding( + placeholder: Option<&Object>, + marker: Option<&NSBindingSelectionMarker>, + objectClass: &Class, + binding: &NSBindingName, + ); + + #[method_id(@__retain_semantics Other defaultPlaceholderForMarker:onClass:withBinding:)] + pub unsafe fn defaultPlaceholderForMarker_onClass_withBinding( + marker: Option<&NSBindingSelectionMarker>, + objectClass: &Class, + binding: &NSBindingName, + ) -> Option>; + } +); + +extern_static!(NSMultipleValuesMarker: &'static Object); + +extern_static!(NSNoSelectionMarker: &'static Object); + +extern_static!(NSNotApplicableMarker: &'static Object); + +extern_fn!( + pub unsafe fn NSIsControllerMarker(object: Option<&Object>) -> Bool; +); + +pub type NSBindingInfoKey = NSString; + +extern_static!(NSObservedObjectKey: &'static NSBindingInfoKey); + +extern_static!(NSObservedKeyPathKey: &'static NSBindingInfoKey); + +extern_static!(NSOptionsKey: &'static NSBindingInfoKey); + +extern_methods!( + /// NSKeyValueBindingCreation + unsafe impl NSObject { + #[method(exposeBinding:)] + pub unsafe fn exposeBinding(binding: &NSBindingName); + + #[method_id(@__retain_semantics Other exposedBindings)] + pub unsafe fn exposedBindings(&self) -> Id, Shared>; + + #[method(valueClassForBinding:)] + pub unsafe fn valueClassForBinding( + &self, + binding: &NSBindingName, + ) -> Option<&'static Class>; + + #[method(bind:toObject:withKeyPath:options:)] + pub unsafe fn bind_toObject_withKeyPath_options( + &self, + binding: &NSBindingName, + observable: &Object, + keyPath: &NSString, + options: Option<&NSDictionary>, + ); + + #[method(unbind:)] + pub unsafe fn unbind(&self, binding: &NSBindingName); + + #[method_id(@__retain_semantics Other infoForBinding:)] + pub unsafe fn infoForBinding( + &self, + binding: &NSBindingName, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other optionDescriptionsForBinding:)] + pub unsafe fn optionDescriptionsForBinding( + &self, + binding: &NSBindingName, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSPlaceholders + unsafe impl NSObject { + #[method(setDefaultPlaceholder:forMarker:withBinding:)] + pub unsafe fn setDefaultPlaceholder_forMarker_withBinding( + placeholder: Option<&Object>, + marker: Option<&Object>, + binding: &NSBindingName, + ); + + #[method_id(@__retain_semantics Other defaultPlaceholderForMarker:withBinding:)] + pub unsafe fn defaultPlaceholderForMarker_withBinding( + marker: Option<&Object>, + binding: &NSBindingName, + ) -> Option>; + } +); + +extern_protocol!( + pub struct NSEditor; + + unsafe impl NSEditor { + #[method(discardEditing)] + pub unsafe fn discardEditing(&self); + + #[method(commitEditing)] + pub unsafe fn commitEditing(&self) -> bool; + + #[method(commitEditingWithDelegate:didCommitSelector:contextInfo:)] + pub unsafe fn commitEditingWithDelegate_didCommitSelector_contextInfo( + &self, + delegate: Option<&Object>, + didCommitSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(commitEditingAndReturnError:)] + pub unsafe fn commitEditingAndReturnError(&self) -> Result<(), Id>; + } +); + +extern_protocol!( + pub struct NSEditorRegistration; + + unsafe impl NSEditorRegistration { + #[optional] + #[method(objectDidBeginEditing:)] + pub unsafe fn objectDidBeginEditing(&self, editor: &NSEditor); + + #[optional] + #[method(objectDidEndEditing:)] + pub unsafe fn objectDidEndEditing(&self, editor: &NSEditor); + } +); + +extern_methods!( + /// NSEditor + unsafe impl NSObject { + #[method(discardEditing)] + pub unsafe fn discardEditing(&self); + + #[method(commitEditing)] + pub unsafe fn commitEditing(&self) -> bool; + + #[method(commitEditingWithDelegate:didCommitSelector:contextInfo:)] + pub unsafe fn commitEditingWithDelegate_didCommitSelector_contextInfo( + &self, + delegate: Option<&Object>, + didCommitSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(commitEditingAndReturnError:)] + pub unsafe fn commitEditingAndReturnError(&self) -> Result<(), Id>; + } +); + +extern_methods!( + /// NSEditorRegistration + unsafe impl NSObject { + #[method(objectDidBeginEditing:)] + pub unsafe fn objectDidBeginEditing(&self, editor: &NSEditor); + + #[method(objectDidEndEditing:)] + pub unsafe fn objectDidEndEditing(&self, editor: &NSEditor); + } +); + +extern_static!(NSAlignmentBinding: &'static NSBindingName); + +extern_static!(NSAlternateImageBinding: &'static NSBindingName); + +extern_static!(NSAlternateTitleBinding: &'static NSBindingName); + +extern_static!(NSAnimateBinding: &'static NSBindingName); + +extern_static!(NSAnimationDelayBinding: &'static NSBindingName); + +extern_static!(NSArgumentBinding: &'static NSBindingName); + +extern_static!(NSAttributedStringBinding: &'static NSBindingName); + +extern_static!(NSContentArrayBinding: &'static NSBindingName); + +extern_static!(NSContentArrayForMultipleSelectionBinding: &'static NSBindingName); + +extern_static!(NSContentBinding: &'static NSBindingName); + +extern_static!(NSContentDictionaryBinding: &'static NSBindingName); + +extern_static!(NSContentHeightBinding: &'static NSBindingName); + +extern_static!(NSContentObjectBinding: &'static NSBindingName); + +extern_static!(NSContentObjectsBinding: &'static NSBindingName); + +extern_static!(NSContentSetBinding: &'static NSBindingName); + +extern_static!(NSContentValuesBinding: &'static NSBindingName); + +extern_static!(NSContentWidthBinding: &'static NSBindingName); + +extern_static!(NSCriticalValueBinding: &'static NSBindingName); + +extern_static!(NSDataBinding: &'static NSBindingName); + +extern_static!(NSDisplayPatternTitleBinding: &'static NSBindingName); + +extern_static!(NSDisplayPatternValueBinding: &'static NSBindingName); + +extern_static!(NSDocumentEditedBinding: &'static NSBindingName); + +extern_static!(NSDoubleClickArgumentBinding: &'static NSBindingName); + +extern_static!(NSDoubleClickTargetBinding: &'static NSBindingName); + +extern_static!(NSEditableBinding: &'static NSBindingName); + +extern_static!(NSEnabledBinding: &'static NSBindingName); + +extern_static!(NSExcludedKeysBinding: &'static NSBindingName); + +extern_static!(NSFilterPredicateBinding: &'static NSBindingName); + +extern_static!(NSFontBinding: &'static NSBindingName); + +extern_static!(NSFontBoldBinding: &'static NSBindingName); + +extern_static!(NSFontFamilyNameBinding: &'static NSBindingName); + +extern_static!(NSFontItalicBinding: &'static NSBindingName); + +extern_static!(NSFontNameBinding: &'static NSBindingName); + +extern_static!(NSFontSizeBinding: &'static NSBindingName); + +extern_static!(NSHeaderTitleBinding: &'static NSBindingName); + +extern_static!(NSHiddenBinding: &'static NSBindingName); + +extern_static!(NSImageBinding: &'static NSBindingName); + +extern_static!(NSIncludedKeysBinding: &'static NSBindingName); + +extern_static!(NSInitialKeyBinding: &'static NSBindingName); + +extern_static!(NSInitialValueBinding: &'static NSBindingName); + +extern_static!(NSIsIndeterminateBinding: &'static NSBindingName); + +extern_static!(NSLabelBinding: &'static NSBindingName); + +extern_static!(NSLocalizedKeyDictionaryBinding: &'static NSBindingName); + +extern_static!(NSManagedObjectContextBinding: &'static NSBindingName); + +extern_static!(NSMaximumRecentsBinding: &'static NSBindingName); + +extern_static!(NSMaxValueBinding: &'static NSBindingName); + +extern_static!(NSMaxWidthBinding: &'static NSBindingName); + +extern_static!(NSMinValueBinding: &'static NSBindingName); + +extern_static!(NSMinWidthBinding: &'static NSBindingName); + +extern_static!(NSMixedStateImageBinding: &'static NSBindingName); + +extern_static!(NSOffStateImageBinding: &'static NSBindingName); + +extern_static!(NSOnStateImageBinding: &'static NSBindingName); + +extern_static!(NSPositioningRectBinding: &'static NSBindingName); + +extern_static!(NSPredicateBinding: &'static NSBindingName); + +extern_static!(NSRecentSearchesBinding: &'static NSBindingName); + +extern_static!(NSRepresentedFilenameBinding: &'static NSBindingName); + +extern_static!(NSRowHeightBinding: &'static NSBindingName); + +extern_static!(NSSelectedIdentifierBinding: &'static NSBindingName); + +extern_static!(NSSelectedIndexBinding: &'static NSBindingName); + +extern_static!(NSSelectedLabelBinding: &'static NSBindingName); + +extern_static!(NSSelectedObjectBinding: &'static NSBindingName); + +extern_static!(NSSelectedObjectsBinding: &'static NSBindingName); + +extern_static!(NSSelectedTagBinding: &'static NSBindingName); + +extern_static!(NSSelectedValueBinding: &'static NSBindingName); + +extern_static!(NSSelectedValuesBinding: &'static NSBindingName); + +extern_static!(NSSelectionIndexesBinding: &'static NSBindingName); + +extern_static!(NSSelectionIndexPathsBinding: &'static NSBindingName); + +extern_static!(NSSortDescriptorsBinding: &'static NSBindingName); + +extern_static!(NSTargetBinding: &'static NSBindingName); + +extern_static!(NSTextColorBinding: &'static NSBindingName); + +extern_static!(NSTitleBinding: &'static NSBindingName); + +extern_static!(NSToolTipBinding: &'static NSBindingName); + +extern_static!(NSTransparentBinding: &'static NSBindingName); + +extern_static!(NSValueBinding: &'static NSBindingName); + +extern_static!(NSValuePathBinding: &'static NSBindingName); + +extern_static!(NSValueURLBinding: &'static NSBindingName); + +extern_static!(NSVisibleBinding: &'static NSBindingName); + +extern_static!(NSWarningValueBinding: &'static NSBindingName); + +extern_static!(NSWidthBinding: &'static NSBindingName); + +extern_static!(NSAllowsEditingMultipleValuesSelectionBindingOption: &'static NSBindingOption); + +extern_static!(NSAllowsNullArgumentBindingOption: &'static NSBindingOption); + +extern_static!(NSAlwaysPresentsApplicationModalAlertsBindingOption: &'static NSBindingOption); + +extern_static!(NSConditionallySetsEditableBindingOption: &'static NSBindingOption); + +extern_static!(NSConditionallySetsEnabledBindingOption: &'static NSBindingOption); + +extern_static!(NSConditionallySetsHiddenBindingOption: &'static NSBindingOption); + +extern_static!(NSContinuouslyUpdatesValueBindingOption: &'static NSBindingOption); + +extern_static!(NSCreatesSortDescriptorBindingOption: &'static NSBindingOption); + +extern_static!(NSDeletesObjectsOnRemoveBindingsOption: &'static NSBindingOption); + +extern_static!(NSDisplayNameBindingOption: &'static NSBindingOption); + +extern_static!(NSDisplayPatternBindingOption: &'static NSBindingOption); + +extern_static!(NSContentPlacementTagBindingOption: &'static NSBindingOption); + +extern_static!(NSHandlesContentAsCompoundValueBindingOption: &'static NSBindingOption); + +extern_static!(NSInsertsNullPlaceholderBindingOption: &'static NSBindingOption); + +extern_static!(NSInvokesSeparatelyWithArrayObjectsBindingOption: &'static NSBindingOption); + +extern_static!(NSMultipleValuesPlaceholderBindingOption: &'static NSBindingOption); + +extern_static!(NSNoSelectionPlaceholderBindingOption: &'static NSBindingOption); + +extern_static!(NSNotApplicablePlaceholderBindingOption: &'static NSBindingOption); + +extern_static!(NSNullPlaceholderBindingOption: &'static NSBindingOption); + +extern_static!(NSRaisesForNotApplicableKeysBindingOption: &'static NSBindingOption); + +extern_static!(NSPredicateFormatBindingOption: &'static NSBindingOption); + +extern_static!(NSSelectorNameBindingOption: &'static NSBindingOption); + +extern_static!(NSSelectsAllWhenSettingContentBindingOption: &'static NSBindingOption); + +extern_static!(NSValidatesImmediatelyBindingOption: &'static NSBindingOption); + +extern_static!(NSValueTransformerNameBindingOption: &'static NSBindingOption); + +extern_static!(NSValueTransformerBindingOption: &'static NSBindingOption); + +extern_methods!( + /// NSEditorAndEditorRegistrationConformance + unsafe impl NSManagedObjectContext {} +); diff --git a/crates/icrate/src/generated/AppKit/NSLayoutAnchor.rs b/crates/icrate/src/generated/AppKit/NSLayoutAnchor.rs new file mode 100644 index 000000000..13ed1033e --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSLayoutAnchor.rs @@ -0,0 +1,228 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSLayoutAnchor { + _inner0: PhantomData<*mut AnchorType>, + } + + unsafe impl ClassType for NSLayoutAnchor { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSLayoutAnchor { + #[method_id(@__retain_semantics Other constraintEqualToAnchor:)] + pub unsafe fn constraintEqualToAnchor( + &self, + anchor: &NSLayoutAnchor, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToAnchor:)] + pub unsafe fn constraintGreaterThanOrEqualToAnchor( + &self, + anchor: &NSLayoutAnchor, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintLessThanOrEqualToAnchor:)] + pub unsafe fn constraintLessThanOrEqualToAnchor( + &self, + anchor: &NSLayoutAnchor, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintEqualToAnchor:constant:)] + pub unsafe fn constraintEqualToAnchor_constant( + &self, + anchor: &NSLayoutAnchor, + c: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToAnchor:constant:)] + pub unsafe fn constraintGreaterThanOrEqualToAnchor_constant( + &self, + anchor: &NSLayoutAnchor, + c: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintLessThanOrEqualToAnchor:constant:)] + pub unsafe fn constraintLessThanOrEqualToAnchor_constant( + &self, + anchor: &NSLayoutAnchor, + c: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other item)] + pub unsafe fn item(&self) -> Option>; + + #[method(hasAmbiguousLayout)] + pub unsafe fn hasAmbiguousLayout(&self) -> bool; + + #[method_id(@__retain_semantics Other constraintsAffectingLayout)] + pub unsafe fn constraintsAffectingLayout(&self) -> Id, Shared>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSLayoutXAxisAnchor; + + unsafe impl ClassType for NSLayoutXAxisAnchor { + type Super = NSLayoutAnchor; + } +); + +extern_methods!( + unsafe impl NSLayoutXAxisAnchor { + #[method_id(@__retain_semantics Other anchorWithOffsetToAnchor:)] + pub unsafe fn anchorWithOffsetToAnchor( + &self, + otherAnchor: &NSLayoutXAxisAnchor, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintEqualToSystemSpacingAfterAnchor:multiplier:)] + pub unsafe fn constraintEqualToSystemSpacingAfterAnchor_multiplier( + &self, + anchor: &NSLayoutXAxisAnchor, + multiplier: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToSystemSpacingAfterAnchor:multiplier:)] + pub unsafe fn constraintGreaterThanOrEqualToSystemSpacingAfterAnchor_multiplier( + &self, + anchor: &NSLayoutXAxisAnchor, + multiplier: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintLessThanOrEqualToSystemSpacingAfterAnchor:multiplier:)] + pub unsafe fn constraintLessThanOrEqualToSystemSpacingAfterAnchor_multiplier( + &self, + anchor: &NSLayoutXAxisAnchor, + multiplier: CGFloat, + ) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSLayoutYAxisAnchor; + + unsafe impl ClassType for NSLayoutYAxisAnchor { + type Super = NSLayoutAnchor; + } +); + +extern_methods!( + unsafe impl NSLayoutYAxisAnchor { + #[method_id(@__retain_semantics Other anchorWithOffsetToAnchor:)] + pub unsafe fn anchorWithOffsetToAnchor( + &self, + otherAnchor: &NSLayoutYAxisAnchor, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintEqualToSystemSpacingBelowAnchor:multiplier:)] + pub unsafe fn constraintEqualToSystemSpacingBelowAnchor_multiplier( + &self, + anchor: &NSLayoutYAxisAnchor, + multiplier: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToSystemSpacingBelowAnchor:multiplier:)] + pub unsafe fn constraintGreaterThanOrEqualToSystemSpacingBelowAnchor_multiplier( + &self, + anchor: &NSLayoutYAxisAnchor, + multiplier: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintLessThanOrEqualToSystemSpacingBelowAnchor:multiplier:)] + pub unsafe fn constraintLessThanOrEqualToSystemSpacingBelowAnchor_multiplier( + &self, + anchor: &NSLayoutYAxisAnchor, + multiplier: CGFloat, + ) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSLayoutDimension; + + unsafe impl ClassType for NSLayoutDimension { + type Super = NSLayoutAnchor; + } +); + +extern_methods!( + unsafe impl NSLayoutDimension { + #[method_id(@__retain_semantics Other constraintEqualToConstant:)] + pub unsafe fn constraintEqualToConstant( + &self, + c: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToConstant:)] + pub unsafe fn constraintGreaterThanOrEqualToConstant( + &self, + c: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintLessThanOrEqualToConstant:)] + pub unsafe fn constraintLessThanOrEqualToConstant( + &self, + c: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintEqualToAnchor:multiplier:)] + pub unsafe fn constraintEqualToAnchor_multiplier( + &self, + anchor: &NSLayoutDimension, + m: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToAnchor:multiplier:)] + pub unsafe fn constraintGreaterThanOrEqualToAnchor_multiplier( + &self, + anchor: &NSLayoutDimension, + m: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintLessThanOrEqualToAnchor:multiplier:)] + pub unsafe fn constraintLessThanOrEqualToAnchor_multiplier( + &self, + anchor: &NSLayoutDimension, + m: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintEqualToAnchor:multiplier:constant:)] + pub unsafe fn constraintEqualToAnchor_multiplier_constant( + &self, + anchor: &NSLayoutDimension, + m: CGFloat, + c: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToAnchor:multiplier:constant:)] + pub unsafe fn constraintGreaterThanOrEqualToAnchor_multiplier_constant( + &self, + anchor: &NSLayoutDimension, + m: CGFloat, + c: CGFloat, + ) -> Id; + + #[method_id(@__retain_semantics Other constraintLessThanOrEqualToAnchor:multiplier:constant:)] + pub unsafe fn constraintLessThanOrEqualToAnchor_multiplier_constant( + &self, + anchor: &NSLayoutDimension, + m: CGFloat, + c: CGFloat, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSLayoutConstraint.rs b/crates/icrate/src/generated/AppKit/NSLayoutConstraint.rs new file mode 100644 index 000000000..156ea843c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSLayoutConstraint.rs @@ -0,0 +1,422 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSLayoutPriority = c_float; + +extern_static!(NSLayoutPriorityRequired: NSLayoutPriority = 1000); + +extern_static!(NSLayoutPriorityDefaultHigh: NSLayoutPriority = 750); + +extern_static!(NSLayoutPriorityDragThatCanResizeWindow: NSLayoutPriority = 510); + +extern_static!(NSLayoutPriorityWindowSizeStayPut: NSLayoutPriority = 500); + +extern_static!(NSLayoutPriorityDragThatCannotResizeWindow: NSLayoutPriority = 490); + +extern_static!(NSLayoutPriorityDefaultLow: NSLayoutPriority = 250); + +extern_static!(NSLayoutPriorityFittingSizeCompression: NSLayoutPriority = 50); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSLayoutConstraintOrientation { + NSLayoutConstraintOrientationHorizontal = 0, + NSLayoutConstraintOrientationVertical = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSLayoutRelation { + NSLayoutRelationLessThanOrEqual = -1, + NSLayoutRelationEqual = 0, + NSLayoutRelationGreaterThanOrEqual = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSLayoutAttribute { + NSLayoutAttributeLeft = 1, + NSLayoutAttributeRight = 2, + NSLayoutAttributeTop = 3, + NSLayoutAttributeBottom = 4, + NSLayoutAttributeLeading = 5, + NSLayoutAttributeTrailing = 6, + NSLayoutAttributeWidth = 7, + NSLayoutAttributeHeight = 8, + NSLayoutAttributeCenterX = 9, + NSLayoutAttributeCenterY = 10, + NSLayoutAttributeLastBaseline = 11, + NSLayoutAttributeBaseline = NSLayoutAttributeLastBaseline, + NSLayoutAttributeFirstBaseline = 12, + NSLayoutAttributeNotAnAttribute = 0, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSLayoutFormatOptions { + NSLayoutFormatAlignAllLeft = 1 << NSLayoutAttributeLeft, + NSLayoutFormatAlignAllRight = 1 << NSLayoutAttributeRight, + NSLayoutFormatAlignAllTop = 1 << NSLayoutAttributeTop, + NSLayoutFormatAlignAllBottom = 1 << NSLayoutAttributeBottom, + NSLayoutFormatAlignAllLeading = 1 << NSLayoutAttributeLeading, + NSLayoutFormatAlignAllTrailing = 1 << NSLayoutAttributeTrailing, + NSLayoutFormatAlignAllCenterX = 1 << NSLayoutAttributeCenterX, + NSLayoutFormatAlignAllCenterY = 1 << NSLayoutAttributeCenterY, + NSLayoutFormatAlignAllLastBaseline = 1 << NSLayoutAttributeLastBaseline, + NSLayoutFormatAlignAllFirstBaseline = 1 << NSLayoutAttributeFirstBaseline, + NSLayoutFormatAlignAllBaseline = NSLayoutFormatAlignAllLastBaseline, + NSLayoutFormatAlignmentMask = 0xFFFF, + NSLayoutFormatDirectionLeadingToTrailing = 0 << 16, + NSLayoutFormatDirectionLeftToRight = 1 << 16, + NSLayoutFormatDirectionRightToLeft = 2 << 16, + NSLayoutFormatDirectionMask = 0x3 << 16, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSLayoutConstraint; + + unsafe impl ClassType for NSLayoutConstraint { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSLayoutConstraint { + #[method_id(@__retain_semantics Other constraintsWithVisualFormat:options:metrics:views:)] + pub unsafe fn constraintsWithVisualFormat_options_metrics_views( + format: &NSString, + opts: NSLayoutFormatOptions, + metrics: Option<&NSDictionary>, + views: &NSDictionary, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:)] + pub unsafe fn constraintWithItem_attribute_relatedBy_toItem_attribute_multiplier_constant( + view1: &Object, + attr1: NSLayoutAttribute, + relation: NSLayoutRelation, + view2: Option<&Object>, + attr2: NSLayoutAttribute, + multiplier: CGFloat, + c: CGFloat, + ) -> Id; + + #[method(priority)] + pub unsafe fn priority(&self) -> NSLayoutPriority; + + #[method(setPriority:)] + pub unsafe fn setPriority(&self, priority: NSLayoutPriority); + + #[method(shouldBeArchived)] + pub unsafe fn shouldBeArchived(&self) -> bool; + + #[method(setShouldBeArchived:)] + pub unsafe fn setShouldBeArchived(&self, shouldBeArchived: bool); + + #[method_id(@__retain_semantics Other firstItem)] + pub unsafe fn firstItem(&self) -> Option>; + + #[method_id(@__retain_semantics Other secondItem)] + pub unsafe fn secondItem(&self) -> Option>; + + #[method(firstAttribute)] + pub unsafe fn firstAttribute(&self) -> NSLayoutAttribute; + + #[method(secondAttribute)] + pub unsafe fn secondAttribute(&self) -> NSLayoutAttribute; + + #[method_id(@__retain_semantics Other firstAnchor)] + pub unsafe fn firstAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other secondAnchor)] + pub unsafe fn secondAnchor(&self) -> Option>; + + #[method(relation)] + pub unsafe fn relation(&self) -> NSLayoutRelation; + + #[method(multiplier)] + pub unsafe fn multiplier(&self) -> CGFloat; + + #[method(constant)] + pub unsafe fn constant(&self) -> CGFloat; + + #[method(setConstant:)] + pub unsafe fn setConstant(&self, constant: CGFloat); + + #[method(isActive)] + pub unsafe fn isActive(&self) -> bool; + + #[method(setActive:)] + pub unsafe fn setActive(&self, active: bool); + + #[method(activateConstraints:)] + pub unsafe fn activateConstraints(constraints: &NSArray); + + #[method(deactivateConstraints:)] + pub unsafe fn deactivateConstraints(constraints: &NSArray); + } +); + +extern_methods!( + /// NSIdentifier + unsafe impl NSLayoutConstraint { + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Option>; + + #[method(setIdentifier:)] + pub unsafe fn setIdentifier(&self, identifier: Option<&NSString>); + } +); + +extern_methods!( + unsafe impl NSLayoutConstraint {} +); + +extern_methods!( + /// NSConstraintBasedLayoutInstallingConstraints + unsafe impl NSView { + #[method_id(@__retain_semantics Other leadingAnchor)] + pub unsafe fn leadingAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other trailingAnchor)] + pub unsafe fn trailingAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other leftAnchor)] + pub unsafe fn leftAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other rightAnchor)] + pub unsafe fn rightAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other topAnchor)] + pub unsafe fn topAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other bottomAnchor)] + pub unsafe fn bottomAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other widthAnchor)] + pub unsafe fn widthAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other heightAnchor)] + pub unsafe fn heightAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other centerXAnchor)] + pub unsafe fn centerXAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other centerYAnchor)] + pub unsafe fn centerYAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other firstBaselineAnchor)] + pub unsafe fn firstBaselineAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other lastBaselineAnchor)] + pub unsafe fn lastBaselineAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other constraints)] + pub unsafe fn constraints(&self) -> Id, Shared>; + + #[method(addConstraint:)] + pub unsafe fn addConstraint(&self, constraint: &NSLayoutConstraint); + + #[method(addConstraints:)] + pub unsafe fn addConstraints(&self, constraints: &NSArray); + + #[method(removeConstraint:)] + pub unsafe fn removeConstraint(&self, constraint: &NSLayoutConstraint); + + #[method(removeConstraints:)] + pub unsafe fn removeConstraints(&self, constraints: &NSArray); + } +); + +extern_methods!( + /// NSConstraintBasedLayoutCoreMethods + unsafe impl NSWindow { + #[method(updateConstraintsIfNeeded)] + pub unsafe fn updateConstraintsIfNeeded(&self); + + #[method(layoutIfNeeded)] + pub unsafe fn layoutIfNeeded(&self); + } +); + +extern_methods!( + /// NSConstraintBasedLayoutCoreMethods + unsafe impl NSView { + #[method(updateConstraintsForSubtreeIfNeeded)] + pub unsafe fn updateConstraintsForSubtreeIfNeeded(&self); + + #[method(updateConstraints)] + pub unsafe fn updateConstraints(&self); + + #[method(needsUpdateConstraints)] + pub unsafe fn needsUpdateConstraints(&self) -> bool; + + #[method(setNeedsUpdateConstraints:)] + pub unsafe fn setNeedsUpdateConstraints(&self, needsUpdateConstraints: bool); + } +); + +extern_methods!( + /// NSConstraintBasedCompatibility + unsafe impl NSView { + #[method(translatesAutoresizingMaskIntoConstraints)] + pub unsafe fn translatesAutoresizingMaskIntoConstraints(&self) -> bool; + + #[method(setTranslatesAutoresizingMaskIntoConstraints:)] + pub unsafe fn setTranslatesAutoresizingMaskIntoConstraints( + &self, + translatesAutoresizingMaskIntoConstraints: bool, + ); + + #[method(requiresConstraintBasedLayout)] + pub unsafe fn requiresConstraintBasedLayout() -> bool; + } +); + +extern_static!(NSViewNoInstrinsicMetric: CGFloat); + +extern_static!(NSViewNoIntrinsicMetric: CGFloat); + +extern_methods!( + /// NSConstraintBasedLayoutLayering + unsafe impl NSView { + #[method(alignmentRectForFrame:)] + pub unsafe fn alignmentRectForFrame(&self, frame: NSRect) -> NSRect; + + #[method(frameForAlignmentRect:)] + pub unsafe fn frameForAlignmentRect(&self, alignmentRect: NSRect) -> NSRect; + + #[method(alignmentRectInsets)] + pub unsafe fn alignmentRectInsets(&self) -> NSEdgeInsets; + + #[method(firstBaselineOffsetFromTop)] + pub unsafe fn firstBaselineOffsetFromTop(&self) -> CGFloat; + + #[method(lastBaselineOffsetFromBottom)] + pub unsafe fn lastBaselineOffsetFromBottom(&self) -> CGFloat; + + #[method(baselineOffsetFromBottom)] + pub unsafe fn baselineOffsetFromBottom(&self) -> CGFloat; + + #[method(intrinsicContentSize)] + pub unsafe fn intrinsicContentSize(&self) -> NSSize; + + #[method(invalidateIntrinsicContentSize)] + pub unsafe fn invalidateIntrinsicContentSize(&self); + + #[method(contentHuggingPriorityForOrientation:)] + pub unsafe fn contentHuggingPriorityForOrientation( + &self, + orientation: NSLayoutConstraintOrientation, + ) -> NSLayoutPriority; + + #[method(setContentHuggingPriority:forOrientation:)] + pub unsafe fn setContentHuggingPriority_forOrientation( + &self, + priority: NSLayoutPriority, + orientation: NSLayoutConstraintOrientation, + ); + + #[method(contentCompressionResistancePriorityForOrientation:)] + pub unsafe fn contentCompressionResistancePriorityForOrientation( + &self, + orientation: NSLayoutConstraintOrientation, + ) -> NSLayoutPriority; + + #[method(setContentCompressionResistancePriority:forOrientation:)] + pub unsafe fn setContentCompressionResistancePriority_forOrientation( + &self, + priority: NSLayoutPriority, + orientation: NSLayoutConstraintOrientation, + ); + + #[method(isHorizontalContentSizeConstraintActive)] + pub unsafe fn isHorizontalContentSizeConstraintActive(&self) -> bool; + + #[method(setHorizontalContentSizeConstraintActive:)] + pub unsafe fn setHorizontalContentSizeConstraintActive( + &self, + horizontalContentSizeConstraintActive: bool, + ); + + #[method(isVerticalContentSizeConstraintActive)] + pub unsafe fn isVerticalContentSizeConstraintActive(&self) -> bool; + + #[method(setVerticalContentSizeConstraintActive:)] + pub unsafe fn setVerticalContentSizeConstraintActive( + &self, + verticalContentSizeConstraintActive: bool, + ); + } +); + +extern_methods!( + /// NSConstraintBasedLayoutLayering + unsafe impl NSControl { + #[method(invalidateIntrinsicContentSizeForCell:)] + pub unsafe fn invalidateIntrinsicContentSizeForCell(&self, cell: &NSCell); + } +); + +extern_methods!( + /// NSConstraintBasedLayoutAnchoring + unsafe impl NSWindow { + #[method(anchorAttributeForOrientation:)] + pub unsafe fn anchorAttributeForOrientation( + &self, + orientation: NSLayoutConstraintOrientation, + ) -> NSLayoutAttribute; + + #[method(setAnchorAttribute:forOrientation:)] + pub unsafe fn setAnchorAttribute_forOrientation( + &self, + attr: NSLayoutAttribute, + orientation: NSLayoutConstraintOrientation, + ); + } +); + +extern_methods!( + /// NSConstraintBasedLayoutFittingSize + unsafe impl NSView { + #[method(fittingSize)] + pub unsafe fn fittingSize(&self) -> NSSize; + } +); + +extern_methods!( + /// NSConstraintBasedLayoutDebugging + unsafe impl NSView { + #[method_id(@__retain_semantics Other constraintsAffectingLayoutForOrientation:)] + pub unsafe fn constraintsAffectingLayoutForOrientation( + &self, + orientation: NSLayoutConstraintOrientation, + ) -> Id, Shared>; + + #[method(hasAmbiguousLayout)] + pub unsafe fn hasAmbiguousLayout(&self) -> bool; + + #[method(exerciseAmbiguityInLayout)] + pub unsafe fn exerciseAmbiguityInLayout(&self); + } +); + +extern_methods!( + /// NSConstraintBasedLayoutDebugging + unsafe impl NSWindow { + #[method(visualizeConstraints:)] + pub unsafe fn visualizeConstraints( + &self, + constraints: Option<&NSArray>, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSLayoutGuide.rs b/crates/icrate/src/generated/AppKit/NSLayoutGuide.rs new file mode 100644 index 000000000..f1d9a99f0 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSLayoutGuide.rs @@ -0,0 +1,87 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSLayoutGuide; + + unsafe impl ClassType for NSLayoutGuide { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSLayoutGuide { + #[method(frame)] + pub unsafe fn frame(&self) -> NSRect; + + #[method_id(@__retain_semantics Other owningView)] + pub unsafe fn owningView(&self) -> Option>; + + #[method(setOwningView:)] + pub unsafe fn setOwningView(&self, owningView: Option<&NSView>); + + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Id; + + #[method(setIdentifier:)] + pub unsafe fn setIdentifier(&self, identifier: &NSUserInterfaceItemIdentifier); + + #[method_id(@__retain_semantics Other leadingAnchor)] + pub unsafe fn leadingAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other trailingAnchor)] + pub unsafe fn trailingAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other leftAnchor)] + pub unsafe fn leftAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other rightAnchor)] + pub unsafe fn rightAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other topAnchor)] + pub unsafe fn topAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other bottomAnchor)] + pub unsafe fn bottomAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other widthAnchor)] + pub unsafe fn widthAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other heightAnchor)] + pub unsafe fn heightAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other centerXAnchor)] + pub unsafe fn centerXAnchor(&self) -> Id; + + #[method_id(@__retain_semantics Other centerYAnchor)] + pub unsafe fn centerYAnchor(&self) -> Id; + + #[method(hasAmbiguousLayout)] + pub unsafe fn hasAmbiguousLayout(&self) -> bool; + + #[method_id(@__retain_semantics Other constraintsAffectingLayoutForOrientation:)] + pub unsafe fn constraintsAffectingLayoutForOrientation( + &self, + orientation: NSLayoutConstraintOrientation, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSLayoutGuideSupport + unsafe impl NSView { + #[method(addLayoutGuide:)] + pub unsafe fn addLayoutGuide(&self, guide: &NSLayoutGuide); + + #[method(removeLayoutGuide:)] + pub unsafe fn removeLayoutGuide(&self, guide: &NSLayoutGuide); + + #[method_id(@__retain_semantics Other layoutGuides)] + pub unsafe fn layoutGuides(&self) -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSLayoutManager.rs b/crates/icrate/src/generated/AppKit/NSLayoutManager.rs new file mode 100644 index 000000000..e32802d43 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSLayoutManager.rs @@ -0,0 +1,1036 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextLayoutOrientation { + NSTextLayoutOrientationHorizontal = 0, + NSTextLayoutOrientationVertical = 1, + } +); + +ns_options!( + #[underlying(NSInteger)] + pub enum NSGlyphProperty { + NSGlyphPropertyNull = 1 << 0, + NSGlyphPropertyControlCharacter = 1 << 1, + NSGlyphPropertyElastic = 1 << 2, + NSGlyphPropertyNonBaseCharacter = 1 << 3, + } +); + +ns_options!( + #[underlying(NSInteger)] + pub enum NSControlCharacterAction { + NSControlCharacterActionZeroAdvancement = 1 << 0, + NSControlCharacterActionWhitespace = 1 << 1, + NSControlCharacterActionHorizontalTab = 1 << 2, + NSControlCharacterActionLineBreak = 1 << 3, + NSControlCharacterActionParagraphBreak = 1 << 4, + NSControlCharacterActionContainerBreak = 1 << 5, + } +); + +extern_protocol!( + pub struct NSTextLayoutOrientationProvider; + + unsafe impl NSTextLayoutOrientationProvider { + #[method(layoutOrientation)] + pub unsafe fn layoutOrientation(&self) -> NSTextLayoutOrientation; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTypesetterBehavior { + NSTypesetterLatestBehavior = -1, + NSTypesetterOriginalBehavior = 0, + NSTypesetterBehavior_10_2_WithCompatibility = 1, + NSTypesetterBehavior_10_2 = 2, + NSTypesetterBehavior_10_3 = 3, + NSTypesetterBehavior_10_4 = 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSLayoutManager; + + unsafe impl ClassType for NSLayoutManager { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSLayoutManager { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other textStorage)] + pub unsafe fn textStorage(&self) -> Option>; + + #[method(setTextStorage:)] + pub unsafe fn setTextStorage(&self, textStorage: Option<&NSTextStorage>); + + #[method(replaceTextStorage:)] + pub unsafe fn replaceTextStorage(&self, newTextStorage: &NSTextStorage); + + #[method_id(@__retain_semantics Other textContainers)] + pub unsafe fn textContainers(&self) -> Id, Shared>; + + #[method(addTextContainer:)] + pub unsafe fn addTextContainer(&self, container: &NSTextContainer); + + #[method(insertTextContainer:atIndex:)] + pub unsafe fn insertTextContainer_atIndex( + &self, + container: &NSTextContainer, + index: NSUInteger, + ); + + #[method(removeTextContainerAtIndex:)] + pub unsafe fn removeTextContainerAtIndex(&self, index: NSUInteger); + + #[method(textContainerChangedGeometry:)] + pub unsafe fn textContainerChangedGeometry(&self, container: &NSTextContainer); + + #[method(textContainerChangedTextView:)] + pub unsafe fn textContainerChangedTextView(&self, container: &NSTextContainer); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSLayoutManagerDelegate>); + + #[method(showsInvisibleCharacters)] + pub unsafe fn showsInvisibleCharacters(&self) -> bool; + + #[method(setShowsInvisibleCharacters:)] + pub unsafe fn setShowsInvisibleCharacters(&self, showsInvisibleCharacters: bool); + + #[method(showsControlCharacters)] + pub unsafe fn showsControlCharacters(&self) -> bool; + + #[method(setShowsControlCharacters:)] + pub unsafe fn setShowsControlCharacters(&self, showsControlCharacters: bool); + + #[method(usesDefaultHyphenation)] + pub unsafe fn usesDefaultHyphenation(&self) -> bool; + + #[method(setUsesDefaultHyphenation:)] + pub unsafe fn setUsesDefaultHyphenation(&self, usesDefaultHyphenation: bool); + + #[method(usesFontLeading)] + pub unsafe fn usesFontLeading(&self) -> bool; + + #[method(setUsesFontLeading:)] + pub unsafe fn setUsesFontLeading(&self, usesFontLeading: bool); + + #[method(allowsNonContiguousLayout)] + pub unsafe fn allowsNonContiguousLayout(&self) -> bool; + + #[method(setAllowsNonContiguousLayout:)] + pub unsafe fn setAllowsNonContiguousLayout(&self, allowsNonContiguousLayout: bool); + + #[method(hasNonContiguousLayout)] + pub unsafe fn hasNonContiguousLayout(&self) -> bool; + + #[method(limitsLayoutForSuspiciousContents)] + pub unsafe fn limitsLayoutForSuspiciousContents(&self) -> bool; + + #[method(setLimitsLayoutForSuspiciousContents:)] + pub unsafe fn setLimitsLayoutForSuspiciousContents( + &self, + limitsLayoutForSuspiciousContents: bool, + ); + + #[method(backgroundLayoutEnabled)] + pub unsafe fn backgroundLayoutEnabled(&self) -> bool; + + #[method(setBackgroundLayoutEnabled:)] + pub unsafe fn setBackgroundLayoutEnabled(&self, backgroundLayoutEnabled: bool); + + #[method(defaultAttachmentScaling)] + pub unsafe fn defaultAttachmentScaling(&self) -> NSImageScaling; + + #[method(setDefaultAttachmentScaling:)] + pub unsafe fn setDefaultAttachmentScaling(&self, defaultAttachmentScaling: NSImageScaling); + + #[method_id(@__retain_semantics Other typesetter)] + pub unsafe fn typesetter(&self) -> Id; + + #[method(setTypesetter:)] + pub unsafe fn setTypesetter(&self, typesetter: &NSTypesetter); + + #[method(typesetterBehavior)] + pub unsafe fn typesetterBehavior(&self) -> NSTypesetterBehavior; + + #[method(setTypesetterBehavior:)] + pub unsafe fn setTypesetterBehavior(&self, typesetterBehavior: NSTypesetterBehavior); + + #[method(invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange:)] + pub unsafe fn invalidateGlyphsForCharacterRange_changeInLength_actualCharacterRange( + &self, + charRange: NSRange, + delta: NSInteger, + actualCharRange: NSRangePointer, + ); + + #[method(invalidateLayoutForCharacterRange:actualCharacterRange:)] + pub unsafe fn invalidateLayoutForCharacterRange_actualCharacterRange( + &self, + charRange: NSRange, + actualCharRange: NSRangePointer, + ); + + #[method(invalidateDisplayForCharacterRange:)] + pub unsafe fn invalidateDisplayForCharacterRange(&self, charRange: NSRange); + + #[method(invalidateDisplayForGlyphRange:)] + pub unsafe fn invalidateDisplayForGlyphRange(&self, glyphRange: NSRange); + + #[method(processEditingForTextStorage:edited:range:changeInLength:invalidatedRange:)] + pub unsafe fn processEditingForTextStorage_edited_range_changeInLength_invalidatedRange( + &self, + textStorage: &NSTextStorage, + editMask: NSTextStorageEditActions, + newCharRange: NSRange, + delta: NSInteger, + invalidatedCharRange: NSRange, + ); + + #[method(ensureGlyphsForCharacterRange:)] + pub unsafe fn ensureGlyphsForCharacterRange(&self, charRange: NSRange); + + #[method(ensureGlyphsForGlyphRange:)] + pub unsafe fn ensureGlyphsForGlyphRange(&self, glyphRange: NSRange); + + #[method(ensureLayoutForCharacterRange:)] + pub unsafe fn ensureLayoutForCharacterRange(&self, charRange: NSRange); + + #[method(ensureLayoutForGlyphRange:)] + pub unsafe fn ensureLayoutForGlyphRange(&self, glyphRange: NSRange); + + #[method(ensureLayoutForTextContainer:)] + pub unsafe fn ensureLayoutForTextContainer(&self, container: &NSTextContainer); + + #[method(ensureLayoutForBoundingRect:inTextContainer:)] + pub unsafe fn ensureLayoutForBoundingRect_inTextContainer( + &self, + bounds: NSRect, + container: &NSTextContainer, + ); + + #[method(numberOfGlyphs)] + pub unsafe fn numberOfGlyphs(&self) -> NSUInteger; + + #[method(isValidGlyphIndex:)] + pub unsafe fn isValidGlyphIndex(&self, glyphIndex: NSUInteger) -> bool; + + #[method(propertyForGlyphAtIndex:)] + pub unsafe fn propertyForGlyphAtIndex(&self, glyphIndex: NSUInteger) -> NSGlyphProperty; + + #[method(characterIndexForGlyphAtIndex:)] + pub unsafe fn characterIndexForGlyphAtIndex(&self, glyphIndex: NSUInteger) -> NSUInteger; + + #[method(glyphIndexForCharacterAtIndex:)] + pub unsafe fn glyphIndexForCharacterAtIndex(&self, charIndex: NSUInteger) -> NSUInteger; + + #[method(setTextContainer:forGlyphRange:)] + pub unsafe fn setTextContainer_forGlyphRange( + &self, + container: &NSTextContainer, + glyphRange: NSRange, + ); + + #[method(setLineFragmentRect:forGlyphRange:usedRect:)] + pub unsafe fn setLineFragmentRect_forGlyphRange_usedRect( + &self, + fragmentRect: NSRect, + glyphRange: NSRange, + usedRect: NSRect, + ); + + #[method(setExtraLineFragmentRect:usedRect:textContainer:)] + pub unsafe fn setExtraLineFragmentRect_usedRect_textContainer( + &self, + fragmentRect: NSRect, + usedRect: NSRect, + container: &NSTextContainer, + ); + + #[method(setLocation:forStartOfGlyphRange:)] + pub unsafe fn setLocation_forStartOfGlyphRange( + &self, + location: NSPoint, + glyphRange: NSRange, + ); + + #[method(setNotShownAttribute:forGlyphAtIndex:)] + pub unsafe fn setNotShownAttribute_forGlyphAtIndex( + &self, + flag: bool, + glyphIndex: NSUInteger, + ); + + #[method(setDrawsOutsideLineFragment:forGlyphAtIndex:)] + pub unsafe fn setDrawsOutsideLineFragment_forGlyphAtIndex( + &self, + flag: bool, + glyphIndex: NSUInteger, + ); + + #[method(setAttachmentSize:forGlyphRange:)] + pub unsafe fn setAttachmentSize_forGlyphRange( + &self, + attachmentSize: NSSize, + glyphRange: NSRange, + ); + + #[method(getFirstUnlaidCharacterIndex:glyphIndex:)] + pub unsafe fn getFirstUnlaidCharacterIndex_glyphIndex( + &self, + charIndex: *mut NSUInteger, + glyphIndex: *mut NSUInteger, + ); + + #[method(firstUnlaidCharacterIndex)] + pub unsafe fn firstUnlaidCharacterIndex(&self) -> NSUInteger; + + #[method(firstUnlaidGlyphIndex)] + pub unsafe fn firstUnlaidGlyphIndex(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other textContainerForGlyphAtIndex:effectiveRange:)] + pub unsafe fn textContainerForGlyphAtIndex_effectiveRange( + &self, + glyphIndex: NSUInteger, + effectiveGlyphRange: NSRangePointer, + ) -> Option>; + + #[method_id(@__retain_semantics Other textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:)] + pub unsafe fn textContainerForGlyphAtIndex_effectiveRange_withoutAdditionalLayout( + &self, + glyphIndex: NSUInteger, + effectiveGlyphRange: NSRangePointer, + flag: bool, + ) -> Option>; + + #[method(usedRectForTextContainer:)] + pub unsafe fn usedRectForTextContainer(&self, container: &NSTextContainer) -> NSRect; + + #[method(lineFragmentRectForGlyphAtIndex:effectiveRange:)] + pub unsafe fn lineFragmentRectForGlyphAtIndex_effectiveRange( + &self, + glyphIndex: NSUInteger, + effectiveGlyphRange: NSRangePointer, + ) -> NSRect; + + #[method(lineFragmentRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:)] + pub unsafe fn lineFragmentRectForGlyphAtIndex_effectiveRange_withoutAdditionalLayout( + &self, + glyphIndex: NSUInteger, + effectiveGlyphRange: NSRangePointer, + flag: bool, + ) -> NSRect; + + #[method(lineFragmentUsedRectForGlyphAtIndex:effectiveRange:)] + pub unsafe fn lineFragmentUsedRectForGlyphAtIndex_effectiveRange( + &self, + glyphIndex: NSUInteger, + effectiveGlyphRange: NSRangePointer, + ) -> NSRect; + + #[method(lineFragmentUsedRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:)] + pub unsafe fn lineFragmentUsedRectForGlyphAtIndex_effectiveRange_withoutAdditionalLayout( + &self, + glyphIndex: NSUInteger, + effectiveGlyphRange: NSRangePointer, + flag: bool, + ) -> NSRect; + + #[method(extraLineFragmentRect)] + pub unsafe fn extraLineFragmentRect(&self) -> NSRect; + + #[method(extraLineFragmentUsedRect)] + pub unsafe fn extraLineFragmentUsedRect(&self) -> NSRect; + + #[method_id(@__retain_semantics Other extraLineFragmentTextContainer)] + pub unsafe fn extraLineFragmentTextContainer(&self) -> Option>; + + #[method(locationForGlyphAtIndex:)] + pub unsafe fn locationForGlyphAtIndex(&self, glyphIndex: NSUInteger) -> NSPoint; + + #[method(notShownAttributeForGlyphAtIndex:)] + pub unsafe fn notShownAttributeForGlyphAtIndex(&self, glyphIndex: NSUInteger) -> bool; + + #[method(drawsOutsideLineFragmentForGlyphAtIndex:)] + pub unsafe fn drawsOutsideLineFragmentForGlyphAtIndex( + &self, + glyphIndex: NSUInteger, + ) -> bool; + + #[method(attachmentSizeForGlyphAtIndex:)] + pub unsafe fn attachmentSizeForGlyphAtIndex(&self, glyphIndex: NSUInteger) -> NSSize; + + #[method(truncatedGlyphRangeInLineFragmentForGlyphAtIndex:)] + pub unsafe fn truncatedGlyphRangeInLineFragmentForGlyphAtIndex( + &self, + glyphIndex: NSUInteger, + ) -> NSRange; + + #[method(glyphRangeForCharacterRange:actualCharacterRange:)] + pub unsafe fn glyphRangeForCharacterRange_actualCharacterRange( + &self, + charRange: NSRange, + actualCharRange: NSRangePointer, + ) -> NSRange; + + #[method(characterRangeForGlyphRange:actualGlyphRange:)] + pub unsafe fn characterRangeForGlyphRange_actualGlyphRange( + &self, + glyphRange: NSRange, + actualGlyphRange: NSRangePointer, + ) -> NSRange; + + #[method(glyphRangeForTextContainer:)] + pub unsafe fn glyphRangeForTextContainer(&self, container: &NSTextContainer) -> NSRange; + + #[method(rangeOfNominallySpacedGlyphsContainingIndex:)] + pub unsafe fn rangeOfNominallySpacedGlyphsContainingIndex( + &self, + glyphIndex: NSUInteger, + ) -> NSRange; + + #[method(boundingRectForGlyphRange:inTextContainer:)] + pub unsafe fn boundingRectForGlyphRange_inTextContainer( + &self, + glyphRange: NSRange, + container: &NSTextContainer, + ) -> NSRect; + + #[method(glyphRangeForBoundingRect:inTextContainer:)] + pub unsafe fn glyphRangeForBoundingRect_inTextContainer( + &self, + bounds: NSRect, + container: &NSTextContainer, + ) -> NSRange; + + #[method(glyphRangeForBoundingRectWithoutAdditionalLayout:inTextContainer:)] + pub unsafe fn glyphRangeForBoundingRectWithoutAdditionalLayout_inTextContainer( + &self, + bounds: NSRect, + container: &NSTextContainer, + ) -> NSRange; + + #[method(glyphIndexForPoint:inTextContainer:)] + pub unsafe fn glyphIndexForPoint_inTextContainer( + &self, + point: NSPoint, + container: &NSTextContainer, + ) -> NSUInteger; + + #[method(fractionOfDistanceThroughGlyphForPoint:inTextContainer:)] + pub unsafe fn fractionOfDistanceThroughGlyphForPoint_inTextContainer( + &self, + point: NSPoint, + container: &NSTextContainer, + ) -> CGFloat; + + #[method(characterIndexForPoint:inTextContainer:fractionOfDistanceBetweenInsertionPoints:)] + pub unsafe fn characterIndexForPoint_inTextContainer_fractionOfDistanceBetweenInsertionPoints( + &self, + point: NSPoint, + container: &NSTextContainer, + partialFraction: *mut CGFloat, + ) -> NSUInteger; + + #[method(getLineFragmentInsertionPointsForCharacterAtIndex:alternatePositions:inDisplayOrder:positions:characterIndexes:)] + pub unsafe fn getLineFragmentInsertionPointsForCharacterAtIndex_alternatePositions_inDisplayOrder_positions_characterIndexes( + &self, + charIndex: NSUInteger, + aFlag: bool, + dFlag: bool, + positions: *mut CGFloat, + charIndexes: *mut NSUInteger, + ) -> NSUInteger; + + #[method(enumerateLineFragmentsForGlyphRange:usingBlock:)] + pub unsafe fn enumerateLineFragmentsForGlyphRange_usingBlock( + &self, + glyphRange: NSRange, + block: &Block< + ( + NSRect, + NSRect, + NonNull, + NSRange, + NonNull, + ), + (), + >, + ); + + #[method(enumerateEnclosingRectsForGlyphRange:withinSelectedGlyphRange:inTextContainer:usingBlock:)] + pub unsafe fn enumerateEnclosingRectsForGlyphRange_withinSelectedGlyphRange_inTextContainer_usingBlock( + &self, + glyphRange: NSRange, + selectedRange: NSRange, + textContainer: &NSTextContainer, + block: &Block<(NSRect, NonNull), ()>, + ); + + #[method(drawBackgroundForGlyphRange:atPoint:)] + pub unsafe fn drawBackgroundForGlyphRange_atPoint( + &self, + glyphsToShow: NSRange, + origin: NSPoint, + ); + + #[method(drawGlyphsForGlyphRange:atPoint:)] + pub unsafe fn drawGlyphsForGlyphRange_atPoint( + &self, + glyphsToShow: NSRange, + origin: NSPoint, + ); + + #[method(fillBackgroundRectArray:count:forCharacterRange:color:)] + pub unsafe fn fillBackgroundRectArray_count_forCharacterRange_color( + &self, + rectArray: NonNull, + rectCount: NSUInteger, + charRange: NSRange, + color: &NSColor, + ); + + #[method(drawUnderlineForGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)] + pub unsafe fn drawUnderlineForGlyphRange_underlineType_baselineOffset_lineFragmentRect_lineFragmentGlyphRange_containerOrigin( + &self, + glyphRange: NSRange, + underlineVal: NSUnderlineStyle, + baselineOffset: CGFloat, + lineRect: NSRect, + lineGlyphRange: NSRange, + containerOrigin: NSPoint, + ); + + #[method(underlineGlyphRange:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)] + pub unsafe fn underlineGlyphRange_underlineType_lineFragmentRect_lineFragmentGlyphRange_containerOrigin( + &self, + glyphRange: NSRange, + underlineVal: NSUnderlineStyle, + lineRect: NSRect, + lineGlyphRange: NSRange, + containerOrigin: NSPoint, + ); + + #[method(drawStrikethroughForGlyphRange:strikethroughType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)] + pub unsafe fn drawStrikethroughForGlyphRange_strikethroughType_baselineOffset_lineFragmentRect_lineFragmentGlyphRange_containerOrigin( + &self, + glyphRange: NSRange, + strikethroughVal: NSUnderlineStyle, + baselineOffset: CGFloat, + lineRect: NSRect, + lineGlyphRange: NSRange, + containerOrigin: NSPoint, + ); + + #[method(strikethroughGlyphRange:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)] + pub unsafe fn strikethroughGlyphRange_strikethroughType_lineFragmentRect_lineFragmentGlyphRange_containerOrigin( + &self, + glyphRange: NSRange, + strikethroughVal: NSUnderlineStyle, + lineRect: NSRect, + lineGlyphRange: NSRange, + containerOrigin: NSPoint, + ); + + #[method(showAttachmentCell:inRect:characterIndex:)] + pub unsafe fn showAttachmentCell_inRect_characterIndex( + &self, + cell: &NSCell, + rect: NSRect, + attachmentIndex: NSUInteger, + ); + + #[method(setLayoutRect:forTextBlock:glyphRange:)] + pub unsafe fn setLayoutRect_forTextBlock_glyphRange( + &self, + rect: NSRect, + block: &NSTextBlock, + glyphRange: NSRange, + ); + + #[method(setBoundsRect:forTextBlock:glyphRange:)] + pub unsafe fn setBoundsRect_forTextBlock_glyphRange( + &self, + rect: NSRect, + block: &NSTextBlock, + glyphRange: NSRange, + ); + + #[method(layoutRectForTextBlock:glyphRange:)] + pub unsafe fn layoutRectForTextBlock_glyphRange( + &self, + block: &NSTextBlock, + glyphRange: NSRange, + ) -> NSRect; + + #[method(boundsRectForTextBlock:glyphRange:)] + pub unsafe fn boundsRectForTextBlock_glyphRange( + &self, + block: &NSTextBlock, + glyphRange: NSRange, + ) -> NSRect; + + #[method(layoutRectForTextBlock:atIndex:effectiveRange:)] + pub unsafe fn layoutRectForTextBlock_atIndex_effectiveRange( + &self, + block: &NSTextBlock, + glyphIndex: NSUInteger, + effectiveGlyphRange: NSRangePointer, + ) -> NSRect; + + #[method(boundsRectForTextBlock:atIndex:effectiveRange:)] + pub unsafe fn boundsRectForTextBlock_atIndex_effectiveRange( + &self, + block: &NSTextBlock, + glyphIndex: NSUInteger, + effectiveGlyphRange: NSRangePointer, + ) -> NSRect; + + #[method_id(@__retain_semantics Other temporaryAttributesAtCharacterIndex:effectiveRange:)] + pub unsafe fn temporaryAttributesAtCharacterIndex_effectiveRange( + &self, + charIndex: NSUInteger, + effectiveCharRange: NSRangePointer, + ) -> Id, Shared>; + + #[method(setTemporaryAttributes:forCharacterRange:)] + pub unsafe fn setTemporaryAttributes_forCharacterRange( + &self, + attrs: &NSDictionary, + charRange: NSRange, + ); + + #[method(addTemporaryAttributes:forCharacterRange:)] + pub unsafe fn addTemporaryAttributes_forCharacterRange( + &self, + attrs: &NSDictionary, + charRange: NSRange, + ); + + #[method(removeTemporaryAttribute:forCharacterRange:)] + pub unsafe fn removeTemporaryAttribute_forCharacterRange( + &self, + attrName: &NSAttributedStringKey, + charRange: NSRange, + ); + + #[method_id(@__retain_semantics Other temporaryAttribute:atCharacterIndex:effectiveRange:)] + pub unsafe fn temporaryAttribute_atCharacterIndex_effectiveRange( + &self, + attrName: &NSAttributedStringKey, + location: NSUInteger, + range: NSRangePointer, + ) -> Option>; + + #[method_id(@__retain_semantics Other temporaryAttribute:atCharacterIndex:longestEffectiveRange:inRange:)] + pub unsafe fn temporaryAttribute_atCharacterIndex_longestEffectiveRange_inRange( + &self, + attrName: &NSAttributedStringKey, + location: NSUInteger, + range: NSRangePointer, + rangeLimit: NSRange, + ) -> Option>; + + #[method_id(@__retain_semantics Other temporaryAttributesAtCharacterIndex:longestEffectiveRange:inRange:)] + pub unsafe fn temporaryAttributesAtCharacterIndex_longestEffectiveRange_inRange( + &self, + location: NSUInteger, + range: NSRangePointer, + rangeLimit: NSRange, + ) -> Id, Shared>; + + #[method(addTemporaryAttribute:value:forCharacterRange:)] + pub unsafe fn addTemporaryAttribute_value_forCharacterRange( + &self, + attrName: &NSAttributedStringKey, + value: &Object, + charRange: NSRange, + ); + + #[method(defaultLineHeightForFont:)] + pub unsafe fn defaultLineHeightForFont(&self, theFont: &NSFont) -> CGFloat; + + #[method(defaultBaselineOffsetForFont:)] + pub unsafe fn defaultBaselineOffsetForFont(&self, theFont: &NSFont) -> CGFloat; + } +); + +extern_methods!( + /// NSTextViewSupport + unsafe impl NSLayoutManager { + #[method_id(@__retain_semantics Other rulerMarkersForTextView:paragraphStyle:ruler:)] + pub unsafe fn rulerMarkersForTextView_paragraphStyle_ruler( + &self, + view: &NSTextView, + style: &NSParagraphStyle, + ruler: &NSRulerView, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other rulerAccessoryViewForTextView:paragraphStyle:ruler:enabled:)] + pub unsafe fn rulerAccessoryViewForTextView_paragraphStyle_ruler_enabled( + &self, + view: &NSTextView, + style: &NSParagraphStyle, + ruler: &NSRulerView, + isEnabled: bool, + ) -> Option>; + + #[method(layoutManagerOwnsFirstResponderInWindow:)] + pub unsafe fn layoutManagerOwnsFirstResponderInWindow(&self, window: &NSWindow) -> bool; + + #[method_id(@__retain_semantics Other firstTextView)] + pub unsafe fn firstTextView(&self) -> Option>; + + #[method_id(@__retain_semantics Other textViewForBeginningOfSelection)] + pub unsafe fn textViewForBeginningOfSelection(&self) -> Option>; + } +); + +extern_protocol!( + pub struct NSLayoutManagerDelegate; + + unsafe impl NSLayoutManagerDelegate { + #[optional] + #[method(layoutManager:shouldGenerateGlyphs:properties:characterIndexes:font:forGlyphRange:)] + pub unsafe fn layoutManager_shouldGenerateGlyphs_properties_characterIndexes_font_forGlyphRange( + &self, + layoutManager: &NSLayoutManager, + glyphs: NonNull, + props: NonNull, + charIndexes: NonNull, + aFont: &NSFont, + glyphRange: NSRange, + ) -> NSUInteger; + + #[optional] + #[method(layoutManager:lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:)] + pub unsafe fn layoutManager_lineSpacingAfterGlyphAtIndex_withProposedLineFragmentRect( + &self, + layoutManager: &NSLayoutManager, + glyphIndex: NSUInteger, + rect: NSRect, + ) -> CGFloat; + + #[optional] + #[method(layoutManager:paragraphSpacingBeforeGlyphAtIndex:withProposedLineFragmentRect:)] + pub unsafe fn layoutManager_paragraphSpacingBeforeGlyphAtIndex_withProposedLineFragmentRect( + &self, + layoutManager: &NSLayoutManager, + glyphIndex: NSUInteger, + rect: NSRect, + ) -> CGFloat; + + #[optional] + #[method(layoutManager:paragraphSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:)] + pub unsafe fn layoutManager_paragraphSpacingAfterGlyphAtIndex_withProposedLineFragmentRect( + &self, + layoutManager: &NSLayoutManager, + glyphIndex: NSUInteger, + rect: NSRect, + ) -> CGFloat; + + #[optional] + #[method(layoutManager:shouldUseAction:forControlCharacterAtIndex:)] + pub unsafe fn layoutManager_shouldUseAction_forControlCharacterAtIndex( + &self, + layoutManager: &NSLayoutManager, + action: NSControlCharacterAction, + charIndex: NSUInteger, + ) -> NSControlCharacterAction; + + #[optional] + #[method(layoutManager:shouldBreakLineByWordBeforeCharacterAtIndex:)] + pub unsafe fn layoutManager_shouldBreakLineByWordBeforeCharacterAtIndex( + &self, + layoutManager: &NSLayoutManager, + charIndex: NSUInteger, + ) -> bool; + + #[optional] + #[method(layoutManager:shouldBreakLineByHyphenatingBeforeCharacterAtIndex:)] + pub unsafe fn layoutManager_shouldBreakLineByHyphenatingBeforeCharacterAtIndex( + &self, + layoutManager: &NSLayoutManager, + charIndex: NSUInteger, + ) -> bool; + + #[optional] + #[method(layoutManager:boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex:)] + pub unsafe fn layoutManager_boundingBoxForControlGlyphAtIndex_forTextContainer_proposedLineFragment_glyphPosition_characterIndex( + &self, + layoutManager: &NSLayoutManager, + glyphIndex: NSUInteger, + textContainer: &NSTextContainer, + proposedRect: NSRect, + glyphPosition: NSPoint, + charIndex: NSUInteger, + ) -> NSRect; + + #[optional] + #[method(layoutManager:shouldSetLineFragmentRect:lineFragmentUsedRect:baselineOffset:inTextContainer:forGlyphRange:)] + pub unsafe fn layoutManager_shouldSetLineFragmentRect_lineFragmentUsedRect_baselineOffset_inTextContainer_forGlyphRange( + &self, + layoutManager: &NSLayoutManager, + lineFragmentRect: NonNull, + lineFragmentUsedRect: NonNull, + baselineOffset: NonNull, + textContainer: &NSTextContainer, + glyphRange: NSRange, + ) -> bool; + + #[optional] + #[method(layoutManagerDidInvalidateLayout:)] + pub unsafe fn layoutManagerDidInvalidateLayout(&self, sender: &NSLayoutManager); + + #[optional] + #[method(layoutManager:didCompleteLayoutForTextContainer:atEnd:)] + pub unsafe fn layoutManager_didCompleteLayoutForTextContainer_atEnd( + &self, + layoutManager: &NSLayoutManager, + textContainer: Option<&NSTextContainer>, + layoutFinishedFlag: bool, + ); + + #[optional] + #[method(layoutManager:textContainer:didChangeGeometryFromSize:)] + pub unsafe fn layoutManager_textContainer_didChangeGeometryFromSize( + &self, + layoutManager: &NSLayoutManager, + textContainer: &NSTextContainer, + oldSize: NSSize, + ); + + #[optional] + #[method_id(@__retain_semantics Other layoutManager:shouldUseTemporaryAttributes:forDrawingToScreen:atCharacterIndex:effectiveRange:)] + pub unsafe fn layoutManager_shouldUseTemporaryAttributes_forDrawingToScreen_atCharacterIndex_effectiveRange( + &self, + layoutManager: &NSLayoutManager, + attrs: &NSDictionary, + toScreen: bool, + charIndex: NSUInteger, + effectiveCharRange: NSRangePointer, + ) -> Option, Shared>>; + } +); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSGlyphAttributeSoft = 0, + NSGlyphAttributeElastic = 1, + NSGlyphAttributeBidiLevel = 2, + NSGlyphAttributeInscribe = 5, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSGlyphInscription { + NSGlyphInscribeBase = 0, + NSGlyphInscribeBelow = 1, + NSGlyphInscribeAbove = 2, + NSGlyphInscribeOverstrike = 3, + NSGlyphInscribeOverBelow = 4, + } +); + +extern_methods!( + /// NSLayoutManagerDeprecated + unsafe impl NSLayoutManager { + #[method(glyphAtIndex:isValidIndex:)] + pub unsafe fn glyphAtIndex_isValidIndex( + &self, + glyphIndex: NSUInteger, + isValidIndex: *mut Bool, + ) -> NSGlyph; + + #[method(glyphAtIndex:)] + pub unsafe fn glyphAtIndex(&self, glyphIndex: NSUInteger) -> NSGlyph; + + #[method(rectArrayForCharacterRange:withinSelectedCharacterRange:inTextContainer:rectCount:)] + pub unsafe fn rectArrayForCharacterRange_withinSelectedCharacterRange_inTextContainer_rectCount( + &self, + charRange: NSRange, + selCharRange: NSRange, + container: &NSTextContainer, + rectCount: NonNull, + ) -> NSRectArray; + + #[method(rectArrayForGlyphRange:withinSelectedGlyphRange:inTextContainer:rectCount:)] + pub unsafe fn rectArrayForGlyphRange_withinSelectedGlyphRange_inTextContainer_rectCount( + &self, + glyphRange: NSRange, + selGlyphRange: NSRange, + container: &NSTextContainer, + rectCount: NonNull, + ) -> NSRectArray; + + #[method(usesScreenFonts)] + pub unsafe fn usesScreenFonts(&self) -> bool; + + #[method(setUsesScreenFonts:)] + pub unsafe fn setUsesScreenFonts(&self, usesScreenFonts: bool); + + #[method_id(@__retain_semantics Other substituteFontForFont:)] + pub unsafe fn substituteFontForFont(&self, originalFont: &NSFont) -> Id; + + #[method(insertGlyphs:length:forStartingGlyphAtIndex:characterIndex:)] + pub unsafe fn insertGlyphs_length_forStartingGlyphAtIndex_characterIndex( + &self, + glyphs: NonNull, + length: NSUInteger, + glyphIndex: NSUInteger, + charIndex: NSUInteger, + ); + + #[method(insertGlyph:atGlyphIndex:characterIndex:)] + pub unsafe fn insertGlyph_atGlyphIndex_characterIndex( + &self, + glyph: NSGlyph, + glyphIndex: NSUInteger, + charIndex: NSUInteger, + ); + + #[method(replaceGlyphAtIndex:withGlyph:)] + pub unsafe fn replaceGlyphAtIndex_withGlyph( + &self, + glyphIndex: NSUInteger, + newGlyph: NSGlyph, + ); + + #[method(deleteGlyphsInRange:)] + pub unsafe fn deleteGlyphsInRange(&self, glyphRange: NSRange); + + #[method(setCharacterIndex:forGlyphAtIndex:)] + pub unsafe fn setCharacterIndex_forGlyphAtIndex( + &self, + charIndex: NSUInteger, + glyphIndex: NSUInteger, + ); + + #[method(setIntAttribute:value:forGlyphAtIndex:)] + pub unsafe fn setIntAttribute_value_forGlyphAtIndex( + &self, + attributeTag: NSInteger, + val: NSInteger, + glyphIndex: NSUInteger, + ); + + #[method(invalidateGlyphsOnLayoutInvalidationForGlyphRange:)] + pub unsafe fn invalidateGlyphsOnLayoutInvalidationForGlyphRange(&self, glyphRange: NSRange); + + #[method(intAttribute:forGlyphAtIndex:)] + pub unsafe fn intAttribute_forGlyphAtIndex( + &self, + attributeTag: NSInteger, + glyphIndex: NSUInteger, + ) -> NSInteger; + + #[method(getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:)] + pub unsafe fn getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits( + &self, + glyphRange: NSRange, + glyphBuffer: *mut NSGlyph, + charIndexBuffer: *mut NSUInteger, + inscribeBuffer: *mut NSGlyphInscription, + elasticBuffer: *mut Bool, + ) -> NSUInteger; + + #[method(getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels:)] + pub unsafe fn getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits_bidiLevels( + &self, + glyphRange: NSRange, + glyphBuffer: *mut NSGlyph, + charIndexBuffer: *mut NSUInteger, + inscribeBuffer: *mut NSGlyphInscription, + elasticBuffer: *mut Bool, + bidiLevelBuffer: *mut c_uchar, + ) -> NSUInteger; + + #[method(getGlyphs:range:)] + pub unsafe fn getGlyphs_range( + &self, + glyphArray: *mut NSGlyph, + glyphRange: NSRange, + ) -> NSUInteger; + + #[method(invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:)] + pub unsafe fn invalidateLayoutForCharacterRange_isSoft_actualCharacterRange( + &self, + charRange: NSRange, + flag: bool, + actualCharRange: NSRangePointer, + ); + + #[method(textStorage:edited:range:changeInLength:invalidatedRange:)] + pub unsafe fn textStorage_edited_range_changeInLength_invalidatedRange( + &self, + str: &NSTextStorage, + editedMask: NSTextStorageEditedOptions, + newCharRange: NSRange, + delta: NSInteger, + invalidatedCharRange: NSRange, + ); + + #[method(setLocations:startingGlyphIndexes:count:forGlyphRange:)] + pub unsafe fn setLocations_startingGlyphIndexes_count_forGlyphRange( + &self, + locations: NSPointArray, + glyphIndexes: NonNull, + count: NSUInteger, + glyphRange: NSRange, + ); + + #[method(showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment:)] + pub unsafe fn showPackedGlyphs_length_glyphRange_atPoint_font_color_printingAdjustment( + &self, + glyphs: NonNull, + glyphLen: NSUInteger, + glyphRange: NSRange, + point: NSPoint, + font: &NSFont, + color: &NSColor, + printingAdjustment: NSSize, + ); + + #[method(hyphenationFactor)] + pub unsafe fn hyphenationFactor(&self) -> c_float; + + #[method(setHyphenationFactor:)] + pub unsafe fn setHyphenationFactor(&self, hyphenationFactor: c_float); + } +); + +extern_methods!( + /// NSGlyphGeneration + unsafe impl NSLayoutManager { + #[method_id(@__retain_semantics Other glyphGenerator)] + pub unsafe fn glyphGenerator(&self) -> Id; + + #[method(setGlyphGenerator:)] + pub unsafe fn setGlyphGenerator(&self, glyphGenerator: &NSGlyphGenerator); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSLevelIndicator.rs b/crates/icrate/src/generated/AppKit/NSLevelIndicator.rs new file mode 100644 index 000000000..f1bcba006 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSLevelIndicator.rs @@ -0,0 +1,133 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSLevelIndicatorPlaceholderVisibility { + NSLevelIndicatorPlaceholderVisibilityAutomatic = 0, + NSLevelIndicatorPlaceholderVisibilityAlways = 1, + NSLevelIndicatorPlaceholderVisibilityWhileEditing = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSLevelIndicator; + + unsafe impl ClassType for NSLevelIndicator { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSLevelIndicator { + #[method(levelIndicatorStyle)] + pub unsafe fn levelIndicatorStyle(&self) -> NSLevelIndicatorStyle; + + #[method(setLevelIndicatorStyle:)] + pub unsafe fn setLevelIndicatorStyle(&self, levelIndicatorStyle: NSLevelIndicatorStyle); + + #[method(isEditable)] + pub unsafe fn isEditable(&self) -> bool; + + #[method(setEditable:)] + pub unsafe fn setEditable(&self, editable: bool); + + #[method(minValue)] + pub unsafe fn minValue(&self) -> c_double; + + #[method(setMinValue:)] + pub unsafe fn setMinValue(&self, minValue: c_double); + + #[method(maxValue)] + pub unsafe fn maxValue(&self) -> c_double; + + #[method(setMaxValue:)] + pub unsafe fn setMaxValue(&self, maxValue: c_double); + + #[method(warningValue)] + pub unsafe fn warningValue(&self) -> c_double; + + #[method(setWarningValue:)] + pub unsafe fn setWarningValue(&self, warningValue: c_double); + + #[method(criticalValue)] + pub unsafe fn criticalValue(&self) -> c_double; + + #[method(setCriticalValue:)] + pub unsafe fn setCriticalValue(&self, criticalValue: c_double); + + #[method(tickMarkPosition)] + pub unsafe fn tickMarkPosition(&self) -> NSTickMarkPosition; + + #[method(setTickMarkPosition:)] + pub unsafe fn setTickMarkPosition(&self, tickMarkPosition: NSTickMarkPosition); + + #[method(numberOfTickMarks)] + pub unsafe fn numberOfTickMarks(&self) -> NSInteger; + + #[method(setNumberOfTickMarks:)] + pub unsafe fn setNumberOfTickMarks(&self, numberOfTickMarks: NSInteger); + + #[method(numberOfMajorTickMarks)] + pub unsafe fn numberOfMajorTickMarks(&self) -> NSInteger; + + #[method(setNumberOfMajorTickMarks:)] + pub unsafe fn setNumberOfMajorTickMarks(&self, numberOfMajorTickMarks: NSInteger); + + #[method(tickMarkValueAtIndex:)] + pub unsafe fn tickMarkValueAtIndex(&self, index: NSInteger) -> c_double; + + #[method(rectOfTickMarkAtIndex:)] + pub unsafe fn rectOfTickMarkAtIndex(&self, index: NSInteger) -> NSRect; + + #[method_id(@__retain_semantics Other fillColor)] + pub unsafe fn fillColor(&self) -> Id; + + #[method(setFillColor:)] + pub unsafe fn setFillColor(&self, fillColor: Option<&NSColor>); + + #[method_id(@__retain_semantics Other warningFillColor)] + pub unsafe fn warningFillColor(&self) -> Id; + + #[method(setWarningFillColor:)] + pub unsafe fn setWarningFillColor(&self, warningFillColor: Option<&NSColor>); + + #[method_id(@__retain_semantics Other criticalFillColor)] + pub unsafe fn criticalFillColor(&self) -> Id; + + #[method(setCriticalFillColor:)] + pub unsafe fn setCriticalFillColor(&self, criticalFillColor: Option<&NSColor>); + + #[method(drawsTieredCapacityLevels)] + pub unsafe fn drawsTieredCapacityLevels(&self) -> bool; + + #[method(setDrawsTieredCapacityLevels:)] + pub unsafe fn setDrawsTieredCapacityLevels(&self, drawsTieredCapacityLevels: bool); + + #[method(placeholderVisibility)] + pub unsafe fn placeholderVisibility(&self) -> NSLevelIndicatorPlaceholderVisibility; + + #[method(setPlaceholderVisibility:)] + pub unsafe fn setPlaceholderVisibility( + &self, + placeholderVisibility: NSLevelIndicatorPlaceholderVisibility, + ); + + #[method_id(@__retain_semantics Other ratingImage)] + pub unsafe fn ratingImage(&self) -> Option>; + + #[method(setRatingImage:)] + pub unsafe fn setRatingImage(&self, ratingImage: Option<&NSImage>); + + #[method_id(@__retain_semantics Other ratingPlaceholderImage)] + pub unsafe fn ratingPlaceholderImage(&self) -> Option>; + + #[method(setRatingPlaceholderImage:)] + pub unsafe fn setRatingPlaceholderImage(&self, ratingPlaceholderImage: Option<&NSImage>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSLevelIndicatorCell.rs b/crates/icrate/src/generated/AppKit/NSLevelIndicatorCell.rs new file mode 100644 index 000000000..abfd906be --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSLevelIndicatorCell.rs @@ -0,0 +1,105 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSLevelIndicatorStyle { + NSLevelIndicatorStyleRelevancy = 0, + NSLevelIndicatorStyleContinuousCapacity = 1, + NSLevelIndicatorStyleDiscreteCapacity = 2, + NSLevelIndicatorStyleRating = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSLevelIndicatorCell; + + unsafe impl ClassType for NSLevelIndicatorCell { + type Super = NSActionCell; + } +); + +extern_methods!( + unsafe impl NSLevelIndicatorCell { + #[method_id(@__retain_semantics Init initWithLevelIndicatorStyle:)] + pub unsafe fn initWithLevelIndicatorStyle( + this: Option>, + levelIndicatorStyle: NSLevelIndicatorStyle, + ) -> Id; + + #[method(levelIndicatorStyle)] + pub unsafe fn levelIndicatorStyle(&self) -> NSLevelIndicatorStyle; + + #[method(setLevelIndicatorStyle:)] + pub unsafe fn setLevelIndicatorStyle(&self, levelIndicatorStyle: NSLevelIndicatorStyle); + + #[method(minValue)] + pub unsafe fn minValue(&self) -> c_double; + + #[method(setMinValue:)] + pub unsafe fn setMinValue(&self, minValue: c_double); + + #[method(maxValue)] + pub unsafe fn maxValue(&self) -> c_double; + + #[method(setMaxValue:)] + pub unsafe fn setMaxValue(&self, maxValue: c_double); + + #[method(warningValue)] + pub unsafe fn warningValue(&self) -> c_double; + + #[method(setWarningValue:)] + pub unsafe fn setWarningValue(&self, warningValue: c_double); + + #[method(criticalValue)] + pub unsafe fn criticalValue(&self) -> c_double; + + #[method(setCriticalValue:)] + pub unsafe fn setCriticalValue(&self, criticalValue: c_double); + + #[method(tickMarkPosition)] + pub unsafe fn tickMarkPosition(&self) -> NSTickMarkPosition; + + #[method(setTickMarkPosition:)] + pub unsafe fn setTickMarkPosition(&self, tickMarkPosition: NSTickMarkPosition); + + #[method(numberOfTickMarks)] + pub unsafe fn numberOfTickMarks(&self) -> NSInteger; + + #[method(setNumberOfTickMarks:)] + pub unsafe fn setNumberOfTickMarks(&self, numberOfTickMarks: NSInteger); + + #[method(numberOfMajorTickMarks)] + pub unsafe fn numberOfMajorTickMarks(&self) -> NSInteger; + + #[method(setNumberOfMajorTickMarks:)] + pub unsafe fn setNumberOfMajorTickMarks(&self, numberOfMajorTickMarks: NSInteger); + + #[method(rectOfTickMarkAtIndex:)] + pub unsafe fn rectOfTickMarkAtIndex(&self, index: NSInteger) -> NSRect; + + #[method(tickMarkValueAtIndex:)] + pub unsafe fn tickMarkValueAtIndex(&self, index: NSInteger) -> c_double; + } +); + +extern_static!( + NSRelevancyLevelIndicatorStyle: NSLevelIndicatorStyle = NSLevelIndicatorStyleRelevancy +); + +extern_static!( + NSContinuousCapacityLevelIndicatorStyle: NSLevelIndicatorStyle = + NSLevelIndicatorStyleContinuousCapacity +); + +extern_static!( + NSDiscreteCapacityLevelIndicatorStyle: NSLevelIndicatorStyle = + NSLevelIndicatorStyleDiscreteCapacity +); + +extern_static!(NSRatingLevelIndicatorStyle: NSLevelIndicatorStyle = NSLevelIndicatorStyleRating); diff --git a/crates/icrate/src/generated/AppKit/NSMagnificationGestureRecognizer.rs b/crates/icrate/src/generated/AppKit/NSMagnificationGestureRecognizer.rs new file mode 100644 index 000000000..f50e0d669 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSMagnificationGestureRecognizer.rs @@ -0,0 +1,25 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSMagnificationGestureRecognizer; + + unsafe impl ClassType for NSMagnificationGestureRecognizer { + type Super = NSGestureRecognizer; + } +); + +extern_methods!( + unsafe impl NSMagnificationGestureRecognizer { + #[method(magnification)] + pub unsafe fn magnification(&self) -> CGFloat; + + #[method(setMagnification:)] + pub unsafe fn setMagnification(&self, magnification: CGFloat); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSMatrix.rs b/crates/icrate/src/generated/AppKit/NSMatrix.rs new file mode 100644 index 000000000..e07fca6a0 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSMatrix.rs @@ -0,0 +1,401 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSMatrixMode { + NSRadioModeMatrix = 0, + NSHighlightModeMatrix = 1, + NSListModeMatrix = 2, + NSTrackModeMatrix = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMatrix; + + unsafe impl ClassType for NSMatrix { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSMatrix { + #[method_id(@__retain_semantics Init initWithFrame:)] + pub unsafe fn initWithFrame( + this: Option>, + frameRect: NSRect, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithFrame:mode:prototype:numberOfRows:numberOfColumns:)] + pub unsafe fn initWithFrame_mode_prototype_numberOfRows_numberOfColumns( + this: Option>, + frameRect: NSRect, + mode: NSMatrixMode, + cell: &NSCell, + rowsHigh: NSInteger, + colsWide: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithFrame:mode:cellClass:numberOfRows:numberOfColumns:)] + pub unsafe fn initWithFrame_mode_cellClass_numberOfRows_numberOfColumns( + this: Option>, + frameRect: NSRect, + mode: NSMatrixMode, + factoryId: Option<&Class>, + rowsHigh: NSInteger, + colsWide: NSInteger, + ) -> Id; + + #[method(cellClass)] + pub unsafe fn cellClass(&self) -> &'static Class; + + #[method(setCellClass:)] + pub unsafe fn setCellClass(&self, cellClass: &Class); + + #[method_id(@__retain_semantics Other prototype)] + pub unsafe fn prototype(&self) -> Option>; + + #[method(setPrototype:)] + pub unsafe fn setPrototype(&self, prototype: Option<&NSCell>); + + #[method_id(@__retain_semantics Other makeCellAtRow:column:)] + pub unsafe fn makeCellAtRow_column( + &self, + row: NSInteger, + col: NSInteger, + ) -> Id; + + #[method(mode)] + pub unsafe fn mode(&self) -> NSMatrixMode; + + #[method(setMode:)] + pub unsafe fn setMode(&self, mode: NSMatrixMode); + + #[method(allowsEmptySelection)] + pub unsafe fn allowsEmptySelection(&self) -> bool; + + #[method(setAllowsEmptySelection:)] + pub unsafe fn setAllowsEmptySelection(&self, allowsEmptySelection: bool); + + #[method(sendAction:to:forAllCells:)] + pub unsafe fn sendAction_to_forAllCells(&self, selector: Sel, object: &Object, flag: bool); + + #[method_id(@__retain_semantics Other cells)] + pub unsafe fn cells(&self) -> Id, Shared>; + + #[method(sortUsingSelector:)] + pub unsafe fn sortUsingSelector(&self, comparator: Sel); + + #[method(sortUsingFunction:context:)] + pub unsafe fn sortUsingFunction_context( + &self, + compare: unsafe extern "C" fn( + NonNull, + NonNull, + *mut c_void, + ) -> NSInteger, + context: *mut c_void, + ); + + #[method_id(@__retain_semantics Other selectedCell)] + pub unsafe fn selectedCell(&self) -> Option>; + + #[method_id(@__retain_semantics Other selectedCells)] + pub unsafe fn selectedCells(&self) -> Id, Shared>; + + #[method(selectedRow)] + pub unsafe fn selectedRow(&self) -> NSInteger; + + #[method(selectedColumn)] + pub unsafe fn selectedColumn(&self) -> NSInteger; + + #[method(isSelectionByRect)] + pub unsafe fn isSelectionByRect(&self) -> bool; + + #[method(setSelectionByRect:)] + pub unsafe fn setSelectionByRect(&self, selectionByRect: bool); + + #[method(setSelectionFrom:to:anchor:highlight:)] + pub unsafe fn setSelectionFrom_to_anchor_highlight( + &self, + startPos: NSInteger, + endPos: NSInteger, + anchorPos: NSInteger, + lit: bool, + ); + + #[method(deselectSelectedCell)] + pub unsafe fn deselectSelectedCell(&self); + + #[method(deselectAllCells)] + pub unsafe fn deselectAllCells(&self); + + #[method(selectCellAtRow:column:)] + pub unsafe fn selectCellAtRow_column(&self, row: NSInteger, col: NSInteger); + + #[method(selectAll:)] + pub unsafe fn selectAll(&self, sender: Option<&Object>); + + #[method(selectCellWithTag:)] + pub unsafe fn selectCellWithTag(&self, tag: NSInteger) -> bool; + + #[method(cellSize)] + pub unsafe fn cellSize(&self) -> NSSize; + + #[method(setCellSize:)] + pub unsafe fn setCellSize(&self, cellSize: NSSize); + + #[method(intercellSpacing)] + pub unsafe fn intercellSpacing(&self) -> NSSize; + + #[method(setIntercellSpacing:)] + pub unsafe fn setIntercellSpacing(&self, intercellSpacing: NSSize); + + #[method(setScrollable:)] + pub unsafe fn setScrollable(&self, flag: bool); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Id; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: &NSColor); + + #[method_id(@__retain_semantics Other cellBackgroundColor)] + pub unsafe fn cellBackgroundColor(&self) -> Option>; + + #[method(setCellBackgroundColor:)] + pub unsafe fn setCellBackgroundColor(&self, cellBackgroundColor: Option<&NSColor>); + + #[method(drawsCellBackground)] + pub unsafe fn drawsCellBackground(&self) -> bool; + + #[method(setDrawsCellBackground:)] + pub unsafe fn setDrawsCellBackground(&self, drawsCellBackground: bool); + + #[method(drawsBackground)] + pub unsafe fn drawsBackground(&self) -> bool; + + #[method(setDrawsBackground:)] + pub unsafe fn setDrawsBackground(&self, drawsBackground: bool); + + #[method(setState:atRow:column:)] + pub unsafe fn setState_atRow_column( + &self, + value: NSInteger, + row: NSInteger, + col: NSInteger, + ); + + #[method(getNumberOfRows:columns:)] + pub unsafe fn getNumberOfRows_columns( + &self, + rowCount: *mut NSInteger, + colCount: *mut NSInteger, + ); + + #[method(numberOfRows)] + pub unsafe fn numberOfRows(&self) -> NSInteger; + + #[method(numberOfColumns)] + pub unsafe fn numberOfColumns(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other cellAtRow:column:)] + pub unsafe fn cellAtRow_column( + &self, + row: NSInteger, + col: NSInteger, + ) -> Option>; + + #[method(cellFrameAtRow:column:)] + pub unsafe fn cellFrameAtRow_column(&self, row: NSInteger, col: NSInteger) -> NSRect; + + #[method(getRow:column:ofCell:)] + pub unsafe fn getRow_column_ofCell( + &self, + row: NonNull, + col: NonNull, + cell: &NSCell, + ) -> bool; + + #[method(getRow:column:forPoint:)] + pub unsafe fn getRow_column_forPoint( + &self, + row: NonNull, + col: NonNull, + point: NSPoint, + ) -> bool; + + #[method(renewRows:columns:)] + pub unsafe fn renewRows_columns(&self, newRows: NSInteger, newCols: NSInteger); + + #[method(putCell:atRow:column:)] + pub unsafe fn putCell_atRow_column(&self, newCell: &NSCell, row: NSInteger, col: NSInteger); + + #[method(addRow)] + pub unsafe fn addRow(&self); + + #[method(addRowWithCells:)] + pub unsafe fn addRowWithCells(&self, newCells: &NSArray); + + #[method(insertRow:)] + pub unsafe fn insertRow(&self, row: NSInteger); + + #[method(insertRow:withCells:)] + pub unsafe fn insertRow_withCells( + &self, + row: NSInteger, + newCells: Option<&NSArray>, + ); + + #[method(removeRow:)] + pub unsafe fn removeRow(&self, row: NSInteger); + + #[method(addColumn)] + pub unsafe fn addColumn(&self); + + #[method(addColumnWithCells:)] + pub unsafe fn addColumnWithCells(&self, newCells: &NSArray); + + #[method(insertColumn:)] + pub unsafe fn insertColumn(&self, column: NSInteger); + + #[method(insertColumn:withCells:)] + pub unsafe fn insertColumn_withCells( + &self, + column: NSInteger, + newCells: Option<&NSArray>, + ); + + #[method(removeColumn:)] + pub unsafe fn removeColumn(&self, col: NSInteger); + + #[method_id(@__retain_semantics Other cellWithTag:)] + pub unsafe fn cellWithTag(&self, tag: NSInteger) -> Option>; + + #[method(doubleAction)] + pub unsafe fn doubleAction(&self) -> OptionSel; + + #[method(setDoubleAction:)] + pub unsafe fn setDoubleAction(&self, doubleAction: OptionSel); + + #[method(autosizesCells)] + pub unsafe fn autosizesCells(&self) -> bool; + + #[method(setAutosizesCells:)] + pub unsafe fn setAutosizesCells(&self, autosizesCells: bool); + + #[method(sizeToCells)] + pub unsafe fn sizeToCells(&self); + + #[method(setValidateSize:)] + pub unsafe fn setValidateSize(&self, flag: bool); + + #[method(drawCellAtRow:column:)] + pub unsafe fn drawCellAtRow_column(&self, row: NSInteger, col: NSInteger); + + #[method(highlightCell:atRow:column:)] + pub unsafe fn highlightCell_atRow_column(&self, flag: bool, row: NSInteger, col: NSInteger); + + #[method(isAutoscroll)] + pub unsafe fn isAutoscroll(&self) -> bool; + + #[method(setAutoscroll:)] + pub unsafe fn setAutoscroll(&self, autoscroll: bool); + + #[method(scrollCellToVisibleAtRow:column:)] + pub unsafe fn scrollCellToVisibleAtRow_column(&self, row: NSInteger, col: NSInteger); + + #[method(mouseDownFlags)] + pub unsafe fn mouseDownFlags(&self) -> NSInteger; + + #[method(mouseDown:)] + pub unsafe fn mouseDown(&self, event: &NSEvent); + + #[method(performKeyEquivalent:)] + pub unsafe fn performKeyEquivalent(&self, event: &NSEvent) -> bool; + + #[method(sendAction)] + pub unsafe fn sendAction(&self) -> bool; + + #[method(sendDoubleAction)] + pub unsafe fn sendDoubleAction(&self); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSMatrixDelegate>); + + #[method(textShouldBeginEditing:)] + pub unsafe fn textShouldBeginEditing(&self, textObject: &NSText) -> bool; + + #[method(textShouldEndEditing:)] + pub unsafe fn textShouldEndEditing(&self, textObject: &NSText) -> bool; + + #[method(textDidBeginEditing:)] + pub unsafe fn textDidBeginEditing(&self, notification: &NSNotification); + + #[method(textDidEndEditing:)] + pub unsafe fn textDidEndEditing(&self, notification: &NSNotification); + + #[method(textDidChange:)] + pub unsafe fn textDidChange(&self, notification: &NSNotification); + + #[method(selectText:)] + pub unsafe fn selectText(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other selectTextAtRow:column:)] + pub unsafe fn selectTextAtRow_column( + &self, + row: NSInteger, + col: NSInteger, + ) -> Option>; + + #[method(acceptsFirstMouse:)] + pub unsafe fn acceptsFirstMouse(&self, event: Option<&NSEvent>) -> bool; + + #[method(resetCursorRects)] + pub unsafe fn resetCursorRects(&self); + + #[method(setToolTip:forCell:)] + pub unsafe fn setToolTip_forCell(&self, toolTipString: Option<&NSString>, cell: &NSCell); + + #[method_id(@__retain_semantics Other toolTipForCell:)] + pub unsafe fn toolTipForCell(&self, cell: &NSCell) -> Option>; + + #[method(autorecalculatesCellSize)] + pub unsafe fn autorecalculatesCellSize(&self) -> bool; + + #[method(setAutorecalculatesCellSize:)] + pub unsafe fn setAutorecalculatesCellSize(&self, autorecalculatesCellSize: bool); + } +); + +extern_methods!( + /// NSKeyboardUI + unsafe impl NSMatrix { + #[method(tabKeyTraversesCells)] + pub unsafe fn tabKeyTraversesCells(&self) -> bool; + + #[method(setTabKeyTraversesCells:)] + pub unsafe fn setTabKeyTraversesCells(&self, tabKeyTraversesCells: bool); + + #[method_id(@__retain_semantics Other keyCell)] + pub unsafe fn keyCell(&self) -> Option>; + + #[method(setKeyCell:)] + pub unsafe fn setKeyCell(&self, keyCell: Option<&NSCell>); + } +); + +extern_protocol!( + pub struct NSMatrixDelegate; + + unsafe impl NSMatrixDelegate {} +); diff --git a/crates/icrate/src/generated/AppKit/NSMediaLibraryBrowserController.rs b/crates/icrate/src/generated/AppKit/NSMediaLibraryBrowserController.rs new file mode 100644 index 000000000..5a3984c85 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSMediaLibraryBrowserController.rs @@ -0,0 +1,53 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSMediaLibrary { + NSMediaLibraryAudio = 1 << 0, + NSMediaLibraryImage = 1 << 1, + NSMediaLibraryMovie = 1 << 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMediaLibraryBrowserController; + + unsafe impl ClassType for NSMediaLibraryBrowserController { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMediaLibraryBrowserController { + #[method(isVisible)] + pub unsafe fn isVisible(&self) -> bool; + + #[method(setVisible:)] + pub unsafe fn setVisible(&self, visible: bool); + + #[method(frame)] + pub unsafe fn frame(&self) -> NSRect; + + #[method(setFrame:)] + pub unsafe fn setFrame(&self, frame: NSRect); + + #[method(mediaLibraries)] + pub unsafe fn mediaLibraries(&self) -> NSMediaLibrary; + + #[method(setMediaLibraries:)] + pub unsafe fn setMediaLibraries(&self, mediaLibraries: NSMediaLibrary); + + #[method_id(@__retain_semantics Other sharedMediaLibraryBrowserController)] + pub unsafe fn sharedMediaLibraryBrowserController( + ) -> Id; + + #[method(togglePanel:)] + pub unsafe fn togglePanel(&self, sender: Option<&Object>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSMenu.rs b/crates/icrate/src/generated/AppKit/NSMenu.rs new file mode 100644 index 000000000..967080203 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSMenu.rs @@ -0,0 +1,386 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSMenu; + + unsafe impl ClassType for NSMenu { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMenu { + #[method_id(@__retain_semantics Init initWithTitle:)] + pub unsafe fn initWithTitle( + this: Option>, + title: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + + #[method(popUpContextMenu:withEvent:forView:)] + pub unsafe fn popUpContextMenu_withEvent_forView( + menu: &NSMenu, + event: &NSEvent, + view: &NSView, + ); + + #[method(popUpContextMenu:withEvent:forView:withFont:)] + pub unsafe fn popUpContextMenu_withEvent_forView_withFont( + menu: &NSMenu, + event: &NSEvent, + view: &NSView, + font: Option<&NSFont>, + ); + + #[method(popUpMenuPositioningItem:atLocation:inView:)] + pub unsafe fn popUpMenuPositioningItem_atLocation_inView( + &self, + item: Option<&NSMenuItem>, + location: NSPoint, + view: Option<&NSView>, + ) -> bool; + + #[method(setMenuBarVisible:)] + pub unsafe fn setMenuBarVisible(visible: bool); + + #[method(menuBarVisible)] + pub unsafe fn menuBarVisible() -> bool; + + #[method_id(@__retain_semantics Other supermenu)] + pub unsafe fn supermenu(&self) -> Option>; + + #[method(setSupermenu:)] + pub unsafe fn setSupermenu(&self, supermenu: Option<&NSMenu>); + + #[method(insertItem:atIndex:)] + pub unsafe fn insertItem_atIndex(&self, newItem: &NSMenuItem, index: NSInteger); + + #[method(addItem:)] + pub unsafe fn addItem(&self, newItem: &NSMenuItem); + + #[method_id(@__retain_semantics Other insertItemWithTitle:action:keyEquivalent:atIndex:)] + pub unsafe fn insertItemWithTitle_action_keyEquivalent_atIndex( + &self, + string: &NSString, + selector: OptionSel, + charCode: &NSString, + index: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other addItemWithTitle:action:keyEquivalent:)] + pub unsafe fn addItemWithTitle_action_keyEquivalent( + &self, + string: &NSString, + selector: OptionSel, + charCode: &NSString, + ) -> Id; + + #[method(removeItemAtIndex:)] + pub unsafe fn removeItemAtIndex(&self, index: NSInteger); + + #[method(removeItem:)] + pub unsafe fn removeItem(&self, item: &NSMenuItem); + + #[method(setSubmenu:forItem:)] + pub unsafe fn setSubmenu_forItem(&self, menu: Option<&NSMenu>, item: &NSMenuItem); + + #[method(removeAllItems)] + pub unsafe fn removeAllItems(&self); + + #[method_id(@__retain_semantics Other itemArray)] + pub unsafe fn itemArray(&self) -> Id, Shared>; + + #[method(setItemArray:)] + pub unsafe fn setItemArray(&self, itemArray: &NSArray); + + #[method(numberOfItems)] + pub unsafe fn numberOfItems(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other itemAtIndex:)] + pub unsafe fn itemAtIndex(&self, index: NSInteger) -> Option>; + + #[method(indexOfItem:)] + pub unsafe fn indexOfItem(&self, item: &NSMenuItem) -> NSInteger; + + #[method(indexOfItemWithTitle:)] + pub unsafe fn indexOfItemWithTitle(&self, title: &NSString) -> NSInteger; + + #[method(indexOfItemWithTag:)] + pub unsafe fn indexOfItemWithTag(&self, tag: NSInteger) -> NSInteger; + + #[method(indexOfItemWithRepresentedObject:)] + pub unsafe fn indexOfItemWithRepresentedObject(&self, object: Option<&Object>) + -> NSInteger; + + #[method(indexOfItemWithSubmenu:)] + pub unsafe fn indexOfItemWithSubmenu(&self, submenu: Option<&NSMenu>) -> NSInteger; + + #[method(indexOfItemWithTarget:andAction:)] + pub unsafe fn indexOfItemWithTarget_andAction( + &self, + target: Option<&Object>, + actionSelector: OptionSel, + ) -> NSInteger; + + #[method_id(@__retain_semantics Other itemWithTitle:)] + pub unsafe fn itemWithTitle(&self, title: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other itemWithTag:)] + pub unsafe fn itemWithTag(&self, tag: NSInteger) -> Option>; + + #[method(autoenablesItems)] + pub unsafe fn autoenablesItems(&self) -> bool; + + #[method(setAutoenablesItems:)] + pub unsafe fn setAutoenablesItems(&self, autoenablesItems: bool); + + #[method(update)] + pub unsafe fn update(&self); + + #[method(performKeyEquivalent:)] + pub unsafe fn performKeyEquivalent(&self, event: &NSEvent) -> bool; + + #[method(itemChanged:)] + pub unsafe fn itemChanged(&self, item: &NSMenuItem); + + #[method(performActionForItemAtIndex:)] + pub unsafe fn performActionForItemAtIndex(&self, index: NSInteger); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSMenuDelegate>); + + #[method(menuBarHeight)] + pub unsafe fn menuBarHeight(&self) -> CGFloat; + + #[method(cancelTracking)] + pub unsafe fn cancelTracking(&self); + + #[method(cancelTrackingWithoutAnimation)] + pub unsafe fn cancelTrackingWithoutAnimation(&self); + + #[method_id(@__retain_semantics Other highlightedItem)] + pub unsafe fn highlightedItem(&self) -> Option>; + + #[method(minimumWidth)] + pub unsafe fn minimumWidth(&self) -> CGFloat; + + #[method(setMinimumWidth:)] + pub unsafe fn setMinimumWidth(&self, minimumWidth: CGFloat); + + #[method(size)] + pub unsafe fn size(&self) -> NSSize; + + #[method_id(@__retain_semantics Other font)] + pub unsafe fn font(&self) -> Option>; + + #[method(setFont:)] + pub unsafe fn setFont(&self, font: Option<&NSFont>); + + #[method(allowsContextMenuPlugIns)] + pub unsafe fn allowsContextMenuPlugIns(&self) -> bool; + + #[method(setAllowsContextMenuPlugIns:)] + pub unsafe fn setAllowsContextMenuPlugIns(&self, allowsContextMenuPlugIns: bool); + + #[method(showsStateColumn)] + pub unsafe fn showsStateColumn(&self) -> bool; + + #[method(setShowsStateColumn:)] + pub unsafe fn setShowsStateColumn(&self, showsStateColumn: bool); + + #[method(userInterfaceLayoutDirection)] + pub unsafe fn userInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection; + + #[method(setUserInterfaceLayoutDirection:)] + pub unsafe fn setUserInterfaceLayoutDirection( + &self, + userInterfaceLayoutDirection: NSUserInterfaceLayoutDirection, + ); + } +); + +extern_methods!( + /// NSSubmenuAction + unsafe impl NSMenu { + #[method(submenuAction:)] + pub unsafe fn submenuAction(&self, sender: Option<&Object>); + } +); + +extern_protocol!( + pub struct NSMenuItemValidation; + + unsafe impl NSMenuItemValidation { + #[method(validateMenuItem:)] + pub unsafe fn validateMenuItem(&self, menuItem: &NSMenuItem) -> bool; + } +); + +extern_methods!( + /// NSMenuValidation + unsafe impl NSObject { + #[method(validateMenuItem:)] + pub unsafe fn validateMenuItem(&self, menuItem: &NSMenuItem) -> bool; + } +); + +extern_protocol!( + pub struct NSMenuDelegate; + + unsafe impl NSMenuDelegate { + #[optional] + #[method(menuNeedsUpdate:)] + pub unsafe fn menuNeedsUpdate(&self, menu: &NSMenu); + + #[optional] + #[method(numberOfItemsInMenu:)] + pub unsafe fn numberOfItemsInMenu(&self, menu: &NSMenu) -> NSInteger; + + #[optional] + #[method(menu:updateItem:atIndex:shouldCancel:)] + pub unsafe fn menu_updateItem_atIndex_shouldCancel( + &self, + menu: &NSMenu, + item: &NSMenuItem, + index: NSInteger, + shouldCancel: bool, + ) -> bool; + + #[optional] + #[method(menuHasKeyEquivalent:forEvent:target:action:)] + pub unsafe fn menuHasKeyEquivalent_forEvent_target_action( + &self, + menu: &NSMenu, + event: &NSEvent, + target: NonNull<*mut Object>, + action: NonNull, + ) -> bool; + + #[optional] + #[method(menuWillOpen:)] + pub unsafe fn menuWillOpen(&self, menu: &NSMenu); + + #[optional] + #[method(menuDidClose:)] + pub unsafe fn menuDidClose(&self, menu: &NSMenu); + + #[optional] + #[method(menu:willHighlightItem:)] + pub unsafe fn menu_willHighlightItem(&self, menu: &NSMenu, item: Option<&NSMenuItem>); + + #[optional] + #[method(confinementRectForMenu:onScreen:)] + pub unsafe fn confinementRectForMenu_onScreen( + &self, + menu: &NSMenu, + screen: Option<&NSScreen>, + ) -> NSRect; + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSMenuProperties { + NSMenuPropertyItemTitle = 1 << 0, + NSMenuPropertyItemAttributedTitle = 1 << 1, + NSMenuPropertyItemKeyEquivalent = 1 << 2, + NSMenuPropertyItemImage = 1 << 3, + NSMenuPropertyItemEnabled = 1 << 4, + NSMenuPropertyItemAccessibilityDescription = 1 << 5, + } +); + +extern_methods!( + /// NSMenuPropertiesToUpdate + unsafe impl NSMenu { + #[method(propertiesToUpdate)] + pub unsafe fn propertiesToUpdate(&self) -> NSMenuProperties; + } +); + +extern_static!(NSMenuWillSendActionNotification: &'static NSNotificationName); + +extern_static!(NSMenuDidSendActionNotification: &'static NSNotificationName); + +extern_static!(NSMenuDidAddItemNotification: &'static NSNotificationName); + +extern_static!(NSMenuDidRemoveItemNotification: &'static NSNotificationName); + +extern_static!(NSMenuDidChangeItemNotification: &'static NSNotificationName); + +extern_static!(NSMenuDidBeginTrackingNotification: &'static NSNotificationName); + +extern_static!(NSMenuDidEndTrackingNotification: &'static NSNotificationName); + +extern_methods!( + /// NSDeprecated + unsafe impl NSMenu { + #[method(setMenuRepresentation:)] + pub unsafe fn setMenuRepresentation(&self, menuRep: Option<&Object>); + + #[method_id(@__retain_semantics Other menuRepresentation)] + pub unsafe fn menuRepresentation(&self) -> Option>; + + #[method(setContextMenuRepresentation:)] + pub unsafe fn setContextMenuRepresentation(&self, menuRep: Option<&Object>); + + #[method_id(@__retain_semantics Other contextMenuRepresentation)] + pub unsafe fn contextMenuRepresentation(&self) -> Option>; + + #[method(setTearOffMenuRepresentation:)] + pub unsafe fn setTearOffMenuRepresentation(&self, menuRep: Option<&Object>); + + #[method_id(@__retain_semantics Other tearOffMenuRepresentation)] + pub unsafe fn tearOffMenuRepresentation(&self) -> Option>; + + #[method(menuZone)] + pub unsafe fn menuZone() -> *mut NSZone; + + #[method(setMenuZone:)] + pub unsafe fn setMenuZone(zone: *mut NSZone); + + #[method_id(@__retain_semantics Other attachedMenu)] + pub unsafe fn attachedMenu(&self) -> Option>; + + #[method(isAttached)] + pub unsafe fn isAttached(&self) -> bool; + + #[method(sizeToFit)] + pub unsafe fn sizeToFit(&self); + + #[method(locationForSubmenu:)] + pub unsafe fn locationForSubmenu(&self, submenu: Option<&NSMenu>) -> NSPoint; + + #[method(menuChangedMessagesEnabled)] + pub unsafe fn menuChangedMessagesEnabled(&self) -> bool; + + #[method(setMenuChangedMessagesEnabled:)] + pub unsafe fn setMenuChangedMessagesEnabled(&self, menuChangedMessagesEnabled: bool); + + #[method(helpRequested:)] + pub unsafe fn helpRequested(&self, eventPtr: &NSEvent); + + #[method(isTornOff)] + pub unsafe fn isTornOff(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSMenuItem.rs b/crates/icrate/src/generated/AppKit/NSMenuItem.rs new file mode 100644 index 000000000..7ff145d6c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSMenuItem.rs @@ -0,0 +1,240 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSMenuItem; + + unsafe impl ClassType for NSMenuItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMenuItem { + #[method(usesUserKeyEquivalents)] + pub unsafe fn usesUserKeyEquivalents() -> bool; + + #[method(setUsesUserKeyEquivalents:)] + pub unsafe fn setUsesUserKeyEquivalents(usesUserKeyEquivalents: bool); + + #[method_id(@__retain_semantics Other separatorItem)] + pub unsafe fn separatorItem() -> Id; + + #[method_id(@__retain_semantics Init initWithTitle:action:keyEquivalent:)] + pub unsafe fn initWithTitle_action_keyEquivalent( + this: Option>, + string: &NSString, + selector: OptionSel, + charCode: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Other menu)] + pub unsafe fn menu(&self) -> Option>; + + #[method(setMenu:)] + pub unsafe fn setMenu(&self, menu: Option<&NSMenu>); + + #[method(hasSubmenu)] + pub unsafe fn hasSubmenu(&self) -> bool; + + #[method_id(@__retain_semantics Other submenu)] + pub unsafe fn submenu(&self) -> Option>; + + #[method(setSubmenu:)] + pub unsafe fn setSubmenu(&self, submenu: Option<&NSMenu>); + + #[method_id(@__retain_semantics Other parentItem)] + pub unsafe fn parentItem(&self) -> Option>; + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + + #[method_id(@__retain_semantics Other attributedTitle)] + pub unsafe fn attributedTitle(&self) -> Option>; + + #[method(setAttributedTitle:)] + pub unsafe fn setAttributedTitle(&self, attributedTitle: Option<&NSAttributedString>); + + #[method(isSeparatorItem)] + pub unsafe fn isSeparatorItem(&self) -> bool; + + #[method_id(@__retain_semantics Other keyEquivalent)] + pub unsafe fn keyEquivalent(&self) -> Id; + + #[method(setKeyEquivalent:)] + pub unsafe fn setKeyEquivalent(&self, keyEquivalent: &NSString); + + #[method(keyEquivalentModifierMask)] + pub unsafe fn keyEquivalentModifierMask(&self) -> NSEventModifierFlags; + + #[method(setKeyEquivalentModifierMask:)] + pub unsafe fn setKeyEquivalentModifierMask( + &self, + keyEquivalentModifierMask: NSEventModifierFlags, + ); + + #[method_id(@__retain_semantics Other userKeyEquivalent)] + pub unsafe fn userKeyEquivalent(&self) -> Id; + + #[method(allowsKeyEquivalentWhenHidden)] + pub unsafe fn allowsKeyEquivalentWhenHidden(&self) -> bool; + + #[method(setAllowsKeyEquivalentWhenHidden:)] + pub unsafe fn setAllowsKeyEquivalentWhenHidden(&self, allowsKeyEquivalentWhenHidden: bool); + + #[method(allowsAutomaticKeyEquivalentLocalization)] + pub unsafe fn allowsAutomaticKeyEquivalentLocalization(&self) -> bool; + + #[method(setAllowsAutomaticKeyEquivalentLocalization:)] + pub unsafe fn setAllowsAutomaticKeyEquivalentLocalization( + &self, + allowsAutomaticKeyEquivalentLocalization: bool, + ); + + #[method(allowsAutomaticKeyEquivalentMirroring)] + pub unsafe fn allowsAutomaticKeyEquivalentMirroring(&self) -> bool; + + #[method(setAllowsAutomaticKeyEquivalentMirroring:)] + pub unsafe fn setAllowsAutomaticKeyEquivalentMirroring( + &self, + allowsAutomaticKeyEquivalentMirroring: bool, + ); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + + #[method(state)] + pub unsafe fn state(&self) -> NSControlStateValue; + + #[method(setState:)] + pub unsafe fn setState(&self, state: NSControlStateValue); + + #[method_id(@__retain_semantics Other onStateImage)] + pub unsafe fn onStateImage(&self) -> Option>; + + #[method(setOnStateImage:)] + pub unsafe fn setOnStateImage(&self, onStateImage: Option<&NSImage>); + + #[method_id(@__retain_semantics Other offStateImage)] + pub unsafe fn offStateImage(&self) -> Option>; + + #[method(setOffStateImage:)] + pub unsafe fn setOffStateImage(&self, offStateImage: Option<&NSImage>); + + #[method_id(@__retain_semantics Other mixedStateImage)] + pub unsafe fn mixedStateImage(&self) -> Option>; + + #[method(setMixedStateImage:)] + pub unsafe fn setMixedStateImage(&self, mixedStateImage: Option<&NSImage>); + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + + #[method(isAlternate)] + pub unsafe fn isAlternate(&self) -> bool; + + #[method(setAlternate:)] + pub unsafe fn setAlternate(&self, alternate: bool); + + #[method(indentationLevel)] + pub unsafe fn indentationLevel(&self) -> NSInteger; + + #[method(setIndentationLevel:)] + pub unsafe fn setIndentationLevel(&self, indentationLevel: NSInteger); + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: OptionSel); + + #[method(tag)] + pub unsafe fn tag(&self) -> NSInteger; + + #[method(setTag:)] + pub unsafe fn setTag(&self, tag: NSInteger); + + #[method_id(@__retain_semantics Other representedObject)] + pub unsafe fn representedObject(&self) -> Option>; + + #[method(setRepresentedObject:)] + pub unsafe fn setRepresentedObject(&self, representedObject: Option<&Object>); + + #[method_id(@__retain_semantics Other view)] + pub unsafe fn view(&self) -> Option>; + + #[method(setView:)] + pub unsafe fn setView(&self, view: Option<&NSView>); + + #[method(isHighlighted)] + pub unsafe fn isHighlighted(&self) -> bool; + + #[method(isHidden)] + pub unsafe fn isHidden(&self) -> bool; + + #[method(setHidden:)] + pub unsafe fn setHidden(&self, hidden: bool); + + #[method(isHiddenOrHasHiddenAncestor)] + pub unsafe fn isHiddenOrHasHiddenAncestor(&self) -> bool; + + #[method_id(@__retain_semantics Other toolTip)] + pub unsafe fn toolTip(&self) -> Option>; + + #[method(setToolTip:)] + pub unsafe fn setToolTip(&self, toolTip: Option<&NSString>); + } +); + +extern_methods!( + /// NSViewEnclosingMenuItem + unsafe impl NSView { + #[method_id(@__retain_semantics Other enclosingMenuItem)] + pub unsafe fn enclosingMenuItem(&self) -> Option>; + } +); + +extern_static!(NSMenuItemImportFromDeviceIdentifier: &'static NSUserInterfaceItemIdentifier); + +extern_methods!( + /// NSDeprecated + unsafe impl NSMenuItem { + #[method(setMnemonicLocation:)] + pub unsafe fn setMnemonicLocation(&self, location: NSUInteger); + + #[method(mnemonicLocation)] + pub unsafe fn mnemonicLocation(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other mnemonic)] + pub unsafe fn mnemonic(&self) -> Option>; + + #[method(setTitleWithMnemonic:)] + pub unsafe fn setTitleWithMnemonic(&self, stringWithAmpersand: &NSString); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSMenuItemCell.rs b/crates/icrate/src/generated/AppKit/NSMenuItemCell.rs new file mode 100644 index 000000000..9f671dce8 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSMenuItemCell.rs @@ -0,0 +1,113 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSMenuItemCell; + + unsafe impl ClassType for NSMenuItemCell { + type Super = NSButtonCell; + } +); + +extern_methods!( + unsafe impl NSMenuItemCell { + #[method_id(@__retain_semantics Init initTextCell:)] + pub unsafe fn initTextCell( + this: Option>, + string: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Other menuItem)] + pub unsafe fn menuItem(&self) -> Option>; + + #[method(setMenuItem:)] + pub unsafe fn setMenuItem(&self, menuItem: Option<&NSMenuItem>); + + #[method(needsSizing)] + pub unsafe fn needsSizing(&self) -> bool; + + #[method(setNeedsSizing:)] + pub unsafe fn setNeedsSizing(&self, needsSizing: bool); + + #[method(calcSize)] + pub unsafe fn calcSize(&self); + + #[method(needsDisplay)] + pub unsafe fn needsDisplay(&self) -> bool; + + #[method(setNeedsDisplay:)] + pub unsafe fn setNeedsDisplay(&self, needsDisplay: bool); + + #[method(stateImageWidth)] + pub unsafe fn stateImageWidth(&self) -> CGFloat; + + #[method(imageWidth)] + pub unsafe fn imageWidth(&self) -> CGFloat; + + #[method(titleWidth)] + pub unsafe fn titleWidth(&self) -> CGFloat; + + #[method(keyEquivalentWidth)] + pub unsafe fn keyEquivalentWidth(&self) -> CGFloat; + + #[method(stateImageRectForBounds:)] + pub unsafe fn stateImageRectForBounds(&self, cellFrame: NSRect) -> NSRect; + + #[method(titleRectForBounds:)] + pub unsafe fn titleRectForBounds(&self, cellFrame: NSRect) -> NSRect; + + #[method(keyEquivalentRectForBounds:)] + pub unsafe fn keyEquivalentRectForBounds(&self, cellFrame: NSRect) -> NSRect; + + #[method(drawSeparatorItemWithFrame:inView:)] + pub unsafe fn drawSeparatorItemWithFrame_inView( + &self, + cellFrame: NSRect, + controlView: &NSView, + ); + + #[method(drawStateImageWithFrame:inView:)] + pub unsafe fn drawStateImageWithFrame_inView( + &self, + cellFrame: NSRect, + controlView: &NSView, + ); + + #[method(drawImageWithFrame:inView:)] + pub unsafe fn drawImageWithFrame_inView(&self, cellFrame: NSRect, controlView: &NSView); + + #[method(drawTitleWithFrame:inView:)] + pub unsafe fn drawTitleWithFrame_inView(&self, cellFrame: NSRect, controlView: &NSView); + + #[method(drawKeyEquivalentWithFrame:inView:)] + pub unsafe fn drawKeyEquivalentWithFrame_inView( + &self, + cellFrame: NSRect, + controlView: &NSView, + ); + + #[method(drawBorderAndBackgroundWithFrame:inView:)] + pub unsafe fn drawBorderAndBackgroundWithFrame_inView( + &self, + cellFrame: NSRect, + controlView: &NSView, + ); + + #[method(tag)] + pub unsafe fn tag(&self) -> NSInteger; + + #[method(setTag:)] + pub unsafe fn setTag(&self, tag: NSInteger); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSMenuToolbarItem.rs b/crates/icrate/src/generated/AppKit/NSMenuToolbarItem.rs new file mode 100644 index 000000000..32e9b7282 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSMenuToolbarItem.rs @@ -0,0 +1,31 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSMenuToolbarItem; + + unsafe impl ClassType for NSMenuToolbarItem { + type Super = NSToolbarItem; + } +); + +extern_methods!( + unsafe impl NSMenuToolbarItem { + #[method_id(@__retain_semantics Other menu)] + pub unsafe fn menu(&self) -> Id; + + #[method(setMenu:)] + pub unsafe fn setMenu(&self, menu: &NSMenu); + + #[method(showsIndicator)] + pub unsafe fn showsIndicator(&self) -> bool; + + #[method(setShowsIndicator:)] + pub unsafe fn setShowsIndicator(&self, showsIndicator: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSMovie.rs b/crates/icrate/src/generated/AppKit/NSMovie.rs new file mode 100644 index 000000000..6a36b9cf2 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSMovie.rs @@ -0,0 +1,28 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSMovie; + + unsafe impl ClassType for NSMovie { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMovie { + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSNib.rs b/crates/icrate/src/generated/AppKit/NSNib.rs new file mode 100644 index 000000000..900bf3d25 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSNib.rs @@ -0,0 +1,70 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSNibName = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSNib; + + unsafe impl ClassType for NSNib { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSNib { + #[method_id(@__retain_semantics Init initWithNibNamed:bundle:)] + pub unsafe fn initWithNibNamed_bundle( + this: Option>, + nibName: &NSNibName, + bundle: Option<&NSBundle>, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithNibData:bundle:)] + pub unsafe fn initWithNibData_bundle( + this: Option>, + nibData: &NSData, + bundle: Option<&NSBundle>, + ) -> Id; + + #[method(instantiateWithOwner:topLevelObjects:)] + pub unsafe fn instantiateWithOwner_topLevelObjects( + &self, + owner: Option<&Object>, + topLevelObjects: *mut *mut NSArray, + ) -> bool; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSNib { + #[method_id(@__retain_semantics Init initWithContentsOfURL:)] + pub unsafe fn initWithContentsOfURL( + this: Option>, + nibFileURL: Option<&NSURL>, + ) -> Option>; + + #[method(instantiateNibWithExternalNameTable:)] + pub unsafe fn instantiateNibWithExternalNameTable( + &self, + externalNameTable: Option<&NSDictionary>, + ) -> bool; + + #[method(instantiateNibWithOwner:topLevelObjects:)] + pub unsafe fn instantiateNibWithOwner_topLevelObjects( + &self, + owner: Option<&Object>, + topLevelObjects: *mut *mut NSArray, + ) -> bool; + } +); + +extern_static!(NSNibOwner: &'static NSString); + +extern_static!(NSNibTopLevelObjects: &'static NSString); diff --git a/crates/icrate/src/generated/AppKit/NSNibDeclarations.rs b/crates/icrate/src/generated/AppKit/NSNibDeclarations.rs new file mode 100644 index 000000000..661a20881 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSNibDeclarations.rs @@ -0,0 +1,6 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; diff --git a/crates/icrate/src/generated/AppKit/NSNibLoading.rs b/crates/icrate/src/generated/AppKit/NSNibLoading.rs new file mode 100644 index 000000000..2f8de856d --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSNibLoading.rs @@ -0,0 +1,41 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_methods!( + /// NSNibLoading + unsafe impl NSBundle { + #[method(loadNibNamed:owner:topLevelObjects:)] + pub unsafe fn loadNibNamed_owner_topLevelObjects( + &self, + nibName: &NSNibName, + owner: Option<&Object>, + topLevelObjects: *mut *mut NSArray, + ) -> bool; + } +); + +extern_methods!( + /// NSNibAwaking + unsafe impl NSObject { + #[method(awakeFromNib)] + pub unsafe fn awakeFromNib(&self); + + #[method(prepareForInterfaceBuilder)] + pub unsafe fn prepareForInterfaceBuilder(&self); + } +); + +extern_methods!( + /// NSNibLoadingDeprecated + unsafe impl NSBundle { + #[method(loadNibNamed:owner:)] + pub unsafe fn loadNibNamed_owner( + nibName: Option<&NSString>, + owner: Option<&Object>, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSObjectController.rs b/crates/icrate/src/generated/AppKit/NSObjectController.rs new file mode 100644 index 000000000..bd2a8ffe9 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSObjectController.rs @@ -0,0 +1,134 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSObjectController; + + unsafe impl ClassType for NSObjectController { + type Super = NSController; + } +); + +extern_methods!( + unsafe impl NSObjectController { + #[method_id(@__retain_semantics Init initWithContent:)] + pub unsafe fn initWithContent( + this: Option>, + content: Option<&Object>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other content)] + pub unsafe fn content(&self) -> Option>; + + #[method(setContent:)] + pub unsafe fn setContent(&self, content: Option<&Object>); + + #[method_id(@__retain_semantics Other selection)] + pub unsafe fn selection(&self) -> Id; + + #[method_id(@__retain_semantics Other selectedObjects)] + pub unsafe fn selectedObjects(&self) -> Id; + + #[method(automaticallyPreparesContent)] + pub unsafe fn automaticallyPreparesContent(&self) -> bool; + + #[method(setAutomaticallyPreparesContent:)] + pub unsafe fn setAutomaticallyPreparesContent(&self, automaticallyPreparesContent: bool); + + #[method(prepareContent)] + pub unsafe fn prepareContent(&self); + + #[method(objectClass)] + pub unsafe fn objectClass(&self) -> Option<&'static Class>; + + #[method(setObjectClass:)] + pub unsafe fn setObjectClass(&self, objectClass: Option<&Class>); + + #[method_id(@__retain_semantics New newObject)] + pub unsafe fn newObject(&self) -> Id; + + #[method(addObject:)] + pub unsafe fn addObject(&self, object: &Object); + + #[method(removeObject:)] + pub unsafe fn removeObject(&self, object: &Object); + + #[method(isEditable)] + pub unsafe fn isEditable(&self) -> bool; + + #[method(setEditable:)] + pub unsafe fn setEditable(&self, editable: bool); + + #[method(add:)] + pub unsafe fn add(&self, sender: Option<&Object>); + + #[method(canAdd)] + pub unsafe fn canAdd(&self) -> bool; + + #[method(remove:)] + pub unsafe fn remove(&self, sender: Option<&Object>); + + #[method(canRemove)] + pub unsafe fn canRemove(&self) -> bool; + + #[method(validateUserInterfaceItem:)] + pub unsafe fn validateUserInterfaceItem(&self, item: &NSValidatedUserInterfaceItem) + -> bool; + } +); + +extern_methods!( + /// NSManagedController + unsafe impl NSObjectController { + #[method_id(@__retain_semantics Other managedObjectContext)] + pub unsafe fn managedObjectContext(&self) -> Option>; + + #[method(setManagedObjectContext:)] + pub unsafe fn setManagedObjectContext( + &self, + managedObjectContext: Option<&NSManagedObjectContext>, + ); + + #[method_id(@__retain_semantics Other entityName)] + pub unsafe fn entityName(&self) -> Option>; + + #[method(setEntityName:)] + pub unsafe fn setEntityName(&self, entityName: Option<&NSString>); + + #[method_id(@__retain_semantics Other fetchPredicate)] + pub unsafe fn fetchPredicate(&self) -> Option>; + + #[method(setFetchPredicate:)] + pub unsafe fn setFetchPredicate(&self, fetchPredicate: Option<&NSPredicate>); + + #[method(fetchWithRequest:merge:error:)] + pub unsafe fn fetchWithRequest_merge_error( + &self, + fetchRequest: Option<&NSFetchRequest>, + merge: bool, + ) -> Result<(), Id>; + + #[method(fetch:)] + pub unsafe fn fetch(&self, sender: Option<&Object>); + + #[method(usesLazyFetching)] + pub unsafe fn usesLazyFetching(&self) -> bool; + + #[method(setUsesLazyFetching:)] + pub unsafe fn setUsesLazyFetching(&self, usesLazyFetching: bool); + + #[method_id(@__retain_semantics Other defaultFetchRequest)] + pub unsafe fn defaultFetchRequest(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSOpenGL.rs b/crates/icrate/src/generated/AppKit/NSOpenGL.rs new file mode 100644 index 000000000..cc4cf402a --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSOpenGL.rs @@ -0,0 +1,161 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(u32)] + pub enum NSOpenGLGlobalOption { + NSOpenGLGOFormatCacheSize = 501, + NSOpenGLGOClearFormatCache = 502, + NSOpenGLGORetainRenderers = 503, + NSOpenGLGOUseBuildCache = 506, + NSOpenGLGOResetLibrary = 504, + } +); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSOpenGLPFAAllRenderers = 1, + NSOpenGLPFATripleBuffer = 3, + NSOpenGLPFADoubleBuffer = 5, + NSOpenGLPFAAuxBuffers = 7, + NSOpenGLPFAColorSize = 8, + NSOpenGLPFAAlphaSize = 11, + NSOpenGLPFADepthSize = 12, + NSOpenGLPFAStencilSize = 13, + NSOpenGLPFAAccumSize = 14, + NSOpenGLPFAMinimumPolicy = 51, + NSOpenGLPFAMaximumPolicy = 52, + NSOpenGLPFASampleBuffers = 55, + NSOpenGLPFASamples = 56, + NSOpenGLPFAAuxDepthStencil = 57, + NSOpenGLPFAColorFloat = 58, + NSOpenGLPFAMultisample = 59, + NSOpenGLPFASupersample = 60, + NSOpenGLPFASampleAlpha = 61, + NSOpenGLPFARendererID = 70, + NSOpenGLPFANoRecovery = 72, + NSOpenGLPFAAccelerated = 73, + NSOpenGLPFAClosestPolicy = 74, + NSOpenGLPFABackingStore = 76, + NSOpenGLPFAScreenMask = 84, + NSOpenGLPFAAllowOfflineRenderers = 96, + NSOpenGLPFAAcceleratedCompute = 97, + NSOpenGLPFAOpenGLProfile = 99, + NSOpenGLPFAVirtualScreenCount = 128, + NSOpenGLPFAStereo = 6, + NSOpenGLPFAOffScreen = 53, + NSOpenGLPFAFullScreen = 54, + NSOpenGLPFASingleRenderer = 71, + NSOpenGLPFARobust = 75, + NSOpenGLPFAMPSafe = 78, + NSOpenGLPFAWindow = 80, + NSOpenGLPFAMultiScreen = 81, + NSOpenGLPFACompliant = 83, + NSOpenGLPFAPixelBuffer = 90, + NSOpenGLPFARemotePixelBuffer = 91, + } +); + +pub type NSOpenGLPixelFormatAttribute = u32; + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSOpenGLProfileVersionLegacy = 0x1000, + NSOpenGLProfileVersion3_2Core = 0x3200, + NSOpenGLProfileVersion4_1Core = 0x4100, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSOpenGLContextParameter { + NSOpenGLContextParameterSwapInterval = 222, + NSOpenGLContextParameterSurfaceOrder = 235, + NSOpenGLContextParameterSurfaceOpacity = 236, + NSOpenGLContextParameterSurfaceBackingSize = 304, + NSOpenGLContextParameterReclaimResources = 308, + NSOpenGLContextParameterCurrentRendererID = 309, + NSOpenGLContextParameterGPUVertexProcessing = 310, + NSOpenGLContextParameterGPUFragmentProcessing = 311, + NSOpenGLContextParameterHasDrawable = 314, + NSOpenGLContextParameterMPSwapsInFlight = 315, + NSOpenGLContextParameterSwapRectangle = 200, + NSOpenGLContextParameterSwapRectangleEnable = 201, + NSOpenGLContextParameterRasterizationEnable = 221, + NSOpenGLContextParameterStateValidation = 301, + NSOpenGLContextParameterSurfaceSurfaceVolatile = 306, + } +); + +extern_static!( + NSOpenGLCPSwapInterval: NSOpenGLContextParameter = NSOpenGLContextParameterSwapInterval +); + +extern_static!( + NSOpenGLCPSurfaceOrder: NSOpenGLContextParameter = NSOpenGLContextParameterSurfaceOrder +); + +extern_static!( + NSOpenGLCPSurfaceOpacity: NSOpenGLContextParameter = NSOpenGLContextParameterSurfaceOpacity +); + +extern_static!( + NSOpenGLCPSurfaceBackingSize: NSOpenGLContextParameter = + NSOpenGLContextParameterSurfaceBackingSize +); + +extern_static!( + NSOpenGLCPReclaimResources: NSOpenGLContextParameter = NSOpenGLContextParameterReclaimResources +); + +extern_static!( + NSOpenGLCPCurrentRendererID: NSOpenGLContextParameter = + NSOpenGLContextParameterCurrentRendererID +); + +extern_static!( + NSOpenGLCPGPUVertexProcessing: NSOpenGLContextParameter = + NSOpenGLContextParameterGPUVertexProcessing +); + +extern_static!( + NSOpenGLCPGPUFragmentProcessing: NSOpenGLContextParameter = + NSOpenGLContextParameterGPUFragmentProcessing +); + +extern_static!( + NSOpenGLCPHasDrawable: NSOpenGLContextParameter = NSOpenGLContextParameterHasDrawable +); + +extern_static!( + NSOpenGLCPMPSwapsInFlight: NSOpenGLContextParameter = NSOpenGLContextParameterMPSwapsInFlight +); + +extern_static!( + NSOpenGLCPSwapRectangle: NSOpenGLContextParameter = NSOpenGLContextParameterSwapRectangle +); + +extern_static!( + NSOpenGLCPSwapRectangleEnable: NSOpenGLContextParameter = + NSOpenGLContextParameterSwapRectangleEnable +); + +extern_static!( + NSOpenGLCPRasterizationEnable: NSOpenGLContextParameter = + NSOpenGLContextParameterRasterizationEnable +); + +extern_static!( + NSOpenGLCPStateValidation: NSOpenGLContextParameter = NSOpenGLContextParameterStateValidation +); + +extern_static!( + NSOpenGLCPSurfaceSurfaceVolatile: NSOpenGLContextParameter = + NSOpenGLContextParameterSurfaceSurfaceVolatile +); diff --git a/crates/icrate/src/generated/AppKit/NSOpenGLLayer.rs b/crates/icrate/src/generated/AppKit/NSOpenGLLayer.rs new file mode 100644 index 000000000..661a20881 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSOpenGLLayer.rs @@ -0,0 +1,6 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; diff --git a/crates/icrate/src/generated/AppKit/NSOpenGLView.rs b/crates/icrate/src/generated/AppKit/NSOpenGLView.rs new file mode 100644 index 000000000..fa1534506 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSOpenGLView.rs @@ -0,0 +1,34 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_methods!( + /// NSOpenGLSurfaceResolution + unsafe impl NSView { + #[method(wantsBestResolutionOpenGLSurface)] + pub unsafe fn wantsBestResolutionOpenGLSurface(&self) -> bool; + + #[method(setWantsBestResolutionOpenGLSurface:)] + pub unsafe fn setWantsBestResolutionOpenGLSurface( + &self, + wantsBestResolutionOpenGLSurface: bool, + ); + } +); + +extern_methods!( + /// NSExtendedDynamicRange + unsafe impl NSView { + #[method(wantsExtendedDynamicRangeOpenGLSurface)] + pub unsafe fn wantsExtendedDynamicRangeOpenGLSurface(&self) -> bool; + + #[method(setWantsExtendedDynamicRangeOpenGLSurface:)] + pub unsafe fn setWantsExtendedDynamicRangeOpenGLSurface( + &self, + wantsExtendedDynamicRangeOpenGLSurface: bool, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSOpenPanel.rs b/crates/icrate/src/generated/AppKit/NSOpenPanel.rs new file mode 100644 index 000000000..269ad2c23 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSOpenPanel.rs @@ -0,0 +1,109 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSOpenPanel; + + unsafe impl ClassType for NSOpenPanel { + type Super = NSSavePanel; + } +); + +extern_methods!( + unsafe impl NSOpenPanel { + #[method_id(@__retain_semantics Other openPanel)] + pub unsafe fn openPanel() -> Id; + + #[method_id(@__retain_semantics Other URLs)] + pub unsafe fn URLs(&self) -> Id, Shared>; + + #[method(resolvesAliases)] + pub unsafe fn resolvesAliases(&self) -> bool; + + #[method(setResolvesAliases:)] + pub unsafe fn setResolvesAliases(&self, resolvesAliases: bool); + + #[method(canChooseDirectories)] + pub unsafe fn canChooseDirectories(&self) -> bool; + + #[method(setCanChooseDirectories:)] + pub unsafe fn setCanChooseDirectories(&self, canChooseDirectories: bool); + + #[method(allowsMultipleSelection)] + pub unsafe fn allowsMultipleSelection(&self) -> bool; + + #[method(setAllowsMultipleSelection:)] + pub unsafe fn setAllowsMultipleSelection(&self, allowsMultipleSelection: bool); + + #[method(canChooseFiles)] + pub unsafe fn canChooseFiles(&self) -> bool; + + #[method(setCanChooseFiles:)] + pub unsafe fn setCanChooseFiles(&self, canChooseFiles: bool); + + #[method(canResolveUbiquitousConflicts)] + pub unsafe fn canResolveUbiquitousConflicts(&self) -> bool; + + #[method(setCanResolveUbiquitousConflicts:)] + pub unsafe fn setCanResolveUbiquitousConflicts(&self, canResolveUbiquitousConflicts: bool); + + #[method(canDownloadUbiquitousContents)] + pub unsafe fn canDownloadUbiquitousContents(&self) -> bool; + + #[method(setCanDownloadUbiquitousContents:)] + pub unsafe fn setCanDownloadUbiquitousContents(&self, canDownloadUbiquitousContents: bool); + + #[method(isAccessoryViewDisclosed)] + pub unsafe fn isAccessoryViewDisclosed(&self) -> bool; + + #[method(setAccessoryViewDisclosed:)] + pub unsafe fn setAccessoryViewDisclosed(&self, accessoryViewDisclosed: bool); + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSOpenPanel { + #[method_id(@__retain_semantics Other filenames)] + pub unsafe fn filenames(&self) -> Id; + + #[method(beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:)] + pub unsafe fn beginSheetForDirectory_file_types_modalForWindow_modalDelegate_didEndSelector_contextInfo( + &self, + path: Option<&NSString>, + name: Option<&NSString>, + fileTypes: Option<&NSArray>, + docWindow: Option<&NSWindow>, + delegate: Option<&Object>, + didEndSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(beginForDirectory:file:types:modelessDelegate:didEndSelector:contextInfo:)] + pub unsafe fn beginForDirectory_file_types_modelessDelegate_didEndSelector_contextInfo( + &self, + path: Option<&NSString>, + name: Option<&NSString>, + fileTypes: Option<&NSArray>, + delegate: Option<&Object>, + didEndSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(runModalForDirectory:file:types:)] + pub unsafe fn runModalForDirectory_file_types( + &self, + path: Option<&NSString>, + name: Option<&NSString>, + fileTypes: Option<&NSArray>, + ) -> NSInteger; + + #[method(runModalForTypes:)] + pub unsafe fn runModalForTypes(&self, fileTypes: Option<&NSArray>) -> NSInteger; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSOutlineView.rs b/crates/icrate/src/generated/AppKit/NSOutlineView.rs new file mode 100644 index 000000000..d8a2169d1 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSOutlineView.rs @@ -0,0 +1,648 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_enum!( + #[underlying(c_int)] + pub enum { + NSOutlineViewDropOnItemIndex = -1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSOutlineView; + + unsafe impl ClassType for NSOutlineView { + type Super = NSTableView; + } +); + +extern_methods!( + unsafe impl NSOutlineView { + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSOutlineViewDelegate>); + + #[method_id(@__retain_semantics Other dataSource)] + pub unsafe fn dataSource(&self) -> Option>; + + #[method(setDataSource:)] + pub unsafe fn setDataSource(&self, dataSource: Option<&NSOutlineViewDataSource>); + + #[method_id(@__retain_semantics Other outlineTableColumn)] + pub unsafe fn outlineTableColumn(&self) -> Option>; + + #[method(setOutlineTableColumn:)] + pub unsafe fn setOutlineTableColumn(&self, outlineTableColumn: Option<&NSTableColumn>); + + #[method(isExpandable:)] + pub unsafe fn isExpandable(&self, item: Option<&Object>) -> bool; + + #[method(numberOfChildrenOfItem:)] + pub unsafe fn numberOfChildrenOfItem(&self, item: Option<&Object>) -> NSInteger; + + #[method_id(@__retain_semantics Other child:ofItem:)] + pub unsafe fn child_ofItem( + &self, + index: NSInteger, + item: Option<&Object>, + ) -> Option>; + + #[method(expandItem:expandChildren:)] + pub unsafe fn expandItem_expandChildren(&self, item: Option<&Object>, expandChildren: bool); + + #[method(expandItem:)] + pub unsafe fn expandItem(&self, item: Option<&Object>); + + #[method(collapseItem:collapseChildren:)] + pub unsafe fn collapseItem_collapseChildren( + &self, + item: Option<&Object>, + collapseChildren: bool, + ); + + #[method(collapseItem:)] + pub unsafe fn collapseItem(&self, item: Option<&Object>); + + #[method(reloadItem:reloadChildren:)] + pub unsafe fn reloadItem_reloadChildren(&self, item: Option<&Object>, reloadChildren: bool); + + #[method(reloadItem:)] + pub unsafe fn reloadItem(&self, item: Option<&Object>); + + #[method_id(@__retain_semantics Other parentForItem:)] + pub unsafe fn parentForItem(&self, item: Option<&Object>) -> Option>; + + #[method(childIndexForItem:)] + pub unsafe fn childIndexForItem(&self, item: &Object) -> NSInteger; + + #[method_id(@__retain_semantics Other itemAtRow:)] + pub unsafe fn itemAtRow(&self, row: NSInteger) -> Option>; + + #[method(rowForItem:)] + pub unsafe fn rowForItem(&self, item: Option<&Object>) -> NSInteger; + + #[method(levelForItem:)] + pub unsafe fn levelForItem(&self, item: Option<&Object>) -> NSInteger; + + #[method(levelForRow:)] + pub unsafe fn levelForRow(&self, row: NSInteger) -> NSInteger; + + #[method(isItemExpanded:)] + pub unsafe fn isItemExpanded(&self, item: Option<&Object>) -> bool; + + #[method(indentationPerLevel)] + pub unsafe fn indentationPerLevel(&self) -> CGFloat; + + #[method(setIndentationPerLevel:)] + pub unsafe fn setIndentationPerLevel(&self, indentationPerLevel: CGFloat); + + #[method(indentationMarkerFollowsCell)] + pub unsafe fn indentationMarkerFollowsCell(&self) -> bool; + + #[method(setIndentationMarkerFollowsCell:)] + pub unsafe fn setIndentationMarkerFollowsCell(&self, indentationMarkerFollowsCell: bool); + + #[method(autoresizesOutlineColumn)] + pub unsafe fn autoresizesOutlineColumn(&self) -> bool; + + #[method(setAutoresizesOutlineColumn:)] + pub unsafe fn setAutoresizesOutlineColumn(&self, autoresizesOutlineColumn: bool); + + #[method(frameOfOutlineCellAtRow:)] + pub unsafe fn frameOfOutlineCellAtRow(&self, row: NSInteger) -> NSRect; + + #[method(setDropItem:dropChildIndex:)] + pub unsafe fn setDropItem_dropChildIndex(&self, item: Option<&Object>, index: NSInteger); + + #[method(shouldCollapseAutoExpandedItemsForDeposited:)] + pub unsafe fn shouldCollapseAutoExpandedItemsForDeposited(&self, deposited: bool) -> bool; + + #[method(autosaveExpandedItems)] + pub unsafe fn autosaveExpandedItems(&self) -> bool; + + #[method(setAutosaveExpandedItems:)] + pub unsafe fn setAutosaveExpandedItems(&self, autosaveExpandedItems: bool); + + #[method(insertItemsAtIndexes:inParent:withAnimation:)] + pub unsafe fn insertItemsAtIndexes_inParent_withAnimation( + &self, + indexes: &NSIndexSet, + parent: Option<&Object>, + animationOptions: NSTableViewAnimationOptions, + ); + + #[method(removeItemsAtIndexes:inParent:withAnimation:)] + pub unsafe fn removeItemsAtIndexes_inParent_withAnimation( + &self, + indexes: &NSIndexSet, + parent: Option<&Object>, + animationOptions: NSTableViewAnimationOptions, + ); + + #[method(moveItemAtIndex:inParent:toIndex:inParent:)] + pub unsafe fn moveItemAtIndex_inParent_toIndex_inParent( + &self, + fromIndex: NSInteger, + oldParent: Option<&Object>, + toIndex: NSInteger, + newParent: Option<&Object>, + ); + + #[method(insertRowsAtIndexes:withAnimation:)] + pub unsafe fn insertRowsAtIndexes_withAnimation( + &self, + indexes: &NSIndexSet, + animationOptions: NSTableViewAnimationOptions, + ); + + #[method(removeRowsAtIndexes:withAnimation:)] + pub unsafe fn removeRowsAtIndexes_withAnimation( + &self, + indexes: &NSIndexSet, + animationOptions: NSTableViewAnimationOptions, + ); + + #[method(moveRowAtIndex:toIndex:)] + pub unsafe fn moveRowAtIndex_toIndex(&self, oldIndex: NSInteger, newIndex: NSInteger); + + #[method(userInterfaceLayoutDirection)] + pub unsafe fn userInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection; + + #[method(setUserInterfaceLayoutDirection:)] + pub unsafe fn setUserInterfaceLayoutDirection( + &self, + userInterfaceLayoutDirection: NSUserInterfaceLayoutDirection, + ); + + #[method(stronglyReferencesItems)] + pub unsafe fn stronglyReferencesItems(&self) -> bool; + + #[method(setStronglyReferencesItems:)] + pub unsafe fn setStronglyReferencesItems(&self, stronglyReferencesItems: bool); + } +); + +extern_protocol!( + pub struct NSOutlineViewDataSource; + + unsafe impl NSOutlineViewDataSource { + #[optional] + #[method(outlineView:numberOfChildrenOfItem:)] + pub unsafe fn outlineView_numberOfChildrenOfItem( + &self, + outlineView: &NSOutlineView, + item: Option<&Object>, + ) -> NSInteger; + + #[optional] + #[method_id(@__retain_semantics Other outlineView:child:ofItem:)] + pub unsafe fn outlineView_child_ofItem( + &self, + outlineView: &NSOutlineView, + index: NSInteger, + item: Option<&Object>, + ) -> Id; + + #[optional] + #[method(outlineView:isItemExpandable:)] + pub unsafe fn outlineView_isItemExpandable( + &self, + outlineView: &NSOutlineView, + item: &Object, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other outlineView:objectValueForTableColumn:byItem:)] + pub unsafe fn outlineView_objectValueForTableColumn_byItem( + &self, + outlineView: &NSOutlineView, + tableColumn: Option<&NSTableColumn>, + item: Option<&Object>, + ) -> Option>; + + #[optional] + #[method(outlineView:setObjectValue:forTableColumn:byItem:)] + pub unsafe fn outlineView_setObjectValue_forTableColumn_byItem( + &self, + outlineView: &NSOutlineView, + object: Option<&Object>, + tableColumn: Option<&NSTableColumn>, + item: Option<&Object>, + ); + + #[optional] + #[method_id(@__retain_semantics Other outlineView:itemForPersistentObject:)] + pub unsafe fn outlineView_itemForPersistentObject( + &self, + outlineView: &NSOutlineView, + object: &Object, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other outlineView:persistentObjectForItem:)] + pub unsafe fn outlineView_persistentObjectForItem( + &self, + outlineView: &NSOutlineView, + item: Option<&Object>, + ) -> Option>; + + #[optional] + #[method(outlineView:sortDescriptorsDidChange:)] + pub unsafe fn outlineView_sortDescriptorsDidChange( + &self, + outlineView: &NSOutlineView, + oldDescriptors: &NSArray, + ); + + #[optional] + #[method_id(@__retain_semantics Other outlineView:pasteboardWriterForItem:)] + pub unsafe fn outlineView_pasteboardWriterForItem( + &self, + outlineView: &NSOutlineView, + item: &Object, + ) -> Option>; + + #[optional] + #[method(outlineView:draggingSession:willBeginAtPoint:forItems:)] + pub unsafe fn outlineView_draggingSession_willBeginAtPoint_forItems( + &self, + outlineView: &NSOutlineView, + session: &NSDraggingSession, + screenPoint: NSPoint, + draggedItems: &NSArray, + ); + + #[optional] + #[method(outlineView:draggingSession:endedAtPoint:operation:)] + pub unsafe fn outlineView_draggingSession_endedAtPoint_operation( + &self, + outlineView: &NSOutlineView, + session: &NSDraggingSession, + screenPoint: NSPoint, + operation: NSDragOperation, + ); + + #[optional] + #[method(outlineView:writeItems:toPasteboard:)] + pub unsafe fn outlineView_writeItems_toPasteboard( + &self, + outlineView: &NSOutlineView, + items: &NSArray, + pasteboard: &NSPasteboard, + ) -> bool; + + #[optional] + #[method(outlineView:updateDraggingItemsForDrag:)] + pub unsafe fn outlineView_updateDraggingItemsForDrag( + &self, + outlineView: &NSOutlineView, + draggingInfo: &NSDraggingInfo, + ); + + #[optional] + #[method(outlineView:validateDrop:proposedItem:proposedChildIndex:)] + pub unsafe fn outlineView_validateDrop_proposedItem_proposedChildIndex( + &self, + outlineView: &NSOutlineView, + info: &NSDraggingInfo, + item: Option<&Object>, + index: NSInteger, + ) -> NSDragOperation; + + #[optional] + #[method(outlineView:acceptDrop:item:childIndex:)] + pub unsafe fn outlineView_acceptDrop_item_childIndex( + &self, + outlineView: &NSOutlineView, + info: &NSDraggingInfo, + item: Option<&Object>, + index: NSInteger, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:)] + pub unsafe fn outlineView_namesOfPromisedFilesDroppedAtDestination_forDraggedItems( + &self, + outlineView: &NSOutlineView, + dropDestination: &NSURL, + items: &NSArray, + ) -> Id, Shared>; + } +); + +extern_protocol!( + pub struct NSOutlineViewDelegate; + + unsafe impl NSOutlineViewDelegate { + #[optional] + #[method_id(@__retain_semantics Other outlineView:viewForTableColumn:item:)] + pub unsafe fn outlineView_viewForTableColumn_item( + &self, + outlineView: &NSOutlineView, + tableColumn: Option<&NSTableColumn>, + item: &Object, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other outlineView:rowViewForItem:)] + pub unsafe fn outlineView_rowViewForItem( + &self, + outlineView: &NSOutlineView, + item: &Object, + ) -> Option>; + + #[optional] + #[method(outlineView:didAddRowView:forRow:)] + pub unsafe fn outlineView_didAddRowView_forRow( + &self, + outlineView: &NSOutlineView, + rowView: &NSTableRowView, + row: NSInteger, + ); + + #[optional] + #[method(outlineView:didRemoveRowView:forRow:)] + pub unsafe fn outlineView_didRemoveRowView_forRow( + &self, + outlineView: &NSOutlineView, + rowView: &NSTableRowView, + row: NSInteger, + ); + + #[optional] + #[method(outlineView:willDisplayCell:forTableColumn:item:)] + pub unsafe fn outlineView_willDisplayCell_forTableColumn_item( + &self, + outlineView: &NSOutlineView, + cell: &Object, + tableColumn: Option<&NSTableColumn>, + item: &Object, + ); + + #[optional] + #[method(outlineView:shouldEditTableColumn:item:)] + pub unsafe fn outlineView_shouldEditTableColumn_item( + &self, + outlineView: &NSOutlineView, + tableColumn: Option<&NSTableColumn>, + item: &Object, + ) -> bool; + + #[optional] + #[method(selectionShouldChangeInOutlineView:)] + pub unsafe fn selectionShouldChangeInOutlineView( + &self, + outlineView: &NSOutlineView, + ) -> bool; + + #[optional] + #[method(outlineView:shouldSelectItem:)] + pub unsafe fn outlineView_shouldSelectItem( + &self, + outlineView: &NSOutlineView, + item: &Object, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other outlineView:selectionIndexesForProposedSelection:)] + pub unsafe fn outlineView_selectionIndexesForProposedSelection( + &self, + outlineView: &NSOutlineView, + proposedSelectionIndexes: &NSIndexSet, + ) -> Id; + + #[optional] + #[method(outlineView:shouldSelectTableColumn:)] + pub unsafe fn outlineView_shouldSelectTableColumn( + &self, + outlineView: &NSOutlineView, + tableColumn: Option<&NSTableColumn>, + ) -> bool; + + #[optional] + #[method(outlineView:mouseDownInHeaderOfTableColumn:)] + pub unsafe fn outlineView_mouseDownInHeaderOfTableColumn( + &self, + outlineView: &NSOutlineView, + tableColumn: &NSTableColumn, + ); + + #[optional] + #[method(outlineView:didClickTableColumn:)] + pub unsafe fn outlineView_didClickTableColumn( + &self, + outlineView: &NSOutlineView, + tableColumn: &NSTableColumn, + ); + + #[optional] + #[method(outlineView:didDragTableColumn:)] + pub unsafe fn outlineView_didDragTableColumn( + &self, + outlineView: &NSOutlineView, + tableColumn: &NSTableColumn, + ); + + #[optional] + #[method_id(@__retain_semantics Other outlineView:toolTipForCell:rect:tableColumn:item:mouseLocation:)] + pub unsafe fn outlineView_toolTipForCell_rect_tableColumn_item_mouseLocation( + &self, + outlineView: &NSOutlineView, + cell: &NSCell, + rect: NSRectPointer, + tableColumn: Option<&NSTableColumn>, + item: &Object, + mouseLocation: NSPoint, + ) -> Id; + + #[optional] + #[method(outlineView:heightOfRowByItem:)] + pub unsafe fn outlineView_heightOfRowByItem( + &self, + outlineView: &NSOutlineView, + item: &Object, + ) -> CGFloat; + + #[optional] + #[method_id(@__retain_semantics Other outlineView:tintConfigurationForItem:)] + pub unsafe fn outlineView_tintConfigurationForItem( + &self, + outlineView: &NSOutlineView, + item: &Object, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other outlineView:typeSelectStringForTableColumn:item:)] + pub unsafe fn outlineView_typeSelectStringForTableColumn_item( + &self, + outlineView: &NSOutlineView, + tableColumn: Option<&NSTableColumn>, + item: &Object, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other outlineView:nextTypeSelectMatchFromItem:toItem:forString:)] + pub unsafe fn outlineView_nextTypeSelectMatchFromItem_toItem_forString( + &self, + outlineView: &NSOutlineView, + startItem: &Object, + endItem: &Object, + searchString: &NSString, + ) -> Option>; + + #[optional] + #[method(outlineView:shouldTypeSelectForEvent:withCurrentSearchString:)] + pub unsafe fn outlineView_shouldTypeSelectForEvent_withCurrentSearchString( + &self, + outlineView: &NSOutlineView, + event: &NSEvent, + searchString: Option<&NSString>, + ) -> bool; + + #[optional] + #[method(outlineView:shouldShowCellExpansionForTableColumn:item:)] + pub unsafe fn outlineView_shouldShowCellExpansionForTableColumn_item( + &self, + outlineView: &NSOutlineView, + tableColumn: Option<&NSTableColumn>, + item: &Object, + ) -> bool; + + #[optional] + #[method(outlineView:shouldTrackCell:forTableColumn:item:)] + pub unsafe fn outlineView_shouldTrackCell_forTableColumn_item( + &self, + outlineView: &NSOutlineView, + cell: &NSCell, + tableColumn: Option<&NSTableColumn>, + item: &Object, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other outlineView:dataCellForTableColumn:item:)] + pub unsafe fn outlineView_dataCellForTableColumn_item( + &self, + outlineView: &NSOutlineView, + tableColumn: Option<&NSTableColumn>, + item: &Object, + ) -> Option>; + + #[optional] + #[method(outlineView:isGroupItem:)] + pub unsafe fn outlineView_isGroupItem( + &self, + outlineView: &NSOutlineView, + item: &Object, + ) -> bool; + + #[optional] + #[method(outlineView:shouldExpandItem:)] + pub unsafe fn outlineView_shouldExpandItem( + &self, + outlineView: &NSOutlineView, + item: &Object, + ) -> bool; + + #[optional] + #[method(outlineView:shouldCollapseItem:)] + pub unsafe fn outlineView_shouldCollapseItem( + &self, + outlineView: &NSOutlineView, + item: &Object, + ) -> bool; + + #[optional] + #[method(outlineView:willDisplayOutlineCell:forTableColumn:item:)] + pub unsafe fn outlineView_willDisplayOutlineCell_forTableColumn_item( + &self, + outlineView: &NSOutlineView, + cell: &Object, + tableColumn: Option<&NSTableColumn>, + item: &Object, + ); + + #[optional] + #[method(outlineView:sizeToFitWidthOfColumn:)] + pub unsafe fn outlineView_sizeToFitWidthOfColumn( + &self, + outlineView: &NSOutlineView, + column: NSInteger, + ) -> CGFloat; + + #[optional] + #[method(outlineView:shouldReorderColumn:toColumn:)] + pub unsafe fn outlineView_shouldReorderColumn_toColumn( + &self, + outlineView: &NSOutlineView, + columnIndex: NSInteger, + newColumnIndex: NSInteger, + ) -> bool; + + #[optional] + #[method(outlineView:shouldShowOutlineCellForItem:)] + pub unsafe fn outlineView_shouldShowOutlineCellForItem( + &self, + outlineView: &NSOutlineView, + item: &Object, + ) -> bool; + + #[optional] + #[method(outlineViewSelectionDidChange:)] + pub unsafe fn outlineViewSelectionDidChange(&self, notification: &NSNotification); + + #[optional] + #[method(outlineViewColumnDidMove:)] + pub unsafe fn outlineViewColumnDidMove(&self, notification: &NSNotification); + + #[optional] + #[method(outlineViewColumnDidResize:)] + pub unsafe fn outlineViewColumnDidResize(&self, notification: &NSNotification); + + #[optional] + #[method(outlineViewSelectionIsChanging:)] + pub unsafe fn outlineViewSelectionIsChanging(&self, notification: &NSNotification); + + #[optional] + #[method(outlineViewItemWillExpand:)] + pub unsafe fn outlineViewItemWillExpand(&self, notification: &NSNotification); + + #[optional] + #[method(outlineViewItemDidExpand:)] + pub unsafe fn outlineViewItemDidExpand(&self, notification: &NSNotification); + + #[optional] + #[method(outlineViewItemWillCollapse:)] + pub unsafe fn outlineViewItemWillCollapse(&self, notification: &NSNotification); + + #[optional] + #[method(outlineViewItemDidCollapse:)] + pub unsafe fn outlineViewItemDidCollapse(&self, notification: &NSNotification); + } +); + +extern_static!(NSOutlineViewDisclosureButtonKey: &'static NSUserInterfaceItemIdentifier); + +extern_static!(NSOutlineViewShowHideButtonKey: &'static NSUserInterfaceItemIdentifier); + +extern_static!(NSOutlineViewSelectionDidChangeNotification: &'static NSNotificationName); + +extern_static!(NSOutlineViewColumnDidMoveNotification: &'static NSNotificationName); + +extern_static!(NSOutlineViewColumnDidResizeNotification: &'static NSNotificationName); + +extern_static!(NSOutlineViewSelectionIsChangingNotification: &'static NSNotificationName); + +extern_static!(NSOutlineViewItemWillExpandNotification: &'static NSNotificationName); + +extern_static!(NSOutlineViewItemDidExpandNotification: &'static NSNotificationName); + +extern_static!(NSOutlineViewItemWillCollapseNotification: &'static NSNotificationName); + +extern_static!(NSOutlineViewItemDidCollapseNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/AppKit/NSPDFImageRep.rs b/crates/icrate/src/generated/AppKit/NSPDFImageRep.rs new file mode 100644 index 000000000..163983b32 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPDFImageRep.rs @@ -0,0 +1,43 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPDFImageRep; + + unsafe impl ClassType for NSPDFImageRep { + type Super = NSImageRep; + } +); + +extern_methods!( + unsafe impl NSPDFImageRep { + #[method_id(@__retain_semantics Other imageRepWithData:)] + pub unsafe fn imageRepWithData(pdfData: &NSData) -> Option>; + + #[method_id(@__retain_semantics Init initWithData:)] + pub unsafe fn initWithData( + this: Option>, + pdfData: &NSData, + ) -> Option>; + + #[method_id(@__retain_semantics Other PDFRepresentation)] + pub unsafe fn PDFRepresentation(&self) -> Id; + + #[method(bounds)] + pub unsafe fn bounds(&self) -> NSRect; + + #[method(currentPage)] + pub unsafe fn currentPage(&self) -> NSInteger; + + #[method(setCurrentPage:)] + pub unsafe fn setCurrentPage(&self, currentPage: NSInteger); + + #[method(pageCount)] + pub unsafe fn pageCount(&self) -> NSInteger; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPDFInfo.rs b/crates/icrate/src/generated/AppKit/NSPDFInfo.rs new file mode 100644 index 000000000..8de36b399 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPDFInfo.rs @@ -0,0 +1,54 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPDFInfo; + + unsafe impl ClassType for NSPDFInfo { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPDFInfo { + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + + #[method(setURL:)] + pub unsafe fn setURL(&self, URL: Option<&NSURL>); + + #[method(isFileExtensionHidden)] + pub unsafe fn isFileExtensionHidden(&self) -> bool; + + #[method(setFileExtensionHidden:)] + pub unsafe fn setFileExtensionHidden(&self, fileExtensionHidden: bool); + + #[method_id(@__retain_semantics Other tagNames)] + pub unsafe fn tagNames(&self) -> Id, Shared>; + + #[method(setTagNames:)] + pub unsafe fn setTagNames(&self, tagNames: &NSArray); + + #[method(orientation)] + pub unsafe fn orientation(&self) -> NSPaperOrientation; + + #[method(setOrientation:)] + pub unsafe fn setOrientation(&self, orientation: NSPaperOrientation); + + #[method(paperSize)] + pub unsafe fn paperSize(&self) -> NSSize; + + #[method(setPaperSize:)] + pub unsafe fn setPaperSize(&self, paperSize: NSSize); + + #[method_id(@__retain_semantics Other attributes)] + pub unsafe fn attributes( + &self, + ) -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPDFPanel.rs b/crates/icrate/src/generated/AppKit/NSPDFPanel.rs new file mode 100644 index 000000000..5d05763ca --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPDFPanel.rs @@ -0,0 +1,57 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSInteger)] + pub enum NSPDFPanelOptions { + NSPDFPanelShowsPaperSize = 1 << 2, + NSPDFPanelShowsOrientation = 1 << 3, + NSPDFPanelRequestsParentDirectory = 1 << 24, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPDFPanel; + + unsafe impl ClassType for NSPDFPanel { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPDFPanel { + #[method_id(@__retain_semantics Other panel)] + pub unsafe fn panel() -> Id; + + #[method_id(@__retain_semantics Other accessoryController)] + pub unsafe fn accessoryController(&self) -> Option>; + + #[method(setAccessoryController:)] + pub unsafe fn setAccessoryController(&self, accessoryController: Option<&NSViewController>); + + #[method(options)] + pub unsafe fn options(&self) -> NSPDFPanelOptions; + + #[method(setOptions:)] + pub unsafe fn setOptions(&self, options: NSPDFPanelOptions); + + #[method_id(@__retain_semantics Other defaultFileName)] + pub unsafe fn defaultFileName(&self) -> Id; + + #[method(setDefaultFileName:)] + pub unsafe fn setDefaultFileName(&self, defaultFileName: &NSString); + + #[method(beginSheetWithPDFInfo:modalForWindow:completionHandler:)] + pub unsafe fn beginSheetWithPDFInfo_modalForWindow_completionHandler( + &self, + pdfInfo: &NSPDFInfo, + docWindow: Option<&NSWindow>, + completionHandler: &Block<(NSInteger,), ()>, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPICTImageRep.rs b/crates/icrate/src/generated/AppKit/NSPICTImageRep.rs new file mode 100644 index 000000000..f77e63f72 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPICTImageRep.rs @@ -0,0 +1,34 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPICTImageRep; + + unsafe impl ClassType for NSPICTImageRep { + type Super = NSImageRep; + } +); + +extern_methods!( + unsafe impl NSPICTImageRep { + #[method_id(@__retain_semantics Other imageRepWithData:)] + pub unsafe fn imageRepWithData(pictData: &NSData) -> Option>; + + #[method_id(@__retain_semantics Init initWithData:)] + pub unsafe fn initWithData( + this: Option>, + pictData: &NSData, + ) -> Option>; + + #[method_id(@__retain_semantics Other PICTRepresentation)] + pub unsafe fn PICTRepresentation(&self) -> Id; + + #[method(boundingBox)] + pub unsafe fn boundingBox(&self) -> NSRect; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPageController.rs b/crates/icrate/src/generated/AppKit/NSPageController.rs new file mode 100644 index 000000000..184482485 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPageController.rs @@ -0,0 +1,130 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSPageControllerObjectIdentifier = NSString; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPageControllerTransitionStyle { + NSPageControllerTransitionStyleStackHistory = 0, + NSPageControllerTransitionStyleStackBook = 1, + NSPageControllerTransitionStyleHorizontalStrip = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPageController; + + unsafe impl ClassType for NSPageController { + type Super = NSViewController; + } +); + +extern_methods!( + unsafe impl NSPageController { + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSPageControllerDelegate>); + + #[method_id(@__retain_semantics Other selectedViewController)] + pub unsafe fn selectedViewController(&self) -> Option>; + + #[method(transitionStyle)] + pub unsafe fn transitionStyle(&self) -> NSPageControllerTransitionStyle; + + #[method(setTransitionStyle:)] + pub unsafe fn setTransitionStyle(&self, transitionStyle: NSPageControllerTransitionStyle); + + #[method_id(@__retain_semantics Other arrangedObjects)] + pub unsafe fn arrangedObjects(&self) -> Id; + + #[method(setArrangedObjects:)] + pub unsafe fn setArrangedObjects(&self, arrangedObjects: &NSArray); + + #[method(selectedIndex)] + pub unsafe fn selectedIndex(&self) -> NSInteger; + + #[method(setSelectedIndex:)] + pub unsafe fn setSelectedIndex(&self, selectedIndex: NSInteger); + + #[method(navigateForwardToObject:)] + pub unsafe fn navigateForwardToObject(&self, object: &Object); + + #[method(completeTransition)] + pub unsafe fn completeTransition(&self); + + #[method(navigateBack:)] + pub unsafe fn navigateBack(&self, sender: Option<&Object>); + + #[method(navigateForward:)] + pub unsafe fn navigateForward(&self, sender: Option<&Object>); + + #[method(takeSelectedIndexFrom:)] + pub unsafe fn takeSelectedIndexFrom(&self, sender: Option<&Object>); + } +); + +extern_protocol!( + pub struct NSPageControllerDelegate; + + unsafe impl NSPageControllerDelegate { + #[optional] + #[method_id(@__retain_semantics Other pageController:identifierForObject:)] + pub unsafe fn pageController_identifierForObject( + &self, + pageController: &NSPageController, + object: &Object, + ) -> Id; + + #[optional] + #[method_id(@__retain_semantics Other pageController:viewControllerForIdentifier:)] + pub unsafe fn pageController_viewControllerForIdentifier( + &self, + pageController: &NSPageController, + identifier: &NSPageControllerObjectIdentifier, + ) -> Id; + + #[optional] + #[method(pageController:frameForObject:)] + pub unsafe fn pageController_frameForObject( + &self, + pageController: &NSPageController, + object: Option<&Object>, + ) -> NSRect; + + #[optional] + #[method(pageController:prepareViewController:withObject:)] + pub unsafe fn pageController_prepareViewController_withObject( + &self, + pageController: &NSPageController, + viewController: &NSViewController, + object: Option<&Object>, + ); + + #[optional] + #[method(pageController:didTransitionToObject:)] + pub unsafe fn pageController_didTransitionToObject( + &self, + pageController: &NSPageController, + object: &Object, + ); + + #[optional] + #[method(pageControllerWillStartLiveTransition:)] + pub unsafe fn pageControllerWillStartLiveTransition( + &self, + pageController: &NSPageController, + ); + + #[optional] + #[method(pageControllerDidEndLiveTransition:)] + pub unsafe fn pageControllerDidEndLiveTransition(&self, pageController: &NSPageController); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPageLayout.rs b/crates/icrate/src/generated/AppKit/NSPageLayout.rs new file mode 100644 index 000000000..287e79b9c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPageLayout.rs @@ -0,0 +1,75 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPageLayout; + + unsafe impl ClassType for NSPageLayout { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPageLayout { + #[method_id(@__retain_semantics Other pageLayout)] + pub unsafe fn pageLayout() -> Id; + + #[method(addAccessoryController:)] + pub unsafe fn addAccessoryController(&self, accessoryController: &NSViewController); + + #[method(removeAccessoryController:)] + pub unsafe fn removeAccessoryController(&self, accessoryController: &NSViewController); + + #[method_id(@__retain_semantics Other accessoryControllers)] + pub unsafe fn accessoryControllers(&self) -> Id, Shared>; + + #[method(beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:)] + pub unsafe fn beginSheetWithPrintInfo_modalForWindow_delegate_didEndSelector_contextInfo( + &self, + printInfo: &NSPrintInfo, + docWindow: &NSWindow, + delegate: Option<&Object>, + didEndSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(runModalWithPrintInfo:)] + pub unsafe fn runModalWithPrintInfo(&self, printInfo: &NSPrintInfo) -> NSInteger; + + #[method(runModal)] + pub unsafe fn runModal(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other printInfo)] + pub unsafe fn printInfo(&self) -> Option>; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSPageLayout { + #[method(setAccessoryView:)] + pub unsafe fn setAccessoryView(&self, accessoryView: Option<&NSView>); + + #[method_id(@__retain_semantics Other accessoryView)] + pub unsafe fn accessoryView(&self) -> Option>; + + #[method(readPrintInfo)] + pub unsafe fn readPrintInfo(&self); + + #[method(writePrintInfo)] + pub unsafe fn writePrintInfo(&self); + } +); + +extern_methods!( + /// NSPageLayoutPanel + unsafe impl NSApplication { + #[method(runPageLayout:)] + pub unsafe fn runPageLayout(&self, sender: Option<&Object>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPanGestureRecognizer.rs b/crates/icrate/src/generated/AppKit/NSPanGestureRecognizer.rs new file mode 100644 index 000000000..4671b6e98 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPanGestureRecognizer.rs @@ -0,0 +1,40 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPanGestureRecognizer; + + unsafe impl ClassType for NSPanGestureRecognizer { + type Super = NSGestureRecognizer; + } +); + +extern_methods!( + unsafe impl NSPanGestureRecognizer { + #[method(buttonMask)] + pub unsafe fn buttonMask(&self) -> NSUInteger; + + #[method(setButtonMask:)] + pub unsafe fn setButtonMask(&self, buttonMask: NSUInteger); + + #[method(translationInView:)] + pub unsafe fn translationInView(&self, view: Option<&NSView>) -> NSPoint; + + #[method(setTranslation:inView:)] + pub unsafe fn setTranslation_inView(&self, translation: NSPoint, view: Option<&NSView>); + + #[method(velocityInView:)] + pub unsafe fn velocityInView(&self, view: Option<&NSView>) -> NSPoint; + + #[method(numberOfTouchesRequired)] + pub unsafe fn numberOfTouchesRequired(&self) -> NSInteger; + + #[method(setNumberOfTouchesRequired:)] + pub unsafe fn setNumberOfTouchesRequired(&self, numberOfTouchesRequired: NSInteger); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPanel.rs b/crates/icrate/src/generated/AppKit/NSPanel.rs new file mode 100644 index 000000000..9e25e84b1 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPanel.rs @@ -0,0 +1,57 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPanel; + + unsafe impl ClassType for NSPanel { + type Super = NSWindow; + } +); + +extern_methods!( + unsafe impl NSPanel { + #[method(isFloatingPanel)] + pub unsafe fn isFloatingPanel(&self) -> bool; + + #[method(setFloatingPanel:)] + pub unsafe fn setFloatingPanel(&self, floatingPanel: bool); + + #[method(becomesKeyOnlyIfNeeded)] + pub unsafe fn becomesKeyOnlyIfNeeded(&self) -> bool; + + #[method(setBecomesKeyOnlyIfNeeded:)] + pub unsafe fn setBecomesKeyOnlyIfNeeded(&self, becomesKeyOnlyIfNeeded: bool); + + #[method(worksWhenModal)] + pub unsafe fn worksWhenModal(&self) -> bool; + + #[method(setWorksWhenModal:)] + pub unsafe fn setWorksWhenModal(&self, worksWhenModal: bool); + } +); + +extern_fn!( + pub unsafe fn NSReleaseAlertPanel(panel: Option<&Object>); +); + +extern_enum!( + #[underlying(c_int)] + pub enum { + NSAlertDefaultReturn = 1, + NSAlertAlternateReturn = 0, + NSAlertOtherReturn = -1, + NSAlertErrorReturn = -2, + } +); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + } +); diff --git a/crates/icrate/src/generated/AppKit/NSParagraphStyle.rs b/crates/icrate/src/generated/AppKit/NSParagraphStyle.rs new file mode 100644 index 000000000..7bd38f9c6 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSParagraphStyle.rs @@ -0,0 +1,339 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSLineBreakMode { + NSLineBreakByWordWrapping = 0, + NSLineBreakByCharWrapping = 1, + NSLineBreakByClipping = 2, + NSLineBreakByTruncatingHead = 3, + NSLineBreakByTruncatingTail = 4, + NSLineBreakByTruncatingMiddle = 5, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSLineBreakStrategy { + NSLineBreakStrategyNone = 0, + NSLineBreakStrategyPushOut = 1 << 0, + NSLineBreakStrategyHangulWordPriority = 1 << 1, + NSLineBreakStrategyStandard = 0xFFFF, + } +); + +pub type NSTextTabOptionKey = NSString; + +extern_static!(NSTabColumnTerminatorsAttributeName: &'static NSTextTabOptionKey); + +extern_class!( + #[derive(Debug)] + pub struct NSTextTab; + + unsafe impl ClassType for NSTextTab { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextTab { + #[method_id(@__retain_semantics Other columnTerminatorsForLocale:)] + pub unsafe fn columnTerminatorsForLocale( + aLocale: Option<&NSLocale>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithTextAlignment:location:options:)] + pub unsafe fn initWithTextAlignment_location_options( + this: Option>, + alignment: NSTextAlignment, + loc: CGFloat, + options: &NSDictionary, + ) -> Id; + + #[method(alignment)] + pub unsafe fn alignment(&self) -> NSTextAlignment; + + #[method(location)] + pub unsafe fn location(&self) -> CGFloat; + + #[method_id(@__retain_semantics Other options)] + pub unsafe fn options(&self) -> Id, Shared>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSParagraphStyle; + + unsafe impl ClassType for NSParagraphStyle { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSParagraphStyle { + #[method_id(@__retain_semantics Other defaultParagraphStyle)] + pub unsafe fn defaultParagraphStyle() -> Id; + + #[method(defaultWritingDirectionForLanguage:)] + pub unsafe fn defaultWritingDirectionForLanguage( + languageName: Option<&NSString>, + ) -> NSWritingDirection; + + #[method(lineSpacing)] + pub unsafe fn lineSpacing(&self) -> CGFloat; + + #[method(paragraphSpacing)] + pub unsafe fn paragraphSpacing(&self) -> CGFloat; + + #[method(alignment)] + pub unsafe fn alignment(&self) -> NSTextAlignment; + + #[method(headIndent)] + pub unsafe fn headIndent(&self) -> CGFloat; + + #[method(tailIndent)] + pub unsafe fn tailIndent(&self) -> CGFloat; + + #[method(firstLineHeadIndent)] + pub unsafe fn firstLineHeadIndent(&self) -> CGFloat; + + #[method(minimumLineHeight)] + pub unsafe fn minimumLineHeight(&self) -> CGFloat; + + #[method(maximumLineHeight)] + pub unsafe fn maximumLineHeight(&self) -> CGFloat; + + #[method(lineBreakMode)] + pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode; + + #[method(baseWritingDirection)] + pub unsafe fn baseWritingDirection(&self) -> NSWritingDirection; + + #[method(lineHeightMultiple)] + pub unsafe fn lineHeightMultiple(&self) -> CGFloat; + + #[method(paragraphSpacingBefore)] + pub unsafe fn paragraphSpacingBefore(&self) -> CGFloat; + + #[method(hyphenationFactor)] + pub unsafe fn hyphenationFactor(&self) -> c_float; + + #[method(usesDefaultHyphenation)] + pub unsafe fn usesDefaultHyphenation(&self) -> bool; + + #[method_id(@__retain_semantics Other tabStops)] + pub unsafe fn tabStops(&self) -> Id, Shared>; + + #[method(defaultTabInterval)] + pub unsafe fn defaultTabInterval(&self) -> CGFloat; + + #[method(allowsDefaultTighteningForTruncation)] + pub unsafe fn allowsDefaultTighteningForTruncation(&self) -> bool; + + #[method(tighteningFactorForTruncation)] + pub unsafe fn tighteningFactorForTruncation(&self) -> c_float; + + #[method_id(@__retain_semantics Other textBlocks)] + pub unsafe fn textBlocks(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other textLists)] + pub unsafe fn textLists(&self) -> Id, Shared>; + + #[method(headerLevel)] + pub unsafe fn headerLevel(&self) -> NSInteger; + + #[method(lineBreakStrategy)] + pub unsafe fn lineBreakStrategy(&self) -> NSLineBreakStrategy; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMutableParagraphStyle; + + unsafe impl ClassType for NSMutableParagraphStyle { + type Super = NSParagraphStyle; + } +); + +extern_methods!( + unsafe impl NSMutableParagraphStyle { + #[method(lineSpacing)] + pub unsafe fn lineSpacing(&self) -> CGFloat; + + #[method(setLineSpacing:)] + pub unsafe fn setLineSpacing(&self, lineSpacing: CGFloat); + + #[method(paragraphSpacing)] + pub unsafe fn paragraphSpacing(&self) -> CGFloat; + + #[method(setParagraphSpacing:)] + pub unsafe fn setParagraphSpacing(&self, paragraphSpacing: CGFloat); + + #[method(alignment)] + pub unsafe fn alignment(&self) -> NSTextAlignment; + + #[method(setAlignment:)] + pub unsafe fn setAlignment(&self, alignment: NSTextAlignment); + + #[method(firstLineHeadIndent)] + pub unsafe fn firstLineHeadIndent(&self) -> CGFloat; + + #[method(setFirstLineHeadIndent:)] + pub unsafe fn setFirstLineHeadIndent(&self, firstLineHeadIndent: CGFloat); + + #[method(headIndent)] + pub unsafe fn headIndent(&self) -> CGFloat; + + #[method(setHeadIndent:)] + pub unsafe fn setHeadIndent(&self, headIndent: CGFloat); + + #[method(tailIndent)] + pub unsafe fn tailIndent(&self) -> CGFloat; + + #[method(setTailIndent:)] + pub unsafe fn setTailIndent(&self, tailIndent: CGFloat); + + #[method(lineBreakMode)] + pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode; + + #[method(setLineBreakMode:)] + pub unsafe fn setLineBreakMode(&self, lineBreakMode: NSLineBreakMode); + + #[method(minimumLineHeight)] + pub unsafe fn minimumLineHeight(&self) -> CGFloat; + + #[method(setMinimumLineHeight:)] + pub unsafe fn setMinimumLineHeight(&self, minimumLineHeight: CGFloat); + + #[method(maximumLineHeight)] + pub unsafe fn maximumLineHeight(&self) -> CGFloat; + + #[method(setMaximumLineHeight:)] + pub unsafe fn setMaximumLineHeight(&self, maximumLineHeight: CGFloat); + + #[method(baseWritingDirection)] + pub unsafe fn baseWritingDirection(&self) -> NSWritingDirection; + + #[method(setBaseWritingDirection:)] + pub unsafe fn setBaseWritingDirection(&self, baseWritingDirection: NSWritingDirection); + + #[method(lineHeightMultiple)] + pub unsafe fn lineHeightMultiple(&self) -> CGFloat; + + #[method(setLineHeightMultiple:)] + pub unsafe fn setLineHeightMultiple(&self, lineHeightMultiple: CGFloat); + + #[method(paragraphSpacingBefore)] + pub unsafe fn paragraphSpacingBefore(&self) -> CGFloat; + + #[method(setParagraphSpacingBefore:)] + pub unsafe fn setParagraphSpacingBefore(&self, paragraphSpacingBefore: CGFloat); + + #[method(hyphenationFactor)] + pub unsafe fn hyphenationFactor(&self) -> c_float; + + #[method(setHyphenationFactor:)] + pub unsafe fn setHyphenationFactor(&self, hyphenationFactor: c_float); + + #[method(usesDefaultHyphenation)] + pub unsafe fn usesDefaultHyphenation(&self) -> bool; + + #[method(setUsesDefaultHyphenation:)] + pub unsafe fn setUsesDefaultHyphenation(&self, usesDefaultHyphenation: bool); + + #[method_id(@__retain_semantics Other tabStops)] + pub unsafe fn tabStops(&self) -> Id, Shared>; + + #[method(setTabStops:)] + pub unsafe fn setTabStops(&self, tabStops: Option<&NSArray>); + + #[method(defaultTabInterval)] + pub unsafe fn defaultTabInterval(&self) -> CGFloat; + + #[method(setDefaultTabInterval:)] + pub unsafe fn setDefaultTabInterval(&self, defaultTabInterval: CGFloat); + + #[method(allowsDefaultTighteningForTruncation)] + pub unsafe fn allowsDefaultTighteningForTruncation(&self) -> bool; + + #[method(setAllowsDefaultTighteningForTruncation:)] + pub unsafe fn setAllowsDefaultTighteningForTruncation( + &self, + allowsDefaultTighteningForTruncation: bool, + ); + + #[method(addTabStop:)] + pub unsafe fn addTabStop(&self, anObject: &NSTextTab); + + #[method(removeTabStop:)] + pub unsafe fn removeTabStop(&self, anObject: &NSTextTab); + + #[method(setParagraphStyle:)] + pub unsafe fn setParagraphStyle(&self, obj: &NSParagraphStyle); + + #[method(tighteningFactorForTruncation)] + pub unsafe fn tighteningFactorForTruncation(&self) -> c_float; + + #[method(setTighteningFactorForTruncation:)] + pub unsafe fn setTighteningFactorForTruncation( + &self, + tighteningFactorForTruncation: c_float, + ); + + #[method_id(@__retain_semantics Other textBlocks)] + pub unsafe fn textBlocks(&self) -> Id, Shared>; + + #[method(setTextBlocks:)] + pub unsafe fn setTextBlocks(&self, textBlocks: &NSArray); + + #[method_id(@__retain_semantics Other textLists)] + pub unsafe fn textLists(&self) -> Id, Shared>; + + #[method(setTextLists:)] + pub unsafe fn setTextLists(&self, textLists: &NSArray); + + #[method(headerLevel)] + pub unsafe fn headerLevel(&self) -> NSInteger; + + #[method(setHeaderLevel:)] + pub unsafe fn setHeaderLevel(&self, headerLevel: NSInteger); + + #[method(lineBreakStrategy)] + pub unsafe fn lineBreakStrategy(&self) -> NSLineBreakStrategy; + + #[method(setLineBreakStrategy:)] + pub unsafe fn setLineBreakStrategy(&self, lineBreakStrategy: NSLineBreakStrategy); + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTextTabType { + NSLeftTabStopType = 0, + NSRightTabStopType = 1, + NSCenterTabStopType = 2, + NSDecimalTabStopType = 3, + } +); + +extern_methods!( + /// NSTextTabDeprecated + unsafe impl NSTextTab { + #[method_id(@__retain_semantics Init initWithType:location:)] + pub unsafe fn initWithType_location( + this: Option>, + type_: NSTextTabType, + loc: CGFloat, + ) -> Id; + + #[method(tabStopType)] + pub unsafe fn tabStopType(&self) -> NSTextTabType; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPasteboard.rs b/crates/icrate/src/generated/AppKit/NSPasteboard.rs new file mode 100644 index 000000000..9349b6f7e --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPasteboard.rs @@ -0,0 +1,423 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSPasteboardType = NSString; + +extern_static!(NSPasteboardTypeString: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypePDF: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeTIFF: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypePNG: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeRTF: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeRTFD: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeHTML: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeTabularText: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeFont: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeRuler: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeColor: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeSound: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeMultipleTextSelection: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeTextFinderOptions: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeURL: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeFileURL: &'static NSPasteboardType); + +pub type NSPasteboardName = NSString; + +extern_static!(NSPasteboardNameGeneral: &'static NSPasteboardName); + +extern_static!(NSPasteboardNameFont: &'static NSPasteboardName); + +extern_static!(NSPasteboardNameRuler: &'static NSPasteboardName); + +extern_static!(NSPasteboardNameFind: &'static NSPasteboardName); + +extern_static!(NSPasteboardNameDrag: &'static NSPasteboardName); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSPasteboardContentsOptions { + NSPasteboardContentsCurrentHostOnly = 1 << 0, + } +); + +pub type NSPasteboardReadingOptionKey = NSString; + +extern_static!(NSPasteboardURLReadingFileURLsOnlyKey: &'static NSPasteboardReadingOptionKey); + +extern_static!( + NSPasteboardURLReadingContentsConformToTypesKey: &'static NSPasteboardReadingOptionKey +); + +extern_class!( + #[derive(Debug)] + pub struct NSPasteboard; + + unsafe impl ClassType for NSPasteboard { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPasteboard { + #[method_id(@__retain_semantics Other generalPasteboard)] + pub unsafe fn generalPasteboard() -> Id; + + #[method_id(@__retain_semantics Other pasteboardWithName:)] + pub unsafe fn pasteboardWithName(name: &NSPasteboardName) -> Id; + + #[method_id(@__retain_semantics Other pasteboardWithUniqueName)] + pub unsafe fn pasteboardWithUniqueName() -> Id; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method(changeCount)] + pub unsafe fn changeCount(&self) -> NSInteger; + + #[method(prepareForNewContentsWithOptions:)] + pub unsafe fn prepareForNewContentsWithOptions( + &self, + options: NSPasteboardContentsOptions, + ) -> NSInteger; + + #[method(clearContents)] + pub unsafe fn clearContents(&self) -> NSInteger; + + #[method(writeObjects:)] + pub unsafe fn writeObjects(&self, objects: &NSArray) -> bool; + + #[method_id(@__retain_semantics Other readObjectsForClasses:options:)] + pub unsafe fn readObjectsForClasses_options( + &self, + classArray: &NSArray, + options: Option<&NSDictionary>, + ) -> Option>; + + #[method_id(@__retain_semantics Other pasteboardItems)] + pub unsafe fn pasteboardItems(&self) -> Option, Shared>>; + + #[method(indexOfPasteboardItem:)] + pub unsafe fn indexOfPasteboardItem(&self, pasteboardItem: &NSPasteboardItem) + -> NSUInteger; + + #[method(canReadItemWithDataConformingToTypes:)] + pub unsafe fn canReadItemWithDataConformingToTypes( + &self, + types: &NSArray, + ) -> bool; + + #[method(canReadObjectForClasses:options:)] + pub unsafe fn canReadObjectForClasses_options( + &self, + classArray: &NSArray, + options: Option<&NSDictionary>, + ) -> bool; + + #[method(declareTypes:owner:)] + pub unsafe fn declareTypes_owner( + &self, + newTypes: &NSArray, + newOwner: Option<&Object>, + ) -> NSInteger; + + #[method(addTypes:owner:)] + pub unsafe fn addTypes_owner( + &self, + newTypes: &NSArray, + newOwner: Option<&Object>, + ) -> NSInteger; + + #[method_id(@__retain_semantics Other types)] + pub unsafe fn types(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other availableTypeFromArray:)] + pub unsafe fn availableTypeFromArray( + &self, + types: &NSArray, + ) -> Option>; + + #[method(setData:forType:)] + pub unsafe fn setData_forType( + &self, + data: Option<&NSData>, + dataType: &NSPasteboardType, + ) -> bool; + + #[method(setPropertyList:forType:)] + pub unsafe fn setPropertyList_forType( + &self, + plist: &Object, + dataType: &NSPasteboardType, + ) -> bool; + + #[method(setString:forType:)] + pub unsafe fn setString_forType( + &self, + string: &NSString, + dataType: &NSPasteboardType, + ) -> bool; + + #[method_id(@__retain_semantics Other dataForType:)] + pub unsafe fn dataForType(&self, dataType: &NSPasteboardType) + -> Option>; + + #[method_id(@__retain_semantics Other propertyListForType:)] + pub unsafe fn propertyListForType( + &self, + dataType: &NSPasteboardType, + ) -> Option>; + + #[method_id(@__retain_semantics Other stringForType:)] + pub unsafe fn stringForType( + &self, + dataType: &NSPasteboardType, + ) -> Option>; + } +); + +extern_methods!( + /// FilterServices + unsafe impl NSPasteboard { + #[method_id(@__retain_semantics Other typesFilterableTo:)] + pub unsafe fn typesFilterableTo( + type_: &NSPasteboardType, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other pasteboardByFilteringFile:)] + pub unsafe fn pasteboardByFilteringFile(filename: &NSString) -> Id; + + #[method_id(@__retain_semantics Other pasteboardByFilteringData:ofType:)] + pub unsafe fn pasteboardByFilteringData_ofType( + data: &NSData, + type_: &NSPasteboardType, + ) -> Id; + + #[method_id(@__retain_semantics Other pasteboardByFilteringTypesInPasteboard:)] + pub unsafe fn pasteboardByFilteringTypesInPasteboard( + pboard: &NSPasteboard, + ) -> Id; + } +); + +extern_protocol!( + pub struct NSPasteboardTypeOwner; + + unsafe impl NSPasteboardTypeOwner { + #[method(pasteboard:provideDataForType:)] + pub unsafe fn pasteboard_provideDataForType( + &self, + sender: &NSPasteboard, + type_: &NSPasteboardType, + ); + + #[optional] + #[method(pasteboardChangedOwner:)] + pub unsafe fn pasteboardChangedOwner(&self, sender: &NSPasteboard); + } +); + +extern_methods!( + /// NSPasteboardOwner + unsafe impl NSObject { + #[method(pasteboard:provideDataForType:)] + pub unsafe fn pasteboard_provideDataForType( + &self, + sender: &NSPasteboard, + type_: &NSPasteboardType, + ); + + #[method(pasteboardChangedOwner:)] + pub unsafe fn pasteboardChangedOwner(&self, sender: &NSPasteboard); + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSPasteboardWritingOptions { + NSPasteboardWritingPromised = 1 << 9, + } +); + +extern_protocol!( + pub struct NSPasteboardWriting; + + unsafe impl NSPasteboardWriting { + #[method_id(@__retain_semantics Other writableTypesForPasteboard:)] + pub unsafe fn writableTypesForPasteboard( + &self, + pasteboard: &NSPasteboard, + ) -> Id, Shared>; + + #[optional] + #[method(writingOptionsForType:pasteboard:)] + pub unsafe fn writingOptionsForType_pasteboard( + &self, + type_: &NSPasteboardType, + pasteboard: &NSPasteboard, + ) -> NSPasteboardWritingOptions; + + #[method_id(@__retain_semantics Other pasteboardPropertyListForType:)] + pub unsafe fn pasteboardPropertyListForType( + &self, + type_: &NSPasteboardType, + ) -> Option>; + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSPasteboardReadingOptions { + NSPasteboardReadingAsData = 0, + NSPasteboardReadingAsString = 1 << 0, + NSPasteboardReadingAsPropertyList = 1 << 1, + NSPasteboardReadingAsKeyedArchive = 1 << 2, + } +); + +extern_protocol!( + pub struct NSPasteboardReading; + + unsafe impl NSPasteboardReading { + #[method_id(@__retain_semantics Other readableTypesForPasteboard:)] + pub unsafe fn readableTypesForPasteboard( + pasteboard: &NSPasteboard, + ) -> Id, Shared>; + + #[optional] + #[method(readingOptionsForType:pasteboard:)] + pub unsafe fn readingOptionsForType_pasteboard( + type_: &NSPasteboardType, + pasteboard: &NSPasteboard, + ) -> NSPasteboardReadingOptions; + + #[optional] + #[method_id(@__retain_semantics Init initWithPasteboardPropertyList:ofType:)] + pub unsafe fn initWithPasteboardPropertyList_ofType( + this: Option>, + propertyList: &Object, + type_: &NSPasteboardType, + ) -> Option>; + } +); + +extern_methods!( + /// NSPasteboardSupport + unsafe impl NSURL { + #[method_id(@__retain_semantics Other URLFromPasteboard:)] + pub unsafe fn URLFromPasteboard(pasteBoard: &NSPasteboard) -> Option>; + + #[method(writeToPasteboard:)] + pub unsafe fn writeToPasteboard(&self, pasteBoard: &NSPasteboard); + } +); + +extern_methods!( + /// NSPasteboardSupport + unsafe impl NSString {} +); + +extern_methods!( + /// NSFileContents + unsafe impl NSPasteboard { + #[method(writeFileContents:)] + pub unsafe fn writeFileContents(&self, filename: &NSString) -> bool; + + #[method_id(@__retain_semantics Other readFileContentsType:toFile:)] + pub unsafe fn readFileContentsType_toFile( + &self, + type_: Option<&NSPasteboardType>, + filename: &NSString, + ) -> Option>; + + #[method(writeFileWrapper:)] + pub unsafe fn writeFileWrapper(&self, wrapper: &NSFileWrapper) -> bool; + + #[method_id(@__retain_semantics Other readFileWrapper)] + pub unsafe fn readFileWrapper(&self) -> Option>; + } +); + +extern_static!(NSFileContentsPboardType: &'static NSPasteboardType); + +extern_fn!( + pub unsafe fn NSCreateFilenamePboardType(fileType: &NSString) -> *mut NSPasteboardType; +); + +extern_fn!( + pub unsafe fn NSCreateFileContentsPboardType(fileType: &NSString) -> *mut NSPasteboardType; +); + +extern_fn!( + pub unsafe fn NSGetFileType(pboardType: &NSPasteboardType) -> *mut NSString; +); + +extern_fn!( + pub unsafe fn NSGetFileTypes(pboardTypes: &NSArray) + -> *mut NSArray; +); + +extern_static!(NSStringPboardType: &'static NSPasteboardType); + +extern_static!(NSFilenamesPboardType: &'static NSPasteboardType); + +extern_static!(NSTIFFPboardType: &'static NSPasteboardType); + +extern_static!(NSRTFPboardType: &'static NSPasteboardType); + +extern_static!(NSTabularTextPboardType: &'static NSPasteboardType); + +extern_static!(NSFontPboardType: &'static NSPasteboardType); + +extern_static!(NSRulerPboardType: &'static NSPasteboardType); + +extern_static!(NSColorPboardType: &'static NSPasteboardType); + +extern_static!(NSRTFDPboardType: &'static NSPasteboardType); + +extern_static!(NSHTMLPboardType: &'static NSPasteboardType); + +extern_static!(NSURLPboardType: &'static NSPasteboardType); + +extern_static!(NSPDFPboardType: &'static NSPasteboardType); + +extern_static!(NSMultipleTextSelectionPboardType: &'static NSPasteboardType); + +extern_static!(NSPostScriptPboardType: &'static NSPasteboardType); + +extern_static!(NSVCardPboardType: &'static NSPasteboardType); + +extern_static!(NSInkTextPboardType: &'static NSPasteboardType); + +extern_static!(NSFilesPromisePboardType: &'static NSPasteboardType); + +extern_static!(NSPasteboardTypeFindPanelSearchOptions: &'static NSPasteboardType); + +extern_static!(NSGeneralPboard: &'static NSPasteboardName); + +extern_static!(NSFontPboard: &'static NSPasteboardName); + +extern_static!(NSRulerPboard: &'static NSPasteboardName); + +extern_static!(NSFindPboard: &'static NSPasteboardName); + +extern_static!(NSDragPboard: &'static NSPasteboardName); + +extern_static!(NSPICTPboardType: &'static NSPasteboardType); diff --git a/crates/icrate/src/generated/AppKit/NSPasteboardItem.rs b/crates/icrate/src/generated/AppKit/NSPasteboardItem.rs new file mode 100644 index 000000000..8e3e8e19c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPasteboardItem.rs @@ -0,0 +1,82 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPasteboardItem; + + unsafe impl ClassType for NSPasteboardItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPasteboardItem { + #[method_id(@__retain_semantics Other types)] + pub unsafe fn types(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other availableTypeFromArray:)] + pub unsafe fn availableTypeFromArray( + &self, + types: &NSArray, + ) -> Option>; + + #[method(setDataProvider:forTypes:)] + pub unsafe fn setDataProvider_forTypes( + &self, + dataProvider: &NSPasteboardItemDataProvider, + types: &NSArray, + ) -> bool; + + #[method(setData:forType:)] + pub unsafe fn setData_forType(&self, data: &NSData, type_: &NSPasteboardType) -> bool; + + #[method(setString:forType:)] + pub unsafe fn setString_forType(&self, string: &NSString, type_: &NSPasteboardType) + -> bool; + + #[method(setPropertyList:forType:)] + pub unsafe fn setPropertyList_forType( + &self, + propertyList: &Object, + type_: &NSPasteboardType, + ) -> bool; + + #[method_id(@__retain_semantics Other dataForType:)] + pub unsafe fn dataForType(&self, type_: &NSPasteboardType) -> Option>; + + #[method_id(@__retain_semantics Other stringForType:)] + pub unsafe fn stringForType( + &self, + type_: &NSPasteboardType, + ) -> Option>; + + #[method_id(@__retain_semantics Other propertyListForType:)] + pub unsafe fn propertyListForType( + &self, + type_: &NSPasteboardType, + ) -> Option>; + } +); + +extern_protocol!( + pub struct NSPasteboardItemDataProvider; + + unsafe impl NSPasteboardItemDataProvider { + #[method(pasteboard:item:provideDataForType:)] + pub unsafe fn pasteboard_item_provideDataForType( + &self, + pasteboard: Option<&NSPasteboard>, + item: &NSPasteboardItem, + type_: &NSPasteboardType, + ); + + #[optional] + #[method(pasteboardFinishedWithDataProvider:)] + pub unsafe fn pasteboardFinishedWithDataProvider(&self, pasteboard: &NSPasteboard); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPathCell.rs b/crates/icrate/src/generated/AppKit/NSPathCell.rs new file mode 100644 index 000000000..451b44216 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPathCell.rs @@ -0,0 +1,147 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPathStyle { + NSPathStyleStandard = 0, + NSPathStylePopUp = 2, + NSPathStyleNavigationBar = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPathCell; + + unsafe impl ClassType for NSPathCell { + type Super = NSActionCell; + } +); + +extern_methods!( + unsafe impl NSPathCell { + #[method(pathStyle)] + pub unsafe fn pathStyle(&self) -> NSPathStyle; + + #[method(setPathStyle:)] + pub unsafe fn setPathStyle(&self, pathStyle: NSPathStyle); + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + + #[method(setURL:)] + pub unsafe fn setURL(&self, URL: Option<&NSURL>); + + #[method(setObjectValue:)] + pub unsafe fn setObjectValue(&self, obj: Option<&NSCopying>); + + #[method_id(@__retain_semantics Other allowedTypes)] + pub unsafe fn allowedTypes(&self) -> Option, Shared>>; + + #[method(setAllowedTypes:)] + pub unsafe fn setAllowedTypes(&self, allowedTypes: Option<&NSArray>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSPathCellDelegate>); + + #[method(pathComponentCellClass)] + pub unsafe fn pathComponentCellClass() -> &'static Class; + + #[method_id(@__retain_semantics Other pathComponentCells)] + pub unsafe fn pathComponentCells(&self) -> Id, Shared>; + + #[method(setPathComponentCells:)] + pub unsafe fn setPathComponentCells( + &self, + pathComponentCells: &NSArray, + ); + + #[method(rectOfPathComponentCell:withFrame:inView:)] + pub unsafe fn rectOfPathComponentCell_withFrame_inView( + &self, + cell: &NSPathComponentCell, + frame: NSRect, + view: &NSView, + ) -> NSRect; + + #[method_id(@__retain_semantics Other pathComponentCellAtPoint:withFrame:inView:)] + pub unsafe fn pathComponentCellAtPoint_withFrame_inView( + &self, + point: NSPoint, + frame: NSRect, + view: &NSView, + ) -> Option>; + + #[method_id(@__retain_semantics Other clickedPathComponentCell)] + pub unsafe fn clickedPathComponentCell(&self) -> Option>; + + #[method(mouseEntered:withFrame:inView:)] + pub unsafe fn mouseEntered_withFrame_inView( + &self, + event: &NSEvent, + frame: NSRect, + view: &NSView, + ); + + #[method(mouseExited:withFrame:inView:)] + pub unsafe fn mouseExited_withFrame_inView( + &self, + event: &NSEvent, + frame: NSRect, + view: &NSView, + ); + + #[method(doubleAction)] + pub unsafe fn doubleAction(&self) -> OptionSel; + + #[method(setDoubleAction:)] + pub unsafe fn setDoubleAction(&self, doubleAction: OptionSel); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Option>; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: Option<&NSColor>); + + #[method_id(@__retain_semantics Other placeholderString)] + pub unsafe fn placeholderString(&self) -> Option>; + + #[method(setPlaceholderString:)] + pub unsafe fn setPlaceholderString(&self, placeholderString: Option<&NSString>); + + #[method_id(@__retain_semantics Other placeholderAttributedString)] + pub unsafe fn placeholderAttributedString(&self) -> Option>; + + #[method(setPlaceholderAttributedString:)] + pub unsafe fn setPlaceholderAttributedString( + &self, + placeholderAttributedString: Option<&NSAttributedString>, + ); + } +); + +extern_protocol!( + pub struct NSPathCellDelegate; + + unsafe impl NSPathCellDelegate { + #[optional] + #[method(pathCell:willDisplayOpenPanel:)] + pub unsafe fn pathCell_willDisplayOpenPanel( + &self, + pathCell: &NSPathCell, + openPanel: &NSOpenPanel, + ); + + #[optional] + #[method(pathCell:willPopUpMenu:)] + pub unsafe fn pathCell_willPopUpMenu(&self, pathCell: &NSPathCell, menu: &NSMenu); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPathComponentCell.rs b/crates/icrate/src/generated/AppKit/NSPathComponentCell.rs new file mode 100644 index 000000000..666e146ac --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPathComponentCell.rs @@ -0,0 +1,31 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPathComponentCell; + + unsafe impl ClassType for NSPathComponentCell { + type Super = NSTextFieldCell; + } +); + +extern_methods!( + unsafe impl NSPathComponentCell { + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + + #[method(setURL:)] + pub unsafe fn setURL(&self, URL: Option<&NSURL>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPathControl.rs b/crates/icrate/src/generated/AppKit/NSPathControl.rs new file mode 100644 index 000000000..f7316c0eb --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPathControl.rs @@ -0,0 +1,164 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPathControl; + + unsafe impl ClassType for NSPathControl { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSPathControl { + #[method(isEditable)] + pub unsafe fn isEditable(&self) -> bool; + + #[method(setEditable:)] + pub unsafe fn setEditable(&self, editable: bool); + + #[method_id(@__retain_semantics Other allowedTypes)] + pub unsafe fn allowedTypes(&self) -> Option, Shared>>; + + #[method(setAllowedTypes:)] + pub unsafe fn setAllowedTypes(&self, allowedTypes: Option<&NSArray>); + + #[method_id(@__retain_semantics Other placeholderString)] + pub unsafe fn placeholderString(&self) -> Option>; + + #[method(setPlaceholderString:)] + pub unsafe fn setPlaceholderString(&self, placeholderString: Option<&NSString>); + + #[method_id(@__retain_semantics Other placeholderAttributedString)] + pub unsafe fn placeholderAttributedString(&self) -> Option>; + + #[method(setPlaceholderAttributedString:)] + pub unsafe fn setPlaceholderAttributedString( + &self, + placeholderAttributedString: Option<&NSAttributedString>, + ); + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + + #[method(setURL:)] + pub unsafe fn setURL(&self, URL: Option<&NSURL>); + + #[method(doubleAction)] + pub unsafe fn doubleAction(&self) -> OptionSel; + + #[method(setDoubleAction:)] + pub unsafe fn setDoubleAction(&self, doubleAction: OptionSel); + + #[method(pathStyle)] + pub unsafe fn pathStyle(&self) -> NSPathStyle; + + #[method(setPathStyle:)] + pub unsafe fn setPathStyle(&self, pathStyle: NSPathStyle); + + #[method_id(@__retain_semantics Other clickedPathItem)] + pub unsafe fn clickedPathItem(&self) -> Option>; + + #[method_id(@__retain_semantics Other pathItems)] + pub unsafe fn pathItems(&self) -> Id, Shared>; + + #[method(setPathItems:)] + pub unsafe fn setPathItems(&self, pathItems: &NSArray); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Option>; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: Option<&NSColor>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSPathControlDelegate>); + + #[method(setDraggingSourceOperationMask:forLocal:)] + pub unsafe fn setDraggingSourceOperationMask_forLocal( + &self, + mask: NSDragOperation, + isLocal: bool, + ); + + #[method_id(@__retain_semantics Other menu)] + pub unsafe fn menu(&self) -> Option>; + + #[method(setMenu:)] + pub unsafe fn setMenu(&self, menu: Option<&NSMenu>); + } +); + +extern_protocol!( + pub struct NSPathControlDelegate; + + unsafe impl NSPathControlDelegate { + #[optional] + #[method(pathControl:shouldDragItem:withPasteboard:)] + pub unsafe fn pathControl_shouldDragItem_withPasteboard( + &self, + pathControl: &NSPathControl, + pathItem: &NSPathControlItem, + pasteboard: &NSPasteboard, + ) -> bool; + + #[optional] + #[method(pathControl:shouldDragPathComponentCell:withPasteboard:)] + pub unsafe fn pathControl_shouldDragPathComponentCell_withPasteboard( + &self, + pathControl: &NSPathControl, + pathComponentCell: &NSPathComponentCell, + pasteboard: &NSPasteboard, + ) -> bool; + + #[optional] + #[method(pathControl:validateDrop:)] + pub unsafe fn pathControl_validateDrop( + &self, + pathControl: &NSPathControl, + info: &NSDraggingInfo, + ) -> NSDragOperation; + + #[optional] + #[method(pathControl:acceptDrop:)] + pub unsafe fn pathControl_acceptDrop( + &self, + pathControl: &NSPathControl, + info: &NSDraggingInfo, + ) -> bool; + + #[optional] + #[method(pathControl:willDisplayOpenPanel:)] + pub unsafe fn pathControl_willDisplayOpenPanel( + &self, + pathControl: &NSPathControl, + openPanel: &NSOpenPanel, + ); + + #[optional] + #[method(pathControl:willPopUpMenu:)] + pub unsafe fn pathControl_willPopUpMenu(&self, pathControl: &NSPathControl, menu: &NSMenu); + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSPathControl { + #[method_id(@__retain_semantics Other clickedPathComponentCell)] + pub unsafe fn clickedPathComponentCell(&self) -> Option>; + + #[method_id(@__retain_semantics Other pathComponentCells)] + pub unsafe fn pathComponentCells(&self) -> Id, Shared>; + + #[method(setPathComponentCells:)] + pub unsafe fn setPathComponentCells(&self, cells: &NSArray); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPathControlItem.rs b/crates/icrate/src/generated/AppKit/NSPathControlItem.rs new file mode 100644 index 000000000..b73c38e77 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPathControlItem.rs @@ -0,0 +1,40 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPathControlItem; + + unsafe impl ClassType for NSPathControlItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPathControlItem { + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + + #[method_id(@__retain_semantics Other attributedTitle)] + pub unsafe fn attributedTitle(&self) -> Id; + + #[method(setAttributedTitle:)] + pub unsafe fn setAttributedTitle(&self, attributedTitle: &NSAttributedString); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPersistentDocument.rs b/crates/icrate/src/generated/AppKit/NSPersistentDocument.rs new file mode 100644 index 000000000..7ed9aecce --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPersistentDocument.rs @@ -0,0 +1,81 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentDocument; + + unsafe impl ClassType for NSPersistentDocument { + type Super = NSDocument; + } +); + +extern_methods!( + unsafe impl NSPersistentDocument { + #[method_id(@__retain_semantics Other managedObjectContext)] + pub unsafe fn managedObjectContext(&self) -> Option>; + + #[method(setManagedObjectContext:)] + pub unsafe fn setManagedObjectContext( + &self, + managedObjectContext: Option<&NSManagedObjectContext>, + ); + + #[method_id(@__retain_semantics Other managedObjectModel)] + pub unsafe fn managedObjectModel(&self) -> Option>; + + #[method(configurePersistentStoreCoordinatorForURL:ofType:modelConfiguration:storeOptions:error:)] + pub unsafe fn configurePersistentStoreCoordinatorForURL_ofType_modelConfiguration_storeOptions_error( + &self, + url: &NSURL, + fileType: &NSString, + configuration: Option<&NSString>, + storeOptions: Option<&NSDictionary>, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other persistentStoreTypeForFileType:)] + pub unsafe fn persistentStoreTypeForFileType( + &self, + fileType: &NSString, + ) -> Id; + + #[method(writeToURL:ofType:forSaveOperation:originalContentsURL:error:)] + pub unsafe fn writeToURL_ofType_forSaveOperation_originalContentsURL_error( + &self, + absoluteURL: &NSURL, + typeName: &NSString, + saveOperation: NSSaveOperationType, + absoluteOriginalContentsURL: Option<&NSURL>, + ) -> Result<(), Id>; + + #[method(readFromURL:ofType:error:)] + pub unsafe fn readFromURL_ofType_error( + &self, + absoluteURL: &NSURL, + typeName: &NSString, + ) -> Result<(), Id>; + + #[method(revertToContentsOfURL:ofType:error:)] + pub unsafe fn revertToContentsOfURL_ofType_error( + &self, + inAbsoluteURL: &NSURL, + inTypeName: &NSString, + ) -> Result<(), Id>; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSPersistentDocument { + #[method(configurePersistentStoreCoordinatorForURL:ofType:error:)] + pub unsafe fn configurePersistentStoreCoordinatorForURL_ofType_error( + &self, + url: Option<&NSURL>, + fileType: Option<&NSString>, + ) -> Result<(), Id>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPickerTouchBarItem.rs b/crates/icrate/src/generated/AppKit/NSPickerTouchBarItem.rs new file mode 100644 index 000000000..aafd33892 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPickerTouchBarItem.rs @@ -0,0 +1,148 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPickerTouchBarItemSelectionMode { + NSPickerTouchBarItemSelectionModeSelectOne = 0, + NSPickerTouchBarItemSelectionModeSelectAny = 1, + NSPickerTouchBarItemSelectionModeMomentary = 2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPickerTouchBarItemControlRepresentation { + NSPickerTouchBarItemControlRepresentationAutomatic = 0, + NSPickerTouchBarItemControlRepresentationExpanded = 1, + NSPickerTouchBarItemControlRepresentationCollapsed = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPickerTouchBarItem; + + unsafe impl ClassType for NSPickerTouchBarItem { + type Super = NSTouchBarItem; + } +); + +extern_methods!( + unsafe impl NSPickerTouchBarItem { + #[method_id(@__retain_semantics Other pickerTouchBarItemWithIdentifier:labels:selectionMode:target:action:)] + pub unsafe fn pickerTouchBarItemWithIdentifier_labels_selectionMode_target_action( + identifier: &NSTouchBarItemIdentifier, + labels: &NSArray, + selectionMode: NSPickerTouchBarItemSelectionMode, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Other pickerTouchBarItemWithIdentifier:images:selectionMode:target:action:)] + pub unsafe fn pickerTouchBarItemWithIdentifier_images_selectionMode_target_action( + identifier: &NSTouchBarItemIdentifier, + images: &NSArray, + selectionMode: NSPickerTouchBarItemSelectionMode, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method(controlRepresentation)] + pub unsafe fn controlRepresentation(&self) -> NSPickerTouchBarItemControlRepresentation; + + #[method(setControlRepresentation:)] + pub unsafe fn setControlRepresentation( + &self, + controlRepresentation: NSPickerTouchBarItemControlRepresentation, + ); + + #[method_id(@__retain_semantics Other collapsedRepresentationLabel)] + pub unsafe fn collapsedRepresentationLabel(&self) -> Id; + + #[method(setCollapsedRepresentationLabel:)] + pub unsafe fn setCollapsedRepresentationLabel( + &self, + collapsedRepresentationLabel: &NSString, + ); + + #[method_id(@__retain_semantics Other collapsedRepresentationImage)] + pub unsafe fn collapsedRepresentationImage(&self) -> Option>; + + #[method(setCollapsedRepresentationImage:)] + pub unsafe fn setCollapsedRepresentationImage( + &self, + collapsedRepresentationImage: Option<&NSImage>, + ); + + #[method(selectedIndex)] + pub unsafe fn selectedIndex(&self) -> NSInteger; + + #[method(setSelectedIndex:)] + pub unsafe fn setSelectedIndex(&self, selectedIndex: NSInteger); + + #[method_id(@__retain_semantics Other selectionColor)] + pub unsafe fn selectionColor(&self) -> Option>; + + #[method(setSelectionColor:)] + pub unsafe fn setSelectionColor(&self, selectionColor: Option<&NSColor>); + + #[method(selectionMode)] + pub unsafe fn selectionMode(&self) -> NSPickerTouchBarItemSelectionMode; + + #[method(setSelectionMode:)] + pub unsafe fn setSelectionMode(&self, selectionMode: NSPickerTouchBarItemSelectionMode); + + #[method(numberOfOptions)] + pub unsafe fn numberOfOptions(&self) -> NSInteger; + + #[method(setNumberOfOptions:)] + pub unsafe fn setNumberOfOptions(&self, numberOfOptions: NSInteger); + + #[method(setImage:atIndex:)] + pub unsafe fn setImage_atIndex(&self, image: Option<&NSImage>, index: NSInteger); + + #[method_id(@__retain_semantics Other imageAtIndex:)] + pub unsafe fn imageAtIndex(&self, index: NSInteger) -> Option>; + + #[method(setLabel:atIndex:)] + pub unsafe fn setLabel_atIndex(&self, label: &NSString, index: NSInteger); + + #[method_id(@__retain_semantics Other labelAtIndex:)] + pub unsafe fn labelAtIndex(&self, index: NSInteger) -> Option>; + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: OptionSel); + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + + #[method(setEnabled:atIndex:)] + pub unsafe fn setEnabled_atIndex(&self, enabled: bool, index: NSInteger); + + #[method(isEnabledAtIndex:)] + pub unsafe fn isEnabledAtIndex(&self, index: NSInteger) -> bool; + + #[method_id(@__retain_semantics Other customizationLabel)] + pub unsafe fn customizationLabel(&self) -> Id; + + #[method(setCustomizationLabel:)] + pub unsafe fn setCustomizationLabel(&self, customizationLabel: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPopUpButton.rs b/crates/icrate/src/generated/AppKit/NSPopUpButton.rs new file mode 100644 index 000000000..787527fbf --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPopUpButton.rs @@ -0,0 +1,140 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPopUpButton; + + unsafe impl ClassType for NSPopUpButton { + type Super = NSButton; + } +); + +extern_methods!( + unsafe impl NSPopUpButton { + #[method_id(@__retain_semantics Init initWithFrame:pullsDown:)] + pub unsafe fn initWithFrame_pullsDown( + this: Option>, + buttonFrame: NSRect, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other menu)] + pub unsafe fn menu(&self) -> Option>; + + #[method(setMenu:)] + pub unsafe fn setMenu(&self, menu: Option<&NSMenu>); + + #[method(pullsDown)] + pub unsafe fn pullsDown(&self) -> bool; + + #[method(setPullsDown:)] + pub unsafe fn setPullsDown(&self, pullsDown: bool); + + #[method(autoenablesItems)] + pub unsafe fn autoenablesItems(&self) -> bool; + + #[method(setAutoenablesItems:)] + pub unsafe fn setAutoenablesItems(&self, autoenablesItems: bool); + + #[method(preferredEdge)] + pub unsafe fn preferredEdge(&self) -> NSRectEdge; + + #[method(setPreferredEdge:)] + pub unsafe fn setPreferredEdge(&self, preferredEdge: NSRectEdge); + + #[method(addItemWithTitle:)] + pub unsafe fn addItemWithTitle(&self, title: &NSString); + + #[method(addItemsWithTitles:)] + pub unsafe fn addItemsWithTitles(&self, itemTitles: &NSArray); + + #[method(insertItemWithTitle:atIndex:)] + pub unsafe fn insertItemWithTitle_atIndex(&self, title: &NSString, index: NSInteger); + + #[method(removeItemWithTitle:)] + pub unsafe fn removeItemWithTitle(&self, title: &NSString); + + #[method(removeItemAtIndex:)] + pub unsafe fn removeItemAtIndex(&self, index: NSInteger); + + #[method(removeAllItems)] + pub unsafe fn removeAllItems(&self); + + #[method_id(@__retain_semantics Other itemArray)] + pub unsafe fn itemArray(&self) -> Id, Shared>; + + #[method(numberOfItems)] + pub unsafe fn numberOfItems(&self) -> NSInteger; + + #[method(indexOfItem:)] + pub unsafe fn indexOfItem(&self, item: &NSMenuItem) -> NSInteger; + + #[method(indexOfItemWithTitle:)] + pub unsafe fn indexOfItemWithTitle(&self, title: &NSString) -> NSInteger; + + #[method(indexOfItemWithTag:)] + pub unsafe fn indexOfItemWithTag(&self, tag: NSInteger) -> NSInteger; + + #[method(indexOfItemWithRepresentedObject:)] + pub unsafe fn indexOfItemWithRepresentedObject(&self, obj: Option<&Object>) -> NSInteger; + + #[method(indexOfItemWithTarget:andAction:)] + pub unsafe fn indexOfItemWithTarget_andAction( + &self, + target: Option<&Object>, + actionSelector: OptionSel, + ) -> NSInteger; + + #[method_id(@__retain_semantics Other itemAtIndex:)] + pub unsafe fn itemAtIndex(&self, index: NSInteger) -> Option>; + + #[method_id(@__retain_semantics Other itemWithTitle:)] + pub unsafe fn itemWithTitle(&self, title: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other lastItem)] + pub unsafe fn lastItem(&self) -> Option>; + + #[method(selectItem:)] + pub unsafe fn selectItem(&self, item: Option<&NSMenuItem>); + + #[method(selectItemAtIndex:)] + pub unsafe fn selectItemAtIndex(&self, index: NSInteger); + + #[method(selectItemWithTitle:)] + pub unsafe fn selectItemWithTitle(&self, title: &NSString); + + #[method(selectItemWithTag:)] + pub unsafe fn selectItemWithTag(&self, tag: NSInteger) -> bool; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, string: &NSString); + + #[method_id(@__retain_semantics Other selectedItem)] + pub unsafe fn selectedItem(&self) -> Option>; + + #[method(indexOfSelectedItem)] + pub unsafe fn indexOfSelectedItem(&self) -> NSInteger; + + #[method(selectedTag)] + pub unsafe fn selectedTag(&self) -> NSInteger; + + #[method(synchronizeTitleAndSelectedItem)] + pub unsafe fn synchronizeTitleAndSelectedItem(&self); + + #[method_id(@__retain_semantics Other itemTitleAtIndex:)] + pub unsafe fn itemTitleAtIndex(&self, index: NSInteger) -> Id; + + #[method_id(@__retain_semantics Other itemTitles)] + pub unsafe fn itemTitles(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other titleOfSelectedItem)] + pub unsafe fn titleOfSelectedItem(&self) -> Option>; + } +); + +extern_static!(NSPopUpButtonWillPopUpNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/AppKit/NSPopUpButtonCell.rs b/crates/icrate/src/generated/AppKit/NSPopUpButtonCell.rs new file mode 100644 index 000000000..0d0de55d3 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPopUpButtonCell.rs @@ -0,0 +1,179 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSPopUpArrowPosition { + NSPopUpNoArrow = 0, + NSPopUpArrowAtCenter = 1, + NSPopUpArrowAtBottom = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPopUpButtonCell; + + unsafe impl ClassType for NSPopUpButtonCell { + type Super = NSMenuItemCell; + } +); + +extern_methods!( + unsafe impl NSPopUpButtonCell { + #[method_id(@__retain_semantics Init initTextCell:pullsDown:)] + pub unsafe fn initTextCell_pullsDown( + this: Option>, + stringValue: &NSString, + pullDown: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Other menu)] + pub unsafe fn menu(&self) -> Option>; + + #[method(setMenu:)] + pub unsafe fn setMenu(&self, menu: Option<&NSMenu>); + + #[method(pullsDown)] + pub unsafe fn pullsDown(&self) -> bool; + + #[method(setPullsDown:)] + pub unsafe fn setPullsDown(&self, pullsDown: bool); + + #[method(autoenablesItems)] + pub unsafe fn autoenablesItems(&self) -> bool; + + #[method(setAutoenablesItems:)] + pub unsafe fn setAutoenablesItems(&self, autoenablesItems: bool); + + #[method(preferredEdge)] + pub unsafe fn preferredEdge(&self) -> NSRectEdge; + + #[method(setPreferredEdge:)] + pub unsafe fn setPreferredEdge(&self, preferredEdge: NSRectEdge); + + #[method(usesItemFromMenu)] + pub unsafe fn usesItemFromMenu(&self) -> bool; + + #[method(setUsesItemFromMenu:)] + pub unsafe fn setUsesItemFromMenu(&self, usesItemFromMenu: bool); + + #[method(altersStateOfSelectedItem)] + pub unsafe fn altersStateOfSelectedItem(&self) -> bool; + + #[method(setAltersStateOfSelectedItem:)] + pub unsafe fn setAltersStateOfSelectedItem(&self, altersStateOfSelectedItem: bool); + + #[method(addItemWithTitle:)] + pub unsafe fn addItemWithTitle(&self, title: &NSString); + + #[method(addItemsWithTitles:)] + pub unsafe fn addItemsWithTitles(&self, itemTitles: &NSArray); + + #[method(insertItemWithTitle:atIndex:)] + pub unsafe fn insertItemWithTitle_atIndex(&self, title: &NSString, index: NSInteger); + + #[method(removeItemWithTitle:)] + pub unsafe fn removeItemWithTitle(&self, title: &NSString); + + #[method(removeItemAtIndex:)] + pub unsafe fn removeItemAtIndex(&self, index: NSInteger); + + #[method(removeAllItems)] + pub unsafe fn removeAllItems(&self); + + #[method_id(@__retain_semantics Other itemArray)] + pub unsafe fn itemArray(&self) -> Id, Shared>; + + #[method(numberOfItems)] + pub unsafe fn numberOfItems(&self) -> NSInteger; + + #[method(indexOfItem:)] + pub unsafe fn indexOfItem(&self, item: &NSMenuItem) -> NSInteger; + + #[method(indexOfItemWithTitle:)] + pub unsafe fn indexOfItemWithTitle(&self, title: &NSString) -> NSInteger; + + #[method(indexOfItemWithTag:)] + pub unsafe fn indexOfItemWithTag(&self, tag: NSInteger) -> NSInteger; + + #[method(indexOfItemWithRepresentedObject:)] + pub unsafe fn indexOfItemWithRepresentedObject(&self, obj: Option<&Object>) -> NSInteger; + + #[method(indexOfItemWithTarget:andAction:)] + pub unsafe fn indexOfItemWithTarget_andAction( + &self, + target: Option<&Object>, + actionSelector: OptionSel, + ) -> NSInteger; + + #[method_id(@__retain_semantics Other itemAtIndex:)] + pub unsafe fn itemAtIndex(&self, index: NSInteger) -> Option>; + + #[method_id(@__retain_semantics Other itemWithTitle:)] + pub unsafe fn itemWithTitle(&self, title: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other lastItem)] + pub unsafe fn lastItem(&self) -> Option>; + + #[method(selectItem:)] + pub unsafe fn selectItem(&self, item: Option<&NSMenuItem>); + + #[method(selectItemAtIndex:)] + pub unsafe fn selectItemAtIndex(&self, index: NSInteger); + + #[method(selectItemWithTitle:)] + pub unsafe fn selectItemWithTitle(&self, title: &NSString); + + #[method(selectItemWithTag:)] + pub unsafe fn selectItemWithTag(&self, tag: NSInteger) -> bool; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, string: Option<&NSString>); + + #[method_id(@__retain_semantics Other selectedItem)] + pub unsafe fn selectedItem(&self) -> Option>; + + #[method(indexOfSelectedItem)] + pub unsafe fn indexOfSelectedItem(&self) -> NSInteger; + + #[method(synchronizeTitleAndSelectedItem)] + pub unsafe fn synchronizeTitleAndSelectedItem(&self); + + #[method_id(@__retain_semantics Other itemTitleAtIndex:)] + pub unsafe fn itemTitleAtIndex(&self, index: NSInteger) -> Id; + + #[method_id(@__retain_semantics Other itemTitles)] + pub unsafe fn itemTitles(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other titleOfSelectedItem)] + pub unsafe fn titleOfSelectedItem(&self) -> Option>; + + #[method(attachPopUpWithFrame:inView:)] + pub unsafe fn attachPopUpWithFrame_inView(&self, cellFrame: NSRect, controlView: &NSView); + + #[method(dismissPopUp)] + pub unsafe fn dismissPopUp(&self); + + #[method(performClickWithFrame:inView:)] + pub unsafe fn performClickWithFrame_inView(&self, frame: NSRect, controlView: &NSView); + + #[method(arrowPosition)] + pub unsafe fn arrowPosition(&self) -> NSPopUpArrowPosition; + + #[method(setArrowPosition:)] + pub unsafe fn setArrowPosition(&self, arrowPosition: NSPopUpArrowPosition); + } +); + +extern_static!(NSPopUpButtonCellWillPopUpNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/AppKit/NSPopover.rs b/crates/icrate/src/generated/AppKit/NSPopover.rs new file mode 100644 index 000000000..740611f89 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPopover.rs @@ -0,0 +1,167 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPopoverAppearance { + NSPopoverAppearanceMinimal = 0, + NSPopoverAppearanceHUD = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPopoverBehavior { + NSPopoverBehaviorApplicationDefined = 0, + NSPopoverBehaviorTransient = 1, + NSPopoverBehaviorSemitransient = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPopover; + + unsafe impl ClassType for NSPopover { + type Super = NSResponder; + } +); + +extern_methods!( + unsafe impl NSPopover { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSPopoverDelegate>); + + #[method(appearance)] + pub unsafe fn appearance(&self) -> NSPopoverAppearance; + + #[method(setAppearance:)] + pub unsafe fn setAppearance(&self, appearance: NSPopoverAppearance); + + #[method(behavior)] + pub unsafe fn behavior(&self) -> NSPopoverBehavior; + + #[method(setBehavior:)] + pub unsafe fn setBehavior(&self, behavior: NSPopoverBehavior); + + #[method(animates)] + pub unsafe fn animates(&self) -> bool; + + #[method(setAnimates:)] + pub unsafe fn setAnimates(&self, animates: bool); + + #[method_id(@__retain_semantics Other contentViewController)] + pub unsafe fn contentViewController(&self) -> Option>; + + #[method(setContentViewController:)] + pub unsafe fn setContentViewController( + &self, + contentViewController: Option<&NSViewController>, + ); + + #[method(contentSize)] + pub unsafe fn contentSize(&self) -> NSSize; + + #[method(setContentSize:)] + pub unsafe fn setContentSize(&self, contentSize: NSSize); + + #[method(isShown)] + pub unsafe fn isShown(&self) -> bool; + + #[method(isDetached)] + pub unsafe fn isDetached(&self) -> bool; + + #[method(positioningRect)] + pub unsafe fn positioningRect(&self) -> NSRect; + + #[method(setPositioningRect:)] + pub unsafe fn setPositioningRect(&self, positioningRect: NSRect); + + #[method(showRelativeToRect:ofView:preferredEdge:)] + pub unsafe fn showRelativeToRect_ofView_preferredEdge( + &self, + positioningRect: NSRect, + positioningView: &NSView, + preferredEdge: NSRectEdge, + ); + + #[method(performClose:)] + pub unsafe fn performClose(&self, sender: Option<&Object>); + + #[method(close)] + pub unsafe fn close(&self); + } +); + +extern_static!(NSPopoverCloseReasonKey: &'static NSString); + +pub type NSPopoverCloseReasonValue = NSString; + +extern_static!(NSPopoverCloseReasonStandard: &'static NSPopoverCloseReasonValue); + +extern_static!(NSPopoverCloseReasonDetachToWindow: &'static NSPopoverCloseReasonValue); + +extern_static!(NSPopoverWillShowNotification: &'static NSNotificationName); + +extern_static!(NSPopoverDidShowNotification: &'static NSNotificationName); + +extern_static!(NSPopoverWillCloseNotification: &'static NSNotificationName); + +extern_static!(NSPopoverDidCloseNotification: &'static NSNotificationName); + +extern_protocol!( + pub struct NSPopoverDelegate; + + unsafe impl NSPopoverDelegate { + #[optional] + #[method(popoverShouldClose:)] + pub unsafe fn popoverShouldClose(&self, popover: &NSPopover) -> bool; + + #[optional] + #[method(popoverShouldDetach:)] + pub unsafe fn popoverShouldDetach(&self, popover: &NSPopover) -> bool; + + #[optional] + #[method(popoverDidDetach:)] + pub unsafe fn popoverDidDetach(&self, popover: &NSPopover); + + #[optional] + #[method_id(@__retain_semantics Other detachableWindowForPopover:)] + pub unsafe fn detachableWindowForPopover( + &self, + popover: &NSPopover, + ) -> Option>; + + #[optional] + #[method(popoverWillShow:)] + pub unsafe fn popoverWillShow(&self, notification: &NSNotification); + + #[optional] + #[method(popoverDidShow:)] + pub unsafe fn popoverDidShow(&self, notification: &NSNotification); + + #[optional] + #[method(popoverWillClose:)] + pub unsafe fn popoverWillClose(&self, notification: &NSNotification); + + #[optional] + #[method(popoverDidClose:)] + pub unsafe fn popoverDidClose(&self, notification: &NSNotification); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPopoverTouchBarItem.rs b/crates/icrate/src/generated/AppKit/NSPopoverTouchBarItem.rs new file mode 100644 index 000000000..30e1c4b75 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPopoverTouchBarItem.rs @@ -0,0 +1,78 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPopoverTouchBarItem; + + unsafe impl ClassType for NSPopoverTouchBarItem { + type Super = NSTouchBarItem; + } +); + +extern_methods!( + unsafe impl NSPopoverTouchBarItem { + #[method_id(@__retain_semantics Other popoverTouchBar)] + pub unsafe fn popoverTouchBar(&self) -> Id; + + #[method(setPopoverTouchBar:)] + pub unsafe fn setPopoverTouchBar(&self, popoverTouchBar: &NSTouchBar); + + #[method_id(@__retain_semantics Other customizationLabel)] + pub unsafe fn customizationLabel(&self) -> Id; + + #[method(setCustomizationLabel:)] + pub unsafe fn setCustomizationLabel(&self, customizationLabel: Option<&NSString>); + + #[method_id(@__retain_semantics Other collapsedRepresentation)] + pub unsafe fn collapsedRepresentation(&self) -> Id; + + #[method(setCollapsedRepresentation:)] + pub unsafe fn setCollapsedRepresentation(&self, collapsedRepresentation: &NSView); + + #[method_id(@__retain_semantics Other collapsedRepresentationImage)] + pub unsafe fn collapsedRepresentationImage(&self) -> Option>; + + #[method(setCollapsedRepresentationImage:)] + pub unsafe fn setCollapsedRepresentationImage( + &self, + collapsedRepresentationImage: Option<&NSImage>, + ); + + #[method_id(@__retain_semantics Other collapsedRepresentationLabel)] + pub unsafe fn collapsedRepresentationLabel(&self) -> Id; + + #[method(setCollapsedRepresentationLabel:)] + pub unsafe fn setCollapsedRepresentationLabel( + &self, + collapsedRepresentationLabel: &NSString, + ); + + #[method_id(@__retain_semantics Other pressAndHoldTouchBar)] + pub unsafe fn pressAndHoldTouchBar(&self) -> Option>; + + #[method(setPressAndHoldTouchBar:)] + pub unsafe fn setPressAndHoldTouchBar(&self, pressAndHoldTouchBar: Option<&NSTouchBar>); + + #[method(showsCloseButton)] + pub unsafe fn showsCloseButton(&self) -> bool; + + #[method(setShowsCloseButton:)] + pub unsafe fn setShowsCloseButton(&self, showsCloseButton: bool); + + #[method(showPopover:)] + pub unsafe fn showPopover(&self, sender: Option<&Object>); + + #[method(dismissPopover:)] + pub unsafe fn dismissPopover(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other makeStandardActivatePopoverGestureRecognizer)] + pub unsafe fn makeStandardActivatePopoverGestureRecognizer( + &self, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPredicateEditor.rs b/crates/icrate/src/generated/AppKit/NSPredicateEditor.rs new file mode 100644 index 000000000..ccaa15e32 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPredicateEditor.rs @@ -0,0 +1,25 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPredicateEditor; + + unsafe impl ClassType for NSPredicateEditor { + type Super = NSRuleEditor; + } +); + +extern_methods!( + unsafe impl NSPredicateEditor { + #[method_id(@__retain_semantics Other rowTemplates)] + pub unsafe fn rowTemplates(&self) -> Id, Shared>; + + #[method(setRowTemplates:)] + pub unsafe fn setRowTemplates(&self, rowTemplates: &NSArray); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPredicateEditorRowTemplate.rs b/crates/icrate/src/generated/AppKit/NSPredicateEditorRowTemplate.rs new file mode 100644 index 000000000..f7a5b2649 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPredicateEditorRowTemplate.rs @@ -0,0 +1,93 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPredicateEditorRowTemplate; + + unsafe impl ClassType for NSPredicateEditorRowTemplate { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPredicateEditorRowTemplate { + #[method(matchForPredicate:)] + pub unsafe fn matchForPredicate(&self, predicate: &NSPredicate) -> c_double; + + #[method_id(@__retain_semantics Other templateViews)] + pub unsafe fn templateViews(&self) -> Id, Shared>; + + #[method(setPredicate:)] + pub unsafe fn setPredicate(&self, predicate: &NSPredicate); + + #[method_id(@__retain_semantics Other predicateWithSubpredicates:)] + pub unsafe fn predicateWithSubpredicates( + &self, + subpredicates: Option<&NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Other displayableSubpredicatesOfPredicate:)] + pub unsafe fn displayableSubpredicatesOfPredicate( + &self, + predicate: &NSPredicate, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Init initWithLeftExpressions:rightExpressions:modifier:operators:options:)] + pub unsafe fn initWithLeftExpressions_rightExpressions_modifier_operators_options( + this: Option>, + leftExpressions: &NSArray, + rightExpressions: &NSArray, + modifier: NSComparisonPredicateModifier, + operators: &NSArray, + options: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithLeftExpressions:rightExpressionAttributeType:modifier:operators:options:)] + pub unsafe fn initWithLeftExpressions_rightExpressionAttributeType_modifier_operators_options( + this: Option>, + leftExpressions: &NSArray, + attributeType: NSAttributeType, + modifier: NSComparisonPredicateModifier, + operators: &NSArray, + options: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCompoundTypes:)] + pub unsafe fn initWithCompoundTypes( + this: Option>, + compoundTypes: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other leftExpressions)] + pub unsafe fn leftExpressions(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other rightExpressions)] + pub unsafe fn rightExpressions(&self) -> Option, Shared>>; + + #[method(rightExpressionAttributeType)] + pub unsafe fn rightExpressionAttributeType(&self) -> NSAttributeType; + + #[method(modifier)] + pub unsafe fn modifier(&self) -> NSComparisonPredicateModifier; + + #[method_id(@__retain_semantics Other operators)] + pub unsafe fn operators(&self) -> Option, Shared>>; + + #[method(options)] + pub unsafe fn options(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other compoundTypes)] + pub unsafe fn compoundTypes(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other templatesWithAttributeKeyPaths:inEntityDescription:)] + pub unsafe fn templatesWithAttributeKeyPaths_inEntityDescription( + keyPaths: &NSArray, + entityDescription: &NSEntityDescription, + ) -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPressGestureRecognizer.rs b/crates/icrate/src/generated/AppKit/NSPressGestureRecognizer.rs new file mode 100644 index 000000000..89ba74221 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPressGestureRecognizer.rs @@ -0,0 +1,43 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPressGestureRecognizer; + + unsafe impl ClassType for NSPressGestureRecognizer { + type Super = NSGestureRecognizer; + } +); + +extern_methods!( + unsafe impl NSPressGestureRecognizer { + #[method(buttonMask)] + pub unsafe fn buttonMask(&self) -> NSUInteger; + + #[method(setButtonMask:)] + pub unsafe fn setButtonMask(&self, buttonMask: NSUInteger); + + #[method(minimumPressDuration)] + pub unsafe fn minimumPressDuration(&self) -> NSTimeInterval; + + #[method(setMinimumPressDuration:)] + pub unsafe fn setMinimumPressDuration(&self, minimumPressDuration: NSTimeInterval); + + #[method(allowableMovement)] + pub unsafe fn allowableMovement(&self) -> CGFloat; + + #[method(setAllowableMovement:)] + pub unsafe fn setAllowableMovement(&self, allowableMovement: CGFloat); + + #[method(numberOfTouchesRequired)] + pub unsafe fn numberOfTouchesRequired(&self) -> NSInteger; + + #[method(setNumberOfTouchesRequired:)] + pub unsafe fn setNumberOfTouchesRequired(&self, numberOfTouchesRequired: NSInteger); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPressureConfiguration.rs b/crates/icrate/src/generated/AppKit/NSPressureConfiguration.rs new file mode 100644 index 000000000..457a92524 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPressureConfiguration.rs @@ -0,0 +1,45 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPressureConfiguration; + + unsafe impl ClassType for NSPressureConfiguration { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPressureConfiguration { + #[method(pressureBehavior)] + pub unsafe fn pressureBehavior(&self) -> NSPressureBehavior; + + #[method_id(@__retain_semantics Init initWithPressureBehavior:)] + pub unsafe fn initWithPressureBehavior( + this: Option>, + pressureBehavior: NSPressureBehavior, + ) -> Id; + + #[method(set)] + pub unsafe fn set(&self); + } +); + +extern_methods!( + /// NSPressureConfiguration + unsafe impl NSView { + #[method_id(@__retain_semantics Other pressureConfiguration)] + pub unsafe fn pressureConfiguration(&self) -> Option>; + + #[method(setPressureConfiguration:)] + pub unsafe fn setPressureConfiguration( + &self, + pressureConfiguration: Option<&NSPressureConfiguration>, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPrintInfo.rs b/crates/icrate/src/generated/AppKit/NSPrintInfo.rs new file mode 100644 index 000000000..6dcfe3113 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPrintInfo.rs @@ -0,0 +1,301 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPaperOrientation { + NSPaperOrientationPortrait = 0, + NSPaperOrientationLandscape = 1, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSPrintingPaginationMode { + NSPrintingPaginationModeAutomatic = 0, + NSPrintingPaginationModeFit = 1, + NSPrintingPaginationModeClip = 2, + } +); + +pub type NSPrintInfoAttributeKey = NSString; + +extern_static!(NSPrintPaperName: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintPaperSize: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintOrientation: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintScalingFactor: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintLeftMargin: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintRightMargin: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintTopMargin: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintBottomMargin: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintHorizontallyCentered: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintVerticallyCentered: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintHorizontalPagination: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintVerticalPagination: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintPrinter: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintCopies: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintAllPages: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintFirstPage: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintLastPage: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintMustCollate: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintReversePageOrder: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintJobDisposition: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintPagesAcross: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintPagesDown: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintTime: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintDetailedErrorReporting: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintFaxNumber: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintPrinterName: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintSelectionOnly: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintJobSavingURL: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintJobSavingFileNameExtensionHidden: &'static NSPrintInfoAttributeKey); + +extern_static!(NSPrintHeaderAndFooter: &'static NSPrintInfoAttributeKey); + +pub type NSPrintJobDispositionValue = NSString; + +extern_static!(NSPrintSpoolJob: &'static NSPrintJobDispositionValue); + +extern_static!(NSPrintPreviewJob: &'static NSPrintJobDispositionValue); + +extern_static!(NSPrintSaveJob: &'static NSPrintJobDispositionValue); + +extern_static!(NSPrintCancelJob: &'static NSPrintJobDispositionValue); + +pub type NSPrintInfoSettingKey = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSPrintInfo; + + unsafe impl ClassType for NSPrintInfo { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPrintInfo { + #[method_id(@__retain_semantics Other sharedPrintInfo)] + pub unsafe fn sharedPrintInfo() -> Id; + + #[method(setSharedPrintInfo:)] + pub unsafe fn setSharedPrintInfo(sharedPrintInfo: &NSPrintInfo); + + #[method_id(@__retain_semantics Init initWithDictionary:)] + pub unsafe fn initWithDictionary( + this: Option>, + attributes: &NSDictionary, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other dictionary)] + pub unsafe fn dictionary( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other paperName)] + pub unsafe fn paperName(&self) -> Option>; + + #[method(setPaperName:)] + pub unsafe fn setPaperName(&self, paperName: Option<&NSPrinterPaperName>); + + #[method(paperSize)] + pub unsafe fn paperSize(&self) -> NSSize; + + #[method(setPaperSize:)] + pub unsafe fn setPaperSize(&self, paperSize: NSSize); + + #[method(orientation)] + pub unsafe fn orientation(&self) -> NSPaperOrientation; + + #[method(setOrientation:)] + pub unsafe fn setOrientation(&self, orientation: NSPaperOrientation); + + #[method(scalingFactor)] + pub unsafe fn scalingFactor(&self) -> CGFloat; + + #[method(setScalingFactor:)] + pub unsafe fn setScalingFactor(&self, scalingFactor: CGFloat); + + #[method(leftMargin)] + pub unsafe fn leftMargin(&self) -> CGFloat; + + #[method(setLeftMargin:)] + pub unsafe fn setLeftMargin(&self, leftMargin: CGFloat); + + #[method(rightMargin)] + pub unsafe fn rightMargin(&self) -> CGFloat; + + #[method(setRightMargin:)] + pub unsafe fn setRightMargin(&self, rightMargin: CGFloat); + + #[method(topMargin)] + pub unsafe fn topMargin(&self) -> CGFloat; + + #[method(setTopMargin:)] + pub unsafe fn setTopMargin(&self, topMargin: CGFloat); + + #[method(bottomMargin)] + pub unsafe fn bottomMargin(&self) -> CGFloat; + + #[method(setBottomMargin:)] + pub unsafe fn setBottomMargin(&self, bottomMargin: CGFloat); + + #[method(isHorizontallyCentered)] + pub unsafe fn isHorizontallyCentered(&self) -> bool; + + #[method(setHorizontallyCentered:)] + pub unsafe fn setHorizontallyCentered(&self, horizontallyCentered: bool); + + #[method(isVerticallyCentered)] + pub unsafe fn isVerticallyCentered(&self) -> bool; + + #[method(setVerticallyCentered:)] + pub unsafe fn setVerticallyCentered(&self, verticallyCentered: bool); + + #[method(horizontalPagination)] + pub unsafe fn horizontalPagination(&self) -> NSPrintingPaginationMode; + + #[method(setHorizontalPagination:)] + pub unsafe fn setHorizontalPagination( + &self, + horizontalPagination: NSPrintingPaginationMode, + ); + + #[method(verticalPagination)] + pub unsafe fn verticalPagination(&self) -> NSPrintingPaginationMode; + + #[method(setVerticalPagination:)] + pub unsafe fn setVerticalPagination(&self, verticalPagination: NSPrintingPaginationMode); + + #[method_id(@__retain_semantics Other jobDisposition)] + pub unsafe fn jobDisposition(&self) -> Id; + + #[method(setJobDisposition:)] + pub unsafe fn setJobDisposition(&self, jobDisposition: &NSPrintJobDispositionValue); + + #[method_id(@__retain_semantics Other printer)] + pub unsafe fn printer(&self) -> Id; + + #[method(setPrinter:)] + pub unsafe fn setPrinter(&self, printer: &NSPrinter); + + #[method(setUpPrintOperationDefaultValues)] + pub unsafe fn setUpPrintOperationDefaultValues(&self); + + #[method(imageablePageBounds)] + pub unsafe fn imageablePageBounds(&self) -> NSRect; + + #[method_id(@__retain_semantics Other localizedPaperName)] + pub unsafe fn localizedPaperName(&self) -> Option>; + + #[method_id(@__retain_semantics Other defaultPrinter)] + pub unsafe fn defaultPrinter() -> Option>; + + #[method_id(@__retain_semantics Other printSettings)] + pub unsafe fn printSettings( + &self, + ) -> Id, Shared>; + + #[method(PMPrintSession)] + pub unsafe fn PMPrintSession(&self) -> NonNull; + + #[method(PMPageFormat)] + pub unsafe fn PMPageFormat(&self) -> NonNull; + + #[method(PMPrintSettings)] + pub unsafe fn PMPrintSettings(&self) -> NonNull; + + #[method(updateFromPMPageFormat)] + pub unsafe fn updateFromPMPageFormat(&self); + + #[method(updateFromPMPrintSettings)] + pub unsafe fn updateFromPMPrintSettings(&self); + + #[method(isSelectionOnly)] + pub unsafe fn isSelectionOnly(&self) -> bool; + + #[method(setSelectionOnly:)] + pub unsafe fn setSelectionOnly(&self, selectionOnly: bool); + + #[method(takeSettingsFromPDFInfo:)] + pub unsafe fn takeSettingsFromPDFInfo(&self, inPDFInfo: &NSPDFInfo); + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSPrintInfo { + #[method(setDefaultPrinter:)] + pub unsafe fn setDefaultPrinter(printer: Option<&NSPrinter>); + + #[method(sizeForPaperName:)] + pub unsafe fn sizeForPaperName(name: Option<&NSPrinterPaperName>) -> NSSize; + } +); + +extern_static!(NSPrintFormName: &'static NSString); + +extern_static!(NSPrintJobFeatures: &'static NSString); + +extern_static!(NSPrintManualFeed: &'static NSString); + +extern_static!(NSPrintPagesPerSheet: &'static NSString); + +extern_static!(NSPrintPaperFeed: &'static NSString); + +extern_static!(NSPrintSavePath: &'static NSString); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSPrintingOrientation { + NSPortraitOrientation = 0, + NSLandscapeOrientation = 1, + } +); + +extern_static!(NSAutoPagination: NSPrintingPaginationMode = NSPrintingPaginationModeAutomatic); + +extern_static!(NSFitPagination: NSPrintingPaginationMode = NSPrintingPaginationModeFit); + +extern_static!(NSClipPagination: NSPrintingPaginationMode = NSPrintingPaginationModeClip); diff --git a/crates/icrate/src/generated/AppKit/NSPrintOperation.rs b/crates/icrate/src/generated/AppKit/NSPrintOperation.rs new file mode 100644 index 000000000..95bfa9583 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPrintOperation.rs @@ -0,0 +1,213 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPrintingPageOrder { + NSDescendingPageOrder = -1, + NSSpecialPageOrder = 0, + NSAscendingPageOrder = 1, + NSUnknownPageOrder = 2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPrintRenderingQuality { + NSPrintRenderingQualityBest = 0, + NSPrintRenderingQualityResponsive = 1, + } +); + +extern_static!(NSPrintOperationExistsException: &'static NSExceptionName); + +extern_class!( + #[derive(Debug)] + pub struct NSPrintOperation; + + unsafe impl ClassType for NSPrintOperation { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPrintOperation { + #[method_id(@__retain_semantics Other printOperationWithView:printInfo:)] + pub unsafe fn printOperationWithView_printInfo( + view: &NSView, + printInfo: &NSPrintInfo, + ) -> Id; + + #[method_id(@__retain_semantics Other PDFOperationWithView:insideRect:toData:printInfo:)] + pub unsafe fn PDFOperationWithView_insideRect_toData_printInfo( + view: &NSView, + rect: NSRect, + data: &NSMutableData, + printInfo: &NSPrintInfo, + ) -> Id; + + #[method_id(@__retain_semantics Other PDFOperationWithView:insideRect:toPath:printInfo:)] + pub unsafe fn PDFOperationWithView_insideRect_toPath_printInfo( + view: &NSView, + rect: NSRect, + path: &NSString, + printInfo: &NSPrintInfo, + ) -> Id; + + #[method_id(@__retain_semantics Other EPSOperationWithView:insideRect:toData:printInfo:)] + pub unsafe fn EPSOperationWithView_insideRect_toData_printInfo( + view: &NSView, + rect: NSRect, + data: &NSMutableData, + printInfo: &NSPrintInfo, + ) -> Id; + + #[method_id(@__retain_semantics Other EPSOperationWithView:insideRect:toPath:printInfo:)] + pub unsafe fn EPSOperationWithView_insideRect_toPath_printInfo( + view: &NSView, + rect: NSRect, + path: &NSString, + printInfo: &NSPrintInfo, + ) -> Id; + + #[method_id(@__retain_semantics Other printOperationWithView:)] + pub unsafe fn printOperationWithView(view: &NSView) -> Id; + + #[method_id(@__retain_semantics Other PDFOperationWithView:insideRect:toData:)] + pub unsafe fn PDFOperationWithView_insideRect_toData( + view: &NSView, + rect: NSRect, + data: &NSMutableData, + ) -> Id; + + #[method_id(@__retain_semantics Other EPSOperationWithView:insideRect:toData:)] + pub unsafe fn EPSOperationWithView_insideRect_toData( + view: &NSView, + rect: NSRect, + data: Option<&NSMutableData>, + ) -> Id; + + #[method_id(@__retain_semantics Other currentOperation)] + pub unsafe fn currentOperation() -> Option>; + + #[method(setCurrentOperation:)] + pub unsafe fn setCurrentOperation(currentOperation: Option<&NSPrintOperation>); + + #[method(isCopyingOperation)] + pub unsafe fn isCopyingOperation(&self) -> bool; + + #[method(preferredRenderingQuality)] + pub unsafe fn preferredRenderingQuality(&self) -> NSPrintRenderingQuality; + + #[method_id(@__retain_semantics Other jobTitle)] + pub unsafe fn jobTitle(&self) -> Option>; + + #[method(setJobTitle:)] + pub unsafe fn setJobTitle(&self, jobTitle: Option<&NSString>); + + #[method(showsPrintPanel)] + pub unsafe fn showsPrintPanel(&self) -> bool; + + #[method(setShowsPrintPanel:)] + pub unsafe fn setShowsPrintPanel(&self, showsPrintPanel: bool); + + #[method(showsProgressPanel)] + pub unsafe fn showsProgressPanel(&self) -> bool; + + #[method(setShowsProgressPanel:)] + pub unsafe fn setShowsProgressPanel(&self, showsProgressPanel: bool); + + #[method_id(@__retain_semantics Other printPanel)] + pub unsafe fn printPanel(&self) -> Id; + + #[method(setPrintPanel:)] + pub unsafe fn setPrintPanel(&self, printPanel: &NSPrintPanel); + + #[method_id(@__retain_semantics Other PDFPanel)] + pub unsafe fn PDFPanel(&self) -> Id; + + #[method(setPDFPanel:)] + pub unsafe fn setPDFPanel(&self, PDFPanel: &NSPDFPanel); + + #[method(canSpawnSeparateThread)] + pub unsafe fn canSpawnSeparateThread(&self) -> bool; + + #[method(setCanSpawnSeparateThread:)] + pub unsafe fn setCanSpawnSeparateThread(&self, canSpawnSeparateThread: bool); + + #[method(pageOrder)] + pub unsafe fn pageOrder(&self) -> NSPrintingPageOrder; + + #[method(setPageOrder:)] + pub unsafe fn setPageOrder(&self, pageOrder: NSPrintingPageOrder); + + #[method(runOperationModalForWindow:delegate:didRunSelector:contextInfo:)] + pub unsafe fn runOperationModalForWindow_delegate_didRunSelector_contextInfo( + &self, + docWindow: &NSWindow, + delegate: Option<&Object>, + didRunSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(runOperation)] + pub unsafe fn runOperation(&self) -> bool; + + #[method_id(@__retain_semantics Other view)] + pub unsafe fn view(&self) -> Option>; + + #[method_id(@__retain_semantics Other printInfo)] + pub unsafe fn printInfo(&self) -> Id; + + #[method(setPrintInfo:)] + pub unsafe fn setPrintInfo(&self, printInfo: &NSPrintInfo); + + #[method_id(@__retain_semantics Other context)] + pub unsafe fn context(&self) -> Option>; + + #[method(pageRange)] + pub unsafe fn pageRange(&self) -> NSRange; + + #[method(currentPage)] + pub unsafe fn currentPage(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other createContext)] + pub unsafe fn createContext(&self) -> Option>; + + #[method(destroyContext)] + pub unsafe fn destroyContext(&self); + + #[method(deliverResult)] + pub unsafe fn deliverResult(&self) -> bool; + + #[method(cleanUpOperation)] + pub unsafe fn cleanUpOperation(&self); + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSPrintOperation { + #[method(setAccessoryView:)] + pub unsafe fn setAccessoryView(&self, view: Option<&NSView>); + + #[method_id(@__retain_semantics Other accessoryView)] + pub unsafe fn accessoryView(&self) -> Option>; + + #[method(setJobStyleHint:)] + pub unsafe fn setJobStyleHint(&self, hint: Option<&NSString>); + + #[method_id(@__retain_semantics Other jobStyleHint)] + pub unsafe fn jobStyleHint(&self) -> Option>; + + #[method(setShowPanels:)] + pub unsafe fn setShowPanels(&self, flag: bool); + + #[method(showPanels)] + pub unsafe fn showPanels(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPrintPanel.rs b/crates/icrate/src/generated/AppKit/NSPrintPanel.rs new file mode 100644 index 000000000..48497c3d7 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPrintPanel.rs @@ -0,0 +1,136 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSPrintPanelOptions { + NSPrintPanelShowsCopies = 1 << 0, + NSPrintPanelShowsPageRange = 1 << 1, + NSPrintPanelShowsPaperSize = 1 << 2, + NSPrintPanelShowsOrientation = 1 << 3, + NSPrintPanelShowsScaling = 1 << 4, + NSPrintPanelShowsPrintSelection = 1 << 5, + NSPrintPanelShowsPageSetupAccessory = 1 << 8, + NSPrintPanelShowsPreview = 1 << 17, + } +); + +pub type NSPrintPanelJobStyleHint = NSString; + +extern_static!(NSPrintPhotoJobStyleHint: &'static NSPrintPanelJobStyleHint); + +extern_static!(NSPrintAllPresetsJobStyleHint: &'static NSPrintPanelJobStyleHint); + +extern_static!(NSPrintNoPresetsJobStyleHint: &'static NSPrintPanelJobStyleHint); + +pub type NSPrintPanelAccessorySummaryKey = NSString; + +extern_static!(NSPrintPanelAccessorySummaryItemNameKey: &'static NSPrintPanelAccessorySummaryKey); + +extern_static!( + NSPrintPanelAccessorySummaryItemDescriptionKey: &'static NSPrintPanelAccessorySummaryKey +); + +extern_protocol!( + pub struct NSPrintPanelAccessorizing; + + unsafe impl NSPrintPanelAccessorizing { + #[method_id(@__retain_semantics Other localizedSummaryItems)] + pub unsafe fn localizedSummaryItems( + &self, + ) -> Id>, Shared>; + + #[optional] + #[method_id(@__retain_semantics Other keyPathsForValuesAffectingPreview)] + pub unsafe fn keyPathsForValuesAffectingPreview(&self) -> Id, Shared>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPrintPanel; + + unsafe impl ClassType for NSPrintPanel { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPrintPanel { + #[method_id(@__retain_semantics Other printPanel)] + pub unsafe fn printPanel() -> Id; + + #[method(addAccessoryController:)] + pub unsafe fn addAccessoryController(&self, accessoryController: &TodoProtocols); + + #[method(removeAccessoryController:)] + pub unsafe fn removeAccessoryController(&self, accessoryController: &TodoProtocols); + + #[method_id(@__retain_semantics Other accessoryControllers)] + pub unsafe fn accessoryControllers(&self) -> Id, Shared>; + + #[method(options)] + pub unsafe fn options(&self) -> NSPrintPanelOptions; + + #[method(setOptions:)] + pub unsafe fn setOptions(&self, options: NSPrintPanelOptions); + + #[method(setDefaultButtonTitle:)] + pub unsafe fn setDefaultButtonTitle(&self, defaultButtonTitle: Option<&NSString>); + + #[method_id(@__retain_semantics Other defaultButtonTitle)] + pub unsafe fn defaultButtonTitle(&self) -> Option>; + + #[method_id(@__retain_semantics Other helpAnchor)] + pub unsafe fn helpAnchor(&self) -> Option>; + + #[method(setHelpAnchor:)] + pub unsafe fn setHelpAnchor(&self, helpAnchor: Option<&NSHelpAnchorName>); + + #[method_id(@__retain_semantics Other jobStyleHint)] + pub unsafe fn jobStyleHint(&self) -> Option>; + + #[method(setJobStyleHint:)] + pub unsafe fn setJobStyleHint(&self, jobStyleHint: Option<&NSPrintPanelJobStyleHint>); + + #[method(beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:)] + pub unsafe fn beginSheetWithPrintInfo_modalForWindow_delegate_didEndSelector_contextInfo( + &self, + printInfo: &NSPrintInfo, + docWindow: &NSWindow, + delegate: Option<&Object>, + didEndSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(runModalWithPrintInfo:)] + pub unsafe fn runModalWithPrintInfo(&self, printInfo: &NSPrintInfo) -> NSInteger; + + #[method(runModal)] + pub unsafe fn runModal(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other printInfo)] + pub unsafe fn printInfo(&self) -> Id; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSPrintPanel { + #[method(setAccessoryView:)] + pub unsafe fn setAccessoryView(&self, accessoryView: Option<&NSView>); + + #[method_id(@__retain_semantics Other accessoryView)] + pub unsafe fn accessoryView(&self) -> Option>; + + #[method(updateFromPrintInfo)] + pub unsafe fn updateFromPrintInfo(&self); + + #[method(finalWritePrintInfo)] + pub unsafe fn finalWritePrintInfo(&self); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSPrinter.rs b/crates/icrate/src/generated/AppKit/NSPrinter.rs new file mode 100644 index 000000000..494ba4bdf --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSPrinter.rs @@ -0,0 +1,142 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSPrinterTableStatus { + NSPrinterTableOK = 0, + NSPrinterTableNotFound = 1, + NSPrinterTableError = 2, + } +); + +pub type NSPrinterTypeName = NSString; + +pub type NSPrinterPaperName = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSPrinter; + + unsafe impl ClassType for NSPrinter { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPrinter { + #[method_id(@__retain_semantics Other printerNames)] + pub unsafe fn printerNames() -> Id, Shared>; + + #[method_id(@__retain_semantics Other printerTypes)] + pub unsafe fn printerTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other printerWithName:)] + pub unsafe fn printerWithName(name: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other printerWithType:)] + pub unsafe fn printerWithType(type_: &NSPrinterTypeName) -> Option>; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other type)] + pub unsafe fn type_(&self) -> Id; + + #[method(languageLevel)] + pub unsafe fn languageLevel(&self) -> NSInteger; + + #[method(pageSizeForPaper:)] + pub unsafe fn pageSizeForPaper(&self, paperName: &NSPrinterPaperName) -> NSSize; + + #[method_id(@__retain_semantics Other deviceDescription)] + pub unsafe fn deviceDescription( + &self, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSPrinter { + #[method(statusForTable:)] + pub unsafe fn statusForTable(&self, tableName: &NSString) -> NSPrinterTableStatus; + + #[method(isKey:inTable:)] + pub unsafe fn isKey_inTable(&self, key: Option<&NSString>, table: &NSString) -> bool; + + #[method(booleanForKey:inTable:)] + pub unsafe fn booleanForKey_inTable( + &self, + key: Option<&NSString>, + table: &NSString, + ) -> bool; + + #[method(floatForKey:inTable:)] + pub unsafe fn floatForKey_inTable( + &self, + key: Option<&NSString>, + table: &NSString, + ) -> c_float; + + #[method(intForKey:inTable:)] + pub unsafe fn intForKey_inTable(&self, key: Option<&NSString>, table: &NSString) -> c_int; + + #[method(rectForKey:inTable:)] + pub unsafe fn rectForKey_inTable(&self, key: Option<&NSString>, table: &NSString) + -> NSRect; + + #[method(sizeForKey:inTable:)] + pub unsafe fn sizeForKey_inTable(&self, key: Option<&NSString>, table: &NSString) + -> NSSize; + + #[method_id(@__retain_semantics Other stringForKey:inTable:)] + pub unsafe fn stringForKey_inTable( + &self, + key: Option<&NSString>, + table: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other stringListForKey:inTable:)] + pub unsafe fn stringListForKey_inTable( + &self, + key: Option<&NSString>, + table: &NSString, + ) -> Option>; + + #[method(imageRectForPaper:)] + pub unsafe fn imageRectForPaper(&self, paperName: Option<&NSString>) -> NSRect; + + #[method(acceptsBinary)] + pub unsafe fn acceptsBinary(&self) -> bool; + + #[method(isColor)] + pub unsafe fn isColor(&self) -> bool; + + #[method(isFontAvailable:)] + pub unsafe fn isFontAvailable(&self, faceName: Option<&NSString>) -> bool; + + #[method(isOutputStackInReverseOrder)] + pub unsafe fn isOutputStackInReverseOrder(&self) -> bool; + + #[method_id(@__retain_semantics Other printerWithName:domain:includeUnavailable:)] + pub unsafe fn printerWithName_domain_includeUnavailable( + name: &NSString, + domain: Option<&NSString>, + flag: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other domain)] + pub unsafe fn domain(&self) -> Id; + + #[method_id(@__retain_semantics Other host)] + pub unsafe fn host(&self) -> Id; + + #[method_id(@__retain_semantics Other note)] + pub unsafe fn note(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSProgressIndicator.rs b/crates/icrate/src/generated/AppKit/NSProgressIndicator.rs new file mode 100644 index 000000000..5603f94ab --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSProgressIndicator.rs @@ -0,0 +1,129 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSProgressIndicatorStyle { + NSProgressIndicatorStyleBar = 0, + NSProgressIndicatorStyleSpinning = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSProgressIndicator; + + unsafe impl ClassType for NSProgressIndicator { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSProgressIndicator { + #[method(isIndeterminate)] + pub unsafe fn isIndeterminate(&self) -> bool; + + #[method(setIndeterminate:)] + pub unsafe fn setIndeterminate(&self, indeterminate: bool); + + #[method(isBezeled)] + pub unsafe fn isBezeled(&self) -> bool; + + #[method(setBezeled:)] + pub unsafe fn setBezeled(&self, bezeled: bool); + + #[method(controlTint)] + pub unsafe fn controlTint(&self) -> NSControlTint; + + #[method(setControlTint:)] + pub unsafe fn setControlTint(&self, controlTint: NSControlTint); + + #[method(controlSize)] + pub unsafe fn controlSize(&self) -> NSControlSize; + + #[method(setControlSize:)] + pub unsafe fn setControlSize(&self, controlSize: NSControlSize); + + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + + #[method(setDoubleValue:)] + pub unsafe fn setDoubleValue(&self, doubleValue: c_double); + + #[method(incrementBy:)] + pub unsafe fn incrementBy(&self, delta: c_double); + + #[method(minValue)] + pub unsafe fn minValue(&self) -> c_double; + + #[method(setMinValue:)] + pub unsafe fn setMinValue(&self, minValue: c_double); + + #[method(maxValue)] + pub unsafe fn maxValue(&self) -> c_double; + + #[method(setMaxValue:)] + pub unsafe fn setMaxValue(&self, maxValue: c_double); + + #[method(usesThreadedAnimation)] + pub unsafe fn usesThreadedAnimation(&self) -> bool; + + #[method(setUsesThreadedAnimation:)] + pub unsafe fn setUsesThreadedAnimation(&self, usesThreadedAnimation: bool); + + #[method(startAnimation:)] + pub unsafe fn startAnimation(&self, sender: Option<&Object>); + + #[method(stopAnimation:)] + pub unsafe fn stopAnimation(&self, sender: Option<&Object>); + + #[method(style)] + pub unsafe fn style(&self) -> NSProgressIndicatorStyle; + + #[method(setStyle:)] + pub unsafe fn setStyle(&self, style: NSProgressIndicatorStyle); + + #[method(sizeToFit)] + pub unsafe fn sizeToFit(&self); + + #[method(isDisplayedWhenStopped)] + pub unsafe fn isDisplayedWhenStopped(&self) -> bool; + + #[method(setDisplayedWhenStopped:)] + pub unsafe fn setDisplayedWhenStopped(&self, displayedWhenStopped: bool); + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSProgressIndicatorThickness { + NSProgressIndicatorPreferredThickness = 14, + NSProgressIndicatorPreferredSmallThickness = 10, + NSProgressIndicatorPreferredLargeThickness = 18, + NSProgressIndicatorPreferredAquaThickness = 12, + } +); + +extern_static!(NSProgressIndicatorBarStyle: NSProgressIndicatorStyle = NSProgressIndicatorStyleBar); + +extern_static!( + NSProgressIndicatorSpinningStyle: NSProgressIndicatorStyle = NSProgressIndicatorStyleSpinning +); + +extern_methods!( + /// NSProgressIndicatorDeprecated + unsafe impl NSProgressIndicator { + #[method(animationDelay)] + pub unsafe fn animationDelay(&self) -> NSTimeInterval; + + #[method(setAnimationDelay:)] + pub unsafe fn setAnimationDelay(&self, delay: NSTimeInterval); + + #[method(animate:)] + pub unsafe fn animate(&self, sender: Option<&Object>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSResponder.rs b/crates/icrate/src/generated/AppKit/NSResponder.rs new file mode 100644 index 000000000..246c4e5dd --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSResponder.rs @@ -0,0 +1,648 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSResponder; + + unsafe impl ClassType for NSResponder { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSResponder { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other nextResponder)] + pub unsafe fn nextResponder(&self) -> Option>; + + #[method(setNextResponder:)] + pub unsafe fn setNextResponder(&self, nextResponder: Option<&NSResponder>); + + #[method(tryToPerform:with:)] + pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&Object>) -> bool; + + #[method(performKeyEquivalent:)] + pub unsafe fn performKeyEquivalent(&self, event: &NSEvent) -> bool; + + #[method_id(@__retain_semantics Other validRequestorForSendType:returnType:)] + pub unsafe fn validRequestorForSendType_returnType( + &self, + sendType: Option<&NSPasteboardType>, + returnType: Option<&NSPasteboardType>, + ) -> Option>; + + #[method(mouseDown:)] + pub unsafe fn mouseDown(&self, event: &NSEvent); + + #[method(rightMouseDown:)] + pub unsafe fn rightMouseDown(&self, event: &NSEvent); + + #[method(otherMouseDown:)] + pub unsafe fn otherMouseDown(&self, event: &NSEvent); + + #[method(mouseUp:)] + pub unsafe fn mouseUp(&self, event: &NSEvent); + + #[method(rightMouseUp:)] + pub unsafe fn rightMouseUp(&self, event: &NSEvent); + + #[method(otherMouseUp:)] + pub unsafe fn otherMouseUp(&self, event: &NSEvent); + + #[method(mouseMoved:)] + pub unsafe fn mouseMoved(&self, event: &NSEvent); + + #[method(mouseDragged:)] + pub unsafe fn mouseDragged(&self, event: &NSEvent); + + #[method(scrollWheel:)] + pub unsafe fn scrollWheel(&self, event: &NSEvent); + + #[method(rightMouseDragged:)] + pub unsafe fn rightMouseDragged(&self, event: &NSEvent); + + #[method(otherMouseDragged:)] + pub unsafe fn otherMouseDragged(&self, event: &NSEvent); + + #[method(mouseEntered:)] + pub unsafe fn mouseEntered(&self, event: &NSEvent); + + #[method(mouseExited:)] + pub unsafe fn mouseExited(&self, event: &NSEvent); + + #[method(keyDown:)] + pub unsafe fn keyDown(&self, event: &NSEvent); + + #[method(keyUp:)] + pub unsafe fn keyUp(&self, event: &NSEvent); + + #[method(flagsChanged:)] + pub unsafe fn flagsChanged(&self, event: &NSEvent); + + #[method(tabletPoint:)] + pub unsafe fn tabletPoint(&self, event: &NSEvent); + + #[method(tabletProximity:)] + pub unsafe fn tabletProximity(&self, event: &NSEvent); + + #[method(cursorUpdate:)] + pub unsafe fn cursorUpdate(&self, event: &NSEvent); + + #[method(magnifyWithEvent:)] + pub unsafe fn magnifyWithEvent(&self, event: &NSEvent); + + #[method(rotateWithEvent:)] + pub unsafe fn rotateWithEvent(&self, event: &NSEvent); + + #[method(swipeWithEvent:)] + pub unsafe fn swipeWithEvent(&self, event: &NSEvent); + + #[method(beginGestureWithEvent:)] + pub unsafe fn beginGestureWithEvent(&self, event: &NSEvent); + + #[method(endGestureWithEvent:)] + pub unsafe fn endGestureWithEvent(&self, event: &NSEvent); + + #[method(smartMagnifyWithEvent:)] + pub unsafe fn smartMagnifyWithEvent(&self, event: &NSEvent); + + #[method(changeModeWithEvent:)] + pub unsafe fn changeModeWithEvent(&self, event: &NSEvent); + + #[method(touchesBeganWithEvent:)] + pub unsafe fn touchesBeganWithEvent(&self, event: &NSEvent); + + #[method(touchesMovedWithEvent:)] + pub unsafe fn touchesMovedWithEvent(&self, event: &NSEvent); + + #[method(touchesEndedWithEvent:)] + pub unsafe fn touchesEndedWithEvent(&self, event: &NSEvent); + + #[method(touchesCancelledWithEvent:)] + pub unsafe fn touchesCancelledWithEvent(&self, event: &NSEvent); + + #[method(quickLookWithEvent:)] + pub unsafe fn quickLookWithEvent(&self, event: &NSEvent); + + #[method(pressureChangeWithEvent:)] + pub unsafe fn pressureChangeWithEvent(&self, event: &NSEvent); + + #[method(noResponderFor:)] + pub unsafe fn noResponderFor(&self, eventSelector: Sel); + + #[method(acceptsFirstResponder)] + pub unsafe fn acceptsFirstResponder(&self) -> bool; + + #[method(becomeFirstResponder)] + pub unsafe fn becomeFirstResponder(&self) -> bool; + + #[method(resignFirstResponder)] + pub unsafe fn resignFirstResponder(&self) -> bool; + + #[method(interpretKeyEvents:)] + pub unsafe fn interpretKeyEvents(&self, eventArray: &NSArray); + + #[method(flushBufferedKeyEvents)] + pub unsafe fn flushBufferedKeyEvents(&self); + + #[method_id(@__retain_semantics Other menu)] + pub unsafe fn menu(&self) -> Option>; + + #[method(setMenu:)] + pub unsafe fn setMenu(&self, menu: Option<&NSMenu>); + + #[method(showContextHelp:)] + pub unsafe fn showContextHelp(&self, sender: Option<&Object>); + + #[method(helpRequested:)] + pub unsafe fn helpRequested(&self, eventPtr: &NSEvent); + + #[method(shouldBeTreatedAsInkEvent:)] + pub unsafe fn shouldBeTreatedAsInkEvent(&self, event: &NSEvent) -> bool; + + #[method(wantsScrollEventsForSwipeTrackingOnAxis:)] + pub unsafe fn wantsScrollEventsForSwipeTrackingOnAxis( + &self, + axis: NSEventGestureAxis, + ) -> bool; + + #[method(wantsForwardedScrollEventsForAxis:)] + pub unsafe fn wantsForwardedScrollEventsForAxis(&self, axis: NSEventGestureAxis) -> bool; + + #[method_id(@__retain_semantics Other supplementalTargetForAction:sender:)] + pub unsafe fn supplementalTargetForAction_sender( + &self, + action: Sel, + sender: Option<&Object>, + ) -> Option>; + } +); + +extern_protocol!( + pub struct NSStandardKeyBindingResponding; + + unsafe impl NSStandardKeyBindingResponding { + #[optional] + #[method(insertText:)] + pub unsafe fn insertText(&self, insertString: &Object); + + #[optional] + #[method(doCommandBySelector:)] + pub unsafe fn doCommandBySelector(&self, selector: Sel); + + #[optional] + #[method(moveForward:)] + pub unsafe fn moveForward(&self, sender: Option<&Object>); + + #[optional] + #[method(moveRight:)] + pub unsafe fn moveRight(&self, sender: Option<&Object>); + + #[optional] + #[method(moveBackward:)] + pub unsafe fn moveBackward(&self, sender: Option<&Object>); + + #[optional] + #[method(moveLeft:)] + pub unsafe fn moveLeft(&self, sender: Option<&Object>); + + #[optional] + #[method(moveUp:)] + pub unsafe fn moveUp(&self, sender: Option<&Object>); + + #[optional] + #[method(moveDown:)] + pub unsafe fn moveDown(&self, sender: Option<&Object>); + + #[optional] + #[method(moveWordForward:)] + pub unsafe fn moveWordForward(&self, sender: Option<&Object>); + + #[optional] + #[method(moveWordBackward:)] + pub unsafe fn moveWordBackward(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToBeginningOfLine:)] + pub unsafe fn moveToBeginningOfLine(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToEndOfLine:)] + pub unsafe fn moveToEndOfLine(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToBeginningOfParagraph:)] + pub unsafe fn moveToBeginningOfParagraph(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToEndOfParagraph:)] + pub unsafe fn moveToEndOfParagraph(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToEndOfDocument:)] + pub unsafe fn moveToEndOfDocument(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToBeginningOfDocument:)] + pub unsafe fn moveToBeginningOfDocument(&self, sender: Option<&Object>); + + #[optional] + #[method(pageDown:)] + pub unsafe fn pageDown(&self, sender: Option<&Object>); + + #[optional] + #[method(pageUp:)] + pub unsafe fn pageUp(&self, sender: Option<&Object>); + + #[optional] + #[method(centerSelectionInVisibleArea:)] + pub unsafe fn centerSelectionInVisibleArea(&self, sender: Option<&Object>); + + #[optional] + #[method(moveBackwardAndModifySelection:)] + pub unsafe fn moveBackwardAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveForwardAndModifySelection:)] + pub unsafe fn moveForwardAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveWordForwardAndModifySelection:)] + pub unsafe fn moveWordForwardAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveWordBackwardAndModifySelection:)] + pub unsafe fn moveWordBackwardAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveUpAndModifySelection:)] + pub unsafe fn moveUpAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveDownAndModifySelection:)] + pub unsafe fn moveDownAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToBeginningOfLineAndModifySelection:)] + pub unsafe fn moveToBeginningOfLineAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToEndOfLineAndModifySelection:)] + pub unsafe fn moveToEndOfLineAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToBeginningOfParagraphAndModifySelection:)] + pub unsafe fn moveToBeginningOfParagraphAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToEndOfParagraphAndModifySelection:)] + pub unsafe fn moveToEndOfParagraphAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToEndOfDocumentAndModifySelection:)] + pub unsafe fn moveToEndOfDocumentAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToBeginningOfDocumentAndModifySelection:)] + pub unsafe fn moveToBeginningOfDocumentAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(pageDownAndModifySelection:)] + pub unsafe fn pageDownAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(pageUpAndModifySelection:)] + pub unsafe fn pageUpAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveParagraphForwardAndModifySelection:)] + pub unsafe fn moveParagraphForwardAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveParagraphBackwardAndModifySelection:)] + pub unsafe fn moveParagraphBackwardAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveWordRight:)] + pub unsafe fn moveWordRight(&self, sender: Option<&Object>); + + #[optional] + #[method(moveWordLeft:)] + pub unsafe fn moveWordLeft(&self, sender: Option<&Object>); + + #[optional] + #[method(moveRightAndModifySelection:)] + pub unsafe fn moveRightAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveLeftAndModifySelection:)] + pub unsafe fn moveLeftAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveWordRightAndModifySelection:)] + pub unsafe fn moveWordRightAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveWordLeftAndModifySelection:)] + pub unsafe fn moveWordLeftAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToLeftEndOfLine:)] + pub unsafe fn moveToLeftEndOfLine(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToRightEndOfLine:)] + pub unsafe fn moveToRightEndOfLine(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToLeftEndOfLineAndModifySelection:)] + pub unsafe fn moveToLeftEndOfLineAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(moveToRightEndOfLineAndModifySelection:)] + pub unsafe fn moveToRightEndOfLineAndModifySelection(&self, sender: Option<&Object>); + + #[optional] + #[method(scrollPageUp:)] + pub unsafe fn scrollPageUp(&self, sender: Option<&Object>); + + #[optional] + #[method(scrollPageDown:)] + pub unsafe fn scrollPageDown(&self, sender: Option<&Object>); + + #[optional] + #[method(scrollLineUp:)] + pub unsafe fn scrollLineUp(&self, sender: Option<&Object>); + + #[optional] + #[method(scrollLineDown:)] + pub unsafe fn scrollLineDown(&self, sender: Option<&Object>); + + #[optional] + #[method(scrollToBeginningOfDocument:)] + pub unsafe fn scrollToBeginningOfDocument(&self, sender: Option<&Object>); + + #[optional] + #[method(scrollToEndOfDocument:)] + pub unsafe fn scrollToEndOfDocument(&self, sender: Option<&Object>); + + #[optional] + #[method(transpose:)] + pub unsafe fn transpose(&self, sender: Option<&Object>); + + #[optional] + #[method(transposeWords:)] + pub unsafe fn transposeWords(&self, sender: Option<&Object>); + + #[optional] + #[method(selectAll:)] + pub unsafe fn selectAll(&self, sender: Option<&Object>); + + #[optional] + #[method(selectParagraph:)] + pub unsafe fn selectParagraph(&self, sender: Option<&Object>); + + #[optional] + #[method(selectLine:)] + pub unsafe fn selectLine(&self, sender: Option<&Object>); + + #[optional] + #[method(selectWord:)] + pub unsafe fn selectWord(&self, sender: Option<&Object>); + + #[optional] + #[method(indent:)] + pub unsafe fn indent(&self, sender: Option<&Object>); + + #[optional] + #[method(insertTab:)] + pub unsafe fn insertTab(&self, sender: Option<&Object>); + + #[optional] + #[method(insertBacktab:)] + pub unsafe fn insertBacktab(&self, sender: Option<&Object>); + + #[optional] + #[method(insertNewline:)] + pub unsafe fn insertNewline(&self, sender: Option<&Object>); + + #[optional] + #[method(insertParagraphSeparator:)] + pub unsafe fn insertParagraphSeparator(&self, sender: Option<&Object>); + + #[optional] + #[method(insertNewlineIgnoringFieldEditor:)] + pub unsafe fn insertNewlineIgnoringFieldEditor(&self, sender: Option<&Object>); + + #[optional] + #[method(insertTabIgnoringFieldEditor:)] + pub unsafe fn insertTabIgnoringFieldEditor(&self, sender: Option<&Object>); + + #[optional] + #[method(insertLineBreak:)] + pub unsafe fn insertLineBreak(&self, sender: Option<&Object>); + + #[optional] + #[method(insertContainerBreak:)] + pub unsafe fn insertContainerBreak(&self, sender: Option<&Object>); + + #[optional] + #[method(insertSingleQuoteIgnoringSubstitution:)] + pub unsafe fn insertSingleQuoteIgnoringSubstitution(&self, sender: Option<&Object>); + + #[optional] + #[method(insertDoubleQuoteIgnoringSubstitution:)] + pub unsafe fn insertDoubleQuoteIgnoringSubstitution(&self, sender: Option<&Object>); + + #[optional] + #[method(changeCaseOfLetter:)] + pub unsafe fn changeCaseOfLetter(&self, sender: Option<&Object>); + + #[optional] + #[method(uppercaseWord:)] + pub unsafe fn uppercaseWord(&self, sender: Option<&Object>); + + #[optional] + #[method(lowercaseWord:)] + pub unsafe fn lowercaseWord(&self, sender: Option<&Object>); + + #[optional] + #[method(capitalizeWord:)] + pub unsafe fn capitalizeWord(&self, sender: Option<&Object>); + + #[optional] + #[method(deleteForward:)] + pub unsafe fn deleteForward(&self, sender: Option<&Object>); + + #[optional] + #[method(deleteBackward:)] + pub unsafe fn deleteBackward(&self, sender: Option<&Object>); + + #[optional] + #[method(deleteBackwardByDecomposingPreviousCharacter:)] + pub unsafe fn deleteBackwardByDecomposingPreviousCharacter(&self, sender: Option<&Object>); + + #[optional] + #[method(deleteWordForward:)] + pub unsafe fn deleteWordForward(&self, sender: Option<&Object>); + + #[optional] + #[method(deleteWordBackward:)] + pub unsafe fn deleteWordBackward(&self, sender: Option<&Object>); + + #[optional] + #[method(deleteToBeginningOfLine:)] + pub unsafe fn deleteToBeginningOfLine(&self, sender: Option<&Object>); + + #[optional] + #[method(deleteToEndOfLine:)] + pub unsafe fn deleteToEndOfLine(&self, sender: Option<&Object>); + + #[optional] + #[method(deleteToBeginningOfParagraph:)] + pub unsafe fn deleteToBeginningOfParagraph(&self, sender: Option<&Object>); + + #[optional] + #[method(deleteToEndOfParagraph:)] + pub unsafe fn deleteToEndOfParagraph(&self, sender: Option<&Object>); + + #[optional] + #[method(yank:)] + pub unsafe fn yank(&self, sender: Option<&Object>); + + #[optional] + #[method(complete:)] + pub unsafe fn complete(&self, sender: Option<&Object>); + + #[optional] + #[method(setMark:)] + pub unsafe fn setMark(&self, sender: Option<&Object>); + + #[optional] + #[method(deleteToMark:)] + pub unsafe fn deleteToMark(&self, sender: Option<&Object>); + + #[optional] + #[method(selectToMark:)] + pub unsafe fn selectToMark(&self, sender: Option<&Object>); + + #[optional] + #[method(swapWithMark:)] + pub unsafe fn swapWithMark(&self, sender: Option<&Object>); + + #[optional] + #[method(cancelOperation:)] + pub unsafe fn cancelOperation(&self, sender: Option<&Object>); + + #[optional] + #[method(makeBaseWritingDirectionNatural:)] + pub unsafe fn makeBaseWritingDirectionNatural(&self, sender: Option<&Object>); + + #[optional] + #[method(makeBaseWritingDirectionLeftToRight:)] + pub unsafe fn makeBaseWritingDirectionLeftToRight(&self, sender: Option<&Object>); + + #[optional] + #[method(makeBaseWritingDirectionRightToLeft:)] + pub unsafe fn makeBaseWritingDirectionRightToLeft(&self, sender: Option<&Object>); + + #[optional] + #[method(makeTextWritingDirectionNatural:)] + pub unsafe fn makeTextWritingDirectionNatural(&self, sender: Option<&Object>); + + #[optional] + #[method(makeTextWritingDirectionLeftToRight:)] + pub unsafe fn makeTextWritingDirectionLeftToRight(&self, sender: Option<&Object>); + + #[optional] + #[method(makeTextWritingDirectionRightToLeft:)] + pub unsafe fn makeTextWritingDirectionRightToLeft(&self, sender: Option<&Object>); + + #[optional] + #[method(quickLookPreviewItems:)] + pub unsafe fn quickLookPreviewItems(&self, sender: Option<&Object>); + } +); + +extern_methods!( + /// NSStandardKeyBindingMethods + unsafe impl NSResponder {} +); + +extern_methods!( + /// NSUndoSupport + unsafe impl NSResponder { + #[method_id(@__retain_semantics Other undoManager)] + pub unsafe fn undoManager(&self) -> Option>; + } +); + +extern_methods!( + /// NSControlEditingSupport + unsafe impl NSResponder { + #[method(validateProposedFirstResponder:forEvent:)] + pub unsafe fn validateProposedFirstResponder_forEvent( + &self, + responder: &NSResponder, + event: Option<&NSEvent>, + ) -> bool; + } +); + +extern_methods!( + /// NSErrorPresentation + unsafe impl NSResponder { + #[method(presentError:modalForWindow:delegate:didPresentSelector:contextInfo:)] + pub unsafe fn presentError_modalForWindow_delegate_didPresentSelector_contextInfo( + &self, + error: &NSError, + window: &NSWindow, + delegate: Option<&Object>, + didPresentSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(presentError:)] + pub unsafe fn presentError(&self, error: &NSError) -> bool; + + #[method_id(@__retain_semantics Other willPresentError:)] + pub unsafe fn willPresentError(&self, error: &NSError) -> Id; + } +); + +extern_methods!( + /// NSTextFinderSupport + unsafe impl NSResponder { + #[method(performTextFinderAction:)] + pub unsafe fn performTextFinderAction(&self, sender: Option<&Object>); + } +); + +extern_methods!( + /// NSWindowTabbing + unsafe impl NSResponder { + #[method(newWindowForTab:)] + pub unsafe fn newWindowForTab(&self, sender: Option<&Object>); + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSResponder { + #[method(performMnemonic:)] + pub unsafe fn performMnemonic(&self, string: &NSString) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSRotationGestureRecognizer.rs b/crates/icrate/src/generated/AppKit/NSRotationGestureRecognizer.rs new file mode 100644 index 000000000..eb9243e1a --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSRotationGestureRecognizer.rs @@ -0,0 +1,31 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSRotationGestureRecognizer; + + unsafe impl ClassType for NSRotationGestureRecognizer { + type Super = NSGestureRecognizer; + } +); + +extern_methods!( + unsafe impl NSRotationGestureRecognizer { + #[method(rotation)] + pub unsafe fn rotation(&self) -> CGFloat; + + #[method(setRotation:)] + pub unsafe fn setRotation(&self, rotation: CGFloat); + + #[method(rotationInDegrees)] + pub unsafe fn rotationInDegrees(&self) -> CGFloat; + + #[method(setRotationInDegrees:)] + pub unsafe fn setRotationInDegrees(&self, rotationInDegrees: CGFloat); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSRuleEditor.rs b/crates/icrate/src/generated/AppKit/NSRuleEditor.rs new file mode 100644 index 000000000..159b5e5b7 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSRuleEditor.rs @@ -0,0 +1,253 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSRuleEditorPredicatePartKey = NSString; + +extern_static!(NSRuleEditorPredicateLeftExpression: &'static NSRuleEditorPredicatePartKey); + +extern_static!(NSRuleEditorPredicateRightExpression: &'static NSRuleEditorPredicatePartKey); + +extern_static!(NSRuleEditorPredicateComparisonModifier: &'static NSRuleEditorPredicatePartKey); + +extern_static!(NSRuleEditorPredicateOptions: &'static NSRuleEditorPredicatePartKey); + +extern_static!(NSRuleEditorPredicateOperatorType: &'static NSRuleEditorPredicatePartKey); + +extern_static!(NSRuleEditorPredicateCustomSelector: &'static NSRuleEditorPredicatePartKey); + +extern_static!(NSRuleEditorPredicateCompoundType: &'static NSRuleEditorPredicatePartKey); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSRuleEditorNestingMode { + NSRuleEditorNestingModeSingle = 0, + NSRuleEditorNestingModeList = 1, + NSRuleEditorNestingModeCompound = 2, + NSRuleEditorNestingModeSimple = 3, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSRuleEditorRowType { + NSRuleEditorRowTypeSimple = 0, + NSRuleEditorRowTypeCompound = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSRuleEditor; + + unsafe impl ClassType for NSRuleEditor { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSRuleEditor { + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSRuleEditorDelegate>); + + #[method_id(@__retain_semantics Other formattingStringsFilename)] + pub unsafe fn formattingStringsFilename(&self) -> Option>; + + #[method(setFormattingStringsFilename:)] + pub unsafe fn setFormattingStringsFilename( + &self, + formattingStringsFilename: Option<&NSString>, + ); + + #[method_id(@__retain_semantics Other formattingDictionary)] + pub unsafe fn formattingDictionary( + &self, + ) -> Option, Shared>>; + + #[method(setFormattingDictionary:)] + pub unsafe fn setFormattingDictionary( + &self, + formattingDictionary: Option<&NSDictionary>, + ); + + #[method(reloadCriteria)] + pub unsafe fn reloadCriteria(&self); + + #[method(nestingMode)] + pub unsafe fn nestingMode(&self) -> NSRuleEditorNestingMode; + + #[method(setNestingMode:)] + pub unsafe fn setNestingMode(&self, nestingMode: NSRuleEditorNestingMode); + + #[method(rowHeight)] + pub unsafe fn rowHeight(&self) -> CGFloat; + + #[method(setRowHeight:)] + pub unsafe fn setRowHeight(&self, rowHeight: CGFloat); + + #[method(isEditable)] + pub unsafe fn isEditable(&self) -> bool; + + #[method(setEditable:)] + pub unsafe fn setEditable(&self, editable: bool); + + #[method(canRemoveAllRows)] + pub unsafe fn canRemoveAllRows(&self) -> bool; + + #[method(setCanRemoveAllRows:)] + pub unsafe fn setCanRemoveAllRows(&self, canRemoveAllRows: bool); + + #[method_id(@__retain_semantics Other predicate)] + pub unsafe fn predicate(&self) -> Option>; + + #[method(reloadPredicate)] + pub unsafe fn reloadPredicate(&self); + + #[method_id(@__retain_semantics Other predicateForRow:)] + pub unsafe fn predicateForRow(&self, row: NSInteger) -> Option>; + + #[method(numberOfRows)] + pub unsafe fn numberOfRows(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other subrowIndexesForRow:)] + pub unsafe fn subrowIndexesForRow(&self, rowIndex: NSInteger) -> Id; + + #[method_id(@__retain_semantics Other criteriaForRow:)] + pub unsafe fn criteriaForRow(&self, row: NSInteger) -> Id; + + #[method_id(@__retain_semantics Other displayValuesForRow:)] + pub unsafe fn displayValuesForRow(&self, row: NSInteger) -> Id; + + #[method(rowForDisplayValue:)] + pub unsafe fn rowForDisplayValue(&self, displayValue: &Object) -> NSInteger; + + #[method(rowTypeForRow:)] + pub unsafe fn rowTypeForRow(&self, rowIndex: NSInteger) -> NSRuleEditorRowType; + + #[method(parentRowForRow:)] + pub unsafe fn parentRowForRow(&self, rowIndex: NSInteger) -> NSInteger; + + #[method(addRow:)] + pub unsafe fn addRow(&self, sender: Option<&Object>); + + #[method(insertRowAtIndex:withType:asSubrowOfRow:animate:)] + pub unsafe fn insertRowAtIndex_withType_asSubrowOfRow_animate( + &self, + rowIndex: NSInteger, + rowType: NSRuleEditorRowType, + parentRow: NSInteger, + shouldAnimate: bool, + ); + + #[method(setCriteria:andDisplayValues:forRowAtIndex:)] + pub unsafe fn setCriteria_andDisplayValues_forRowAtIndex( + &self, + criteria: &NSArray, + values: &NSArray, + rowIndex: NSInteger, + ); + + #[method(removeRowAtIndex:)] + pub unsafe fn removeRowAtIndex(&self, rowIndex: NSInteger); + + #[method(removeRowsAtIndexes:includeSubrows:)] + pub unsafe fn removeRowsAtIndexes_includeSubrows( + &self, + rowIndexes: &NSIndexSet, + includeSubrows: bool, + ); + + #[method_id(@__retain_semantics Other selectedRowIndexes)] + pub unsafe fn selectedRowIndexes(&self) -> Id; + + #[method(selectRowIndexes:byExtendingSelection:)] + pub unsafe fn selectRowIndexes_byExtendingSelection( + &self, + indexes: &NSIndexSet, + extend: bool, + ); + + #[method(rowClass)] + pub unsafe fn rowClass(&self) -> &'static Class; + + #[method(setRowClass:)] + pub unsafe fn setRowClass(&self, rowClass: &Class); + + #[method_id(@__retain_semantics Other rowTypeKeyPath)] + pub unsafe fn rowTypeKeyPath(&self) -> Id; + + #[method(setRowTypeKeyPath:)] + pub unsafe fn setRowTypeKeyPath(&self, rowTypeKeyPath: &NSString); + + #[method_id(@__retain_semantics Other subrowsKeyPath)] + pub unsafe fn subrowsKeyPath(&self) -> Id; + + #[method(setSubrowsKeyPath:)] + pub unsafe fn setSubrowsKeyPath(&self, subrowsKeyPath: &NSString); + + #[method_id(@__retain_semantics Other criteriaKeyPath)] + pub unsafe fn criteriaKeyPath(&self) -> Id; + + #[method(setCriteriaKeyPath:)] + pub unsafe fn setCriteriaKeyPath(&self, criteriaKeyPath: &NSString); + + #[method_id(@__retain_semantics Other displayValuesKeyPath)] + pub unsafe fn displayValuesKeyPath(&self) -> Id; + + #[method(setDisplayValuesKeyPath:)] + pub unsafe fn setDisplayValuesKeyPath(&self, displayValuesKeyPath: &NSString); + } +); + +extern_protocol!( + pub struct NSRuleEditorDelegate; + + unsafe impl NSRuleEditorDelegate { + #[method(ruleEditor:numberOfChildrenForCriterion:withRowType:)] + pub unsafe fn ruleEditor_numberOfChildrenForCriterion_withRowType( + &self, + editor: &NSRuleEditor, + criterion: Option<&Object>, + rowType: NSRuleEditorRowType, + ) -> NSInteger; + + #[method_id(@__retain_semantics Other ruleEditor:child:forCriterion:withRowType:)] + pub unsafe fn ruleEditor_child_forCriterion_withRowType( + &self, + editor: &NSRuleEditor, + index: NSInteger, + criterion: Option<&Object>, + rowType: NSRuleEditorRowType, + ) -> Id; + + #[method_id(@__retain_semantics Other ruleEditor:displayValueForCriterion:inRow:)] + pub unsafe fn ruleEditor_displayValueForCriterion_inRow( + &self, + editor: &NSRuleEditor, + criterion: &Object, + row: NSInteger, + ) -> Id; + + #[optional] + #[method_id(@__retain_semantics Other ruleEditor:predicatePartsForCriterion:withDisplayValue:inRow:)] + pub unsafe fn ruleEditor_predicatePartsForCriterion_withDisplayValue_inRow( + &self, + editor: &NSRuleEditor, + criterion: &Object, + value: &Object, + row: NSInteger, + ) -> Option, Shared>>; + + #[optional] + #[method(ruleEditorRowsDidChange:)] + pub unsafe fn ruleEditorRowsDidChange(&self, notification: &NSNotification); + } +); + +extern_static!(NSRuleEditorRowsDidChangeNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/AppKit/NSRulerMarker.rs b/crates/icrate/src/generated/AppKit/NSRulerMarker.rs new file mode 100644 index 000000000..e2215e191 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSRulerMarker.rs @@ -0,0 +1,91 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSRulerMarker; + + unsafe impl ClassType for NSRulerMarker { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSRulerMarker { + #[method_id(@__retain_semantics Init initWithRulerView:markerLocation:image:imageOrigin:)] + pub unsafe fn initWithRulerView_markerLocation_image_imageOrigin( + this: Option>, + ruler: &NSRulerView, + location: CGFloat, + image: &NSImage, + imageOrigin: NSPoint, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other ruler)] + pub unsafe fn ruler(&self) -> Option>; + + #[method(markerLocation)] + pub unsafe fn markerLocation(&self) -> CGFloat; + + #[method(setMarkerLocation:)] + pub unsafe fn setMarkerLocation(&self, markerLocation: CGFloat); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Id; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: &NSImage); + + #[method(imageOrigin)] + pub unsafe fn imageOrigin(&self) -> NSPoint; + + #[method(setImageOrigin:)] + pub unsafe fn setImageOrigin(&self, imageOrigin: NSPoint); + + #[method(isMovable)] + pub unsafe fn isMovable(&self) -> bool; + + #[method(setMovable:)] + pub unsafe fn setMovable(&self, movable: bool); + + #[method(isRemovable)] + pub unsafe fn isRemovable(&self) -> bool; + + #[method(setRemovable:)] + pub unsafe fn setRemovable(&self, removable: bool); + + #[method(isDragging)] + pub unsafe fn isDragging(&self) -> bool; + + #[method_id(@__retain_semantics Other representedObject)] + pub unsafe fn representedObject(&self) -> Option>; + + #[method(setRepresentedObject:)] + pub unsafe fn setRepresentedObject(&self, representedObject: Option<&NSCopying>); + + #[method(imageRectInRuler)] + pub unsafe fn imageRectInRuler(&self) -> NSRect; + + #[method(thicknessRequiredInRuler)] + pub unsafe fn thicknessRequiredInRuler(&self) -> CGFloat; + + #[method(drawRect:)] + pub unsafe fn drawRect(&self, rect: NSRect); + + #[method(trackMouse:adding:)] + pub unsafe fn trackMouse_adding(&self, mouseDownEvent: &NSEvent, isAdding: bool) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSRulerView.rs b/crates/icrate/src/generated/AppKit/NSRulerView.rs new file mode 100644 index 000000000..97d38ee33 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSRulerView.rs @@ -0,0 +1,231 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSRulerOrientation { + NSHorizontalRuler = 0, + NSVerticalRuler = 1, + } +); + +pub type NSRulerViewUnitName = NSString; + +extern_static!(NSRulerViewUnitInches: &'static NSRulerViewUnitName); + +extern_static!(NSRulerViewUnitCentimeters: &'static NSRulerViewUnitName); + +extern_static!(NSRulerViewUnitPoints: &'static NSRulerViewUnitName); + +extern_static!(NSRulerViewUnitPicas: &'static NSRulerViewUnitName); + +extern_class!( + #[derive(Debug)] + pub struct NSRulerView; + + unsafe impl ClassType for NSRulerView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSRulerView { + #[method(registerUnitWithName:abbreviation:unitToPointsConversionFactor:stepUpCycle:stepDownCycle:)] + pub unsafe fn registerUnitWithName_abbreviation_unitToPointsConversionFactor_stepUpCycle_stepDownCycle( + unitName: &NSRulerViewUnitName, + abbreviation: &NSString, + conversionFactor: CGFloat, + stepUpCycle: &NSArray, + stepDownCycle: &NSArray, + ); + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithScrollView:orientation:)] + pub unsafe fn initWithScrollView_orientation( + this: Option>, + scrollView: Option<&NSScrollView>, + orientation: NSRulerOrientation, + ) -> Id; + + #[method_id(@__retain_semantics Other scrollView)] + pub unsafe fn scrollView(&self) -> Option>; + + #[method(setScrollView:)] + pub unsafe fn setScrollView(&self, scrollView: Option<&NSScrollView>); + + #[method(orientation)] + pub unsafe fn orientation(&self) -> NSRulerOrientation; + + #[method(setOrientation:)] + pub unsafe fn setOrientation(&self, orientation: NSRulerOrientation); + + #[method(baselineLocation)] + pub unsafe fn baselineLocation(&self) -> CGFloat; + + #[method(requiredThickness)] + pub unsafe fn requiredThickness(&self) -> CGFloat; + + #[method(ruleThickness)] + pub unsafe fn ruleThickness(&self) -> CGFloat; + + #[method(setRuleThickness:)] + pub unsafe fn setRuleThickness(&self, ruleThickness: CGFloat); + + #[method(reservedThicknessForMarkers)] + pub unsafe fn reservedThicknessForMarkers(&self) -> CGFloat; + + #[method(setReservedThicknessForMarkers:)] + pub unsafe fn setReservedThicknessForMarkers(&self, reservedThicknessForMarkers: CGFloat); + + #[method(reservedThicknessForAccessoryView)] + pub unsafe fn reservedThicknessForAccessoryView(&self) -> CGFloat; + + #[method(setReservedThicknessForAccessoryView:)] + pub unsafe fn setReservedThicknessForAccessoryView( + &self, + reservedThicknessForAccessoryView: CGFloat, + ); + + #[method_id(@__retain_semantics Other measurementUnits)] + pub unsafe fn measurementUnits(&self) -> Id; + + #[method(setMeasurementUnits:)] + pub unsafe fn setMeasurementUnits(&self, measurementUnits: &NSRulerViewUnitName); + + #[method(originOffset)] + pub unsafe fn originOffset(&self) -> CGFloat; + + #[method(setOriginOffset:)] + pub unsafe fn setOriginOffset(&self, originOffset: CGFloat); + + #[method_id(@__retain_semantics Other clientView)] + pub unsafe fn clientView(&self) -> Option>; + + #[method(setClientView:)] + pub unsafe fn setClientView(&self, clientView: Option<&NSView>); + + #[method(addMarker:)] + pub unsafe fn addMarker(&self, marker: &NSRulerMarker); + + #[method(removeMarker:)] + pub unsafe fn removeMarker(&self, marker: &NSRulerMarker); + + #[method_id(@__retain_semantics Other markers)] + pub unsafe fn markers(&self) -> Option, Shared>>; + + #[method(setMarkers:)] + pub unsafe fn setMarkers(&self, markers: Option<&NSArray>); + + #[method(trackMarker:withMouseEvent:)] + pub unsafe fn trackMarker_withMouseEvent( + &self, + marker: &NSRulerMarker, + event: &NSEvent, + ) -> bool; + + #[method_id(@__retain_semantics Other accessoryView)] + pub unsafe fn accessoryView(&self) -> Option>; + + #[method(setAccessoryView:)] + pub unsafe fn setAccessoryView(&self, accessoryView: Option<&NSView>); + + #[method(moveRulerlineFromLocation:toLocation:)] + pub unsafe fn moveRulerlineFromLocation_toLocation( + &self, + oldLocation: CGFloat, + newLocation: CGFloat, + ); + + #[method(invalidateHashMarks)] + pub unsafe fn invalidateHashMarks(&self); + + #[method(drawHashMarksAndLabelsInRect:)] + pub unsafe fn drawHashMarksAndLabelsInRect(&self, rect: NSRect); + + #[method(drawMarkersInRect:)] + pub unsafe fn drawMarkersInRect(&self, rect: NSRect); + + #[method(isFlipped)] + pub unsafe fn isFlipped(&self) -> bool; + } +); + +extern_methods!( + /// NSRulerMarkerClientViewDelegation + unsafe impl NSView { + #[method(rulerView:shouldMoveMarker:)] + pub unsafe fn rulerView_shouldMoveMarker( + &self, + ruler: &NSRulerView, + marker: &NSRulerMarker, + ) -> bool; + + #[method(rulerView:willMoveMarker:toLocation:)] + pub unsafe fn rulerView_willMoveMarker_toLocation( + &self, + ruler: &NSRulerView, + marker: &NSRulerMarker, + location: CGFloat, + ) -> CGFloat; + + #[method(rulerView:didMoveMarker:)] + pub unsafe fn rulerView_didMoveMarker(&self, ruler: &NSRulerView, marker: &NSRulerMarker); + + #[method(rulerView:shouldRemoveMarker:)] + pub unsafe fn rulerView_shouldRemoveMarker( + &self, + ruler: &NSRulerView, + marker: &NSRulerMarker, + ) -> bool; + + #[method(rulerView:didRemoveMarker:)] + pub unsafe fn rulerView_didRemoveMarker(&self, ruler: &NSRulerView, marker: &NSRulerMarker); + + #[method(rulerView:shouldAddMarker:)] + pub unsafe fn rulerView_shouldAddMarker( + &self, + ruler: &NSRulerView, + marker: &NSRulerMarker, + ) -> bool; + + #[method(rulerView:willAddMarker:atLocation:)] + pub unsafe fn rulerView_willAddMarker_atLocation( + &self, + ruler: &NSRulerView, + marker: &NSRulerMarker, + location: CGFloat, + ) -> CGFloat; + + #[method(rulerView:didAddMarker:)] + pub unsafe fn rulerView_didAddMarker(&self, ruler: &NSRulerView, marker: &NSRulerMarker); + + #[method(rulerView:handleMouseDown:)] + pub unsafe fn rulerView_handleMouseDown(&self, ruler: &NSRulerView, event: &NSEvent); + + #[method(rulerView:willSetClientView:)] + pub unsafe fn rulerView_willSetClientView(&self, ruler: &NSRulerView, newClient: &NSView); + + #[method(rulerView:locationForPoint:)] + pub unsafe fn rulerView_locationForPoint( + &self, + ruler: &NSRulerView, + point: NSPoint, + ) -> CGFloat; + + #[method(rulerView:pointForLocation:)] + pub unsafe fn rulerView_pointForLocation( + &self, + ruler: &NSRulerView, + point: CGFloat, + ) -> NSPoint; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSRunningApplication.rs b/crates/icrate/src/generated/AppKit/NSRunningApplication.rs new file mode 100644 index 000000000..d3f13384d --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSRunningApplication.rs @@ -0,0 +1,109 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSApplicationActivationOptions { + NSApplicationActivateAllWindows = 1 << 0, + NSApplicationActivateIgnoringOtherApps = 1 << 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSApplicationActivationPolicy { + NSApplicationActivationPolicyRegular = 0, + NSApplicationActivationPolicyAccessory = 1, + NSApplicationActivationPolicyProhibited = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSRunningApplication; + + unsafe impl ClassType for NSRunningApplication { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSRunningApplication { + #[method(isTerminated)] + pub unsafe fn isTerminated(&self) -> bool; + + #[method(isFinishedLaunching)] + pub unsafe fn isFinishedLaunching(&self) -> bool; + + #[method(isHidden)] + pub unsafe fn isHidden(&self) -> bool; + + #[method(isActive)] + pub unsafe fn isActive(&self) -> bool; + + #[method(ownsMenuBar)] + pub unsafe fn ownsMenuBar(&self) -> bool; + + #[method(activationPolicy)] + pub unsafe fn activationPolicy(&self) -> NSApplicationActivationPolicy; + + #[method_id(@__retain_semantics Other localizedName)] + pub unsafe fn localizedName(&self) -> Option>; + + #[method_id(@__retain_semantics Other bundleIdentifier)] + pub unsafe fn bundleIdentifier(&self) -> Option>; + + #[method_id(@__retain_semantics Other bundleURL)] + pub unsafe fn bundleURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other executableURL)] + pub unsafe fn executableURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other launchDate)] + pub unsafe fn launchDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other icon)] + pub unsafe fn icon(&self) -> Option>; + + #[method(executableArchitecture)] + pub unsafe fn executableArchitecture(&self) -> NSInteger; + + #[method(hide)] + pub unsafe fn hide(&self) -> bool; + + #[method(unhide)] + pub unsafe fn unhide(&self) -> bool; + + #[method(activateWithOptions:)] + pub unsafe fn activateWithOptions(&self, options: NSApplicationActivationOptions) -> bool; + + #[method(terminate)] + pub unsafe fn terminate(&self) -> bool; + + #[method(forceTerminate)] + pub unsafe fn forceTerminate(&self) -> bool; + + #[method_id(@__retain_semantics Other runningApplicationsWithBundleIdentifier:)] + pub unsafe fn runningApplicationsWithBundleIdentifier( + bundleIdentifier: &NSString, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other currentApplication)] + pub unsafe fn currentApplication() -> Id; + + #[method(terminateAutomaticallyTerminableApplications)] + pub unsafe fn terminateAutomaticallyTerminableApplications(); + } +); + +extern_methods!( + /// NSWorkspaceRunningApplications + unsafe impl NSWorkspace { + #[method_id(@__retain_semantics Other runningApplications)] + pub unsafe fn runningApplications(&self) -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSavePanel.rs b/crates/icrate/src/generated/AppKit/NSSavePanel.rs new file mode 100644 index 000000000..102a6cc77 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSavePanel.rs @@ -0,0 +1,265 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_enum!( + #[underlying(c_uint)] + pub enum { + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSSavePanel; + + unsafe impl ClassType for NSSavePanel { + type Super = NSPanel; + } +); + +extern_methods!( + unsafe impl NSSavePanel { + #[method_id(@__retain_semantics Other savePanel)] + pub unsafe fn savePanel() -> Id; + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + + #[method_id(@__retain_semantics Other directoryURL)] + pub unsafe fn directoryURL(&self) -> Option>; + + #[method(setDirectoryURL:)] + pub unsafe fn setDirectoryURL(&self, directoryURL: Option<&NSURL>); + + #[method(allowsOtherFileTypes)] + pub unsafe fn allowsOtherFileTypes(&self) -> bool; + + #[method(setAllowsOtherFileTypes:)] + pub unsafe fn setAllowsOtherFileTypes(&self, allowsOtherFileTypes: bool); + + #[method_id(@__retain_semantics Other accessoryView)] + pub unsafe fn accessoryView(&self) -> Option>; + + #[method(setAccessoryView:)] + pub unsafe fn setAccessoryView(&self, accessoryView: Option<&NSView>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSOpenSavePanelDelegate>); + + #[method(isExpanded)] + pub unsafe fn isExpanded(&self) -> bool; + + #[method(canCreateDirectories)] + pub unsafe fn canCreateDirectories(&self) -> bool; + + #[method(setCanCreateDirectories:)] + pub unsafe fn setCanCreateDirectories(&self, canCreateDirectories: bool); + + #[method(canSelectHiddenExtension)] + pub unsafe fn canSelectHiddenExtension(&self) -> bool; + + #[method(setCanSelectHiddenExtension:)] + pub unsafe fn setCanSelectHiddenExtension(&self, canSelectHiddenExtension: bool); + + #[method(isExtensionHidden)] + pub unsafe fn isExtensionHidden(&self) -> bool; + + #[method(setExtensionHidden:)] + pub unsafe fn setExtensionHidden(&self, extensionHidden: bool); + + #[method(treatsFilePackagesAsDirectories)] + pub unsafe fn treatsFilePackagesAsDirectories(&self) -> bool; + + #[method(setTreatsFilePackagesAsDirectories:)] + pub unsafe fn setTreatsFilePackagesAsDirectories( + &self, + treatsFilePackagesAsDirectories: bool, + ); + + #[method_id(@__retain_semantics Other prompt)] + pub unsafe fn prompt(&self) -> Id; + + #[method(setPrompt:)] + pub unsafe fn setPrompt(&self, prompt: Option<&NSString>); + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: Option<&NSString>); + + #[method_id(@__retain_semantics Other nameFieldLabel)] + pub unsafe fn nameFieldLabel(&self) -> Id; + + #[method(setNameFieldLabel:)] + pub unsafe fn setNameFieldLabel(&self, nameFieldLabel: Option<&NSString>); + + #[method_id(@__retain_semantics Other nameFieldStringValue)] + pub unsafe fn nameFieldStringValue(&self) -> Id; + + #[method(setNameFieldStringValue:)] + pub unsafe fn setNameFieldStringValue(&self, nameFieldStringValue: &NSString); + + #[method_id(@__retain_semantics Other message)] + pub unsafe fn message(&self) -> Id; + + #[method(setMessage:)] + pub unsafe fn setMessage(&self, message: Option<&NSString>); + + #[method(validateVisibleColumns)] + pub unsafe fn validateVisibleColumns(&self); + + #[method(showsHiddenFiles)] + pub unsafe fn showsHiddenFiles(&self) -> bool; + + #[method(setShowsHiddenFiles:)] + pub unsafe fn setShowsHiddenFiles(&self, showsHiddenFiles: bool); + + #[method(showsTagField)] + pub unsafe fn showsTagField(&self) -> bool; + + #[method(setShowsTagField:)] + pub unsafe fn setShowsTagField(&self, showsTagField: bool); + + #[method_id(@__retain_semantics Other tagNames)] + pub unsafe fn tagNames(&self) -> Option, Shared>>; + + #[method(setTagNames:)] + pub unsafe fn setTagNames(&self, tagNames: Option<&NSArray>); + + #[method(ok:)] + pub unsafe fn ok(&self, sender: Option<&Object>); + + #[method(cancel:)] + pub unsafe fn cancel(&self, sender: Option<&Object>); + + #[method(beginSheetModalForWindow:completionHandler:)] + pub unsafe fn beginSheetModalForWindow_completionHandler( + &self, + window: &NSWindow, + handler: &Block<(NSModalResponse,), ()>, + ); + + #[method(beginWithCompletionHandler:)] + pub unsafe fn beginWithCompletionHandler(&self, handler: &Block<(NSModalResponse,), ()>); + + #[method(runModal)] + pub unsafe fn runModal(&self) -> NSModalResponse; + } +); + +extern_protocol!( + pub struct NSOpenSavePanelDelegate; + + unsafe impl NSOpenSavePanelDelegate { + #[optional] + #[method(panel:shouldEnableURL:)] + pub unsafe fn panel_shouldEnableURL(&self, sender: &Object, url: &NSURL) -> bool; + + #[optional] + #[method(panel:validateURL:error:)] + pub unsafe fn panel_validateURL_error( + &self, + sender: &Object, + url: &NSURL, + ) -> Result<(), Id>; + + #[optional] + #[method(panel:didChangeToDirectoryURL:)] + pub unsafe fn panel_didChangeToDirectoryURL(&self, sender: &Object, url: Option<&NSURL>); + + #[optional] + #[method_id(@__retain_semantics Other panel:userEnteredFilename:confirmed:)] + pub unsafe fn panel_userEnteredFilename_confirmed( + &self, + sender: &Object, + filename: &NSString, + okFlag: bool, + ) -> Option>; + + #[optional] + #[method(panel:willExpand:)] + pub unsafe fn panel_willExpand(&self, sender: &Object, expanding: bool); + + #[optional] + #[method(panelSelectionDidChange:)] + pub unsafe fn panelSelectionDidChange(&self, sender: Option<&Object>); + } +); + +extern_methods!( + /// NSSavePanelDelegateDeprecated + unsafe impl NSObject { + #[method(panel:isValidFilename:)] + pub unsafe fn panel_isValidFilename(&self, sender: &Object, filename: &NSString) -> bool; + + #[method(panel:directoryDidChange:)] + pub unsafe fn panel_directoryDidChange(&self, sender: &Object, path: &NSString); + + #[method(panel:compareFilename:with:caseSensitive:)] + pub unsafe fn panel_compareFilename_with_caseSensitive( + &self, + sender: &Object, + name1: &NSString, + name2: &NSString, + caseSensitive: bool, + ) -> NSComparisonResult; + + #[method(panel:shouldShowFilename:)] + pub unsafe fn panel_shouldShowFilename(&self, sender: &Object, filename: &NSString) + -> bool; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSSavePanel { + #[method_id(@__retain_semantics Other filename)] + pub unsafe fn filename(&self) -> Id; + + #[method_id(@__retain_semantics Other directory)] + pub unsafe fn directory(&self) -> Id; + + #[method(setDirectory:)] + pub unsafe fn setDirectory(&self, path: Option<&NSString>); + + #[method_id(@__retain_semantics Other requiredFileType)] + pub unsafe fn requiredFileType(&self) -> Option>; + + #[method(setRequiredFileType:)] + pub unsafe fn setRequiredFileType(&self, type_: Option<&NSString>); + + #[method(beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:)] + pub unsafe fn beginSheetForDirectory_file_modalForWindow_modalDelegate_didEndSelector_contextInfo( + &self, + path: &NSString, + name: Option<&NSString>, + docWindow: Option<&NSWindow>, + delegate: Option<&Object>, + didEndSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(runModalForDirectory:file:)] + pub unsafe fn runModalForDirectory_file( + &self, + path: Option<&NSString>, + name: Option<&NSString>, + ) -> NSInteger; + + #[method(selectText:)] + pub unsafe fn selectText(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other allowedFileTypes)] + pub unsafe fn allowedFileTypes(&self) -> Option, Shared>>; + + #[method(setAllowedFileTypes:)] + pub unsafe fn setAllowedFileTypes(&self, allowedFileTypes: Option<&NSArray>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSScreen.rs b/crates/icrate/src/generated/AppKit/NSScreen.rs new file mode 100644 index 000000000..12117125b --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSScreen.rs @@ -0,0 +1,124 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSScreen; + + unsafe impl ClassType for NSScreen { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSScreen { + #[method_id(@__retain_semantics Other screens)] + pub unsafe fn screens() -> Id, Shared>; + + #[method_id(@__retain_semantics Other mainScreen)] + pub unsafe fn mainScreen() -> Option>; + + #[method_id(@__retain_semantics Other deepestScreen)] + pub unsafe fn deepestScreen() -> Option>; + + #[method(screensHaveSeparateSpaces)] + pub unsafe fn screensHaveSeparateSpaces() -> bool; + + #[method(depth)] + pub unsafe fn depth(&self) -> NSWindowDepth; + + #[method(frame)] + pub unsafe fn frame(&self) -> NSRect; + + #[method(visibleFrame)] + pub unsafe fn visibleFrame(&self) -> NSRect; + + #[method_id(@__retain_semantics Other deviceDescription)] + pub unsafe fn deviceDescription( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other colorSpace)] + pub unsafe fn colorSpace(&self) -> Option>; + + #[method(supportedWindowDepths)] + pub unsafe fn supportedWindowDepths(&self) -> NonNull; + + #[method(canRepresentDisplayGamut:)] + pub unsafe fn canRepresentDisplayGamut(&self, displayGamut: NSDisplayGamut) -> bool; + + #[method(convertRectToBacking:)] + pub unsafe fn convertRectToBacking(&self, rect: NSRect) -> NSRect; + + #[method(convertRectFromBacking:)] + pub unsafe fn convertRectFromBacking(&self, rect: NSRect) -> NSRect; + + #[method(backingAlignedRect:options:)] + pub unsafe fn backingAlignedRect_options( + &self, + rect: NSRect, + options: NSAlignmentOptions, + ) -> NSRect; + + #[method(backingScaleFactor)] + pub unsafe fn backingScaleFactor(&self) -> CGFloat; + + #[method_id(@__retain_semantics Other localizedName)] + pub unsafe fn localizedName(&self) -> Id; + + #[method(safeAreaInsets)] + pub unsafe fn safeAreaInsets(&self) -> NSEdgeInsets; + + #[method(auxiliaryTopLeftArea)] + pub unsafe fn auxiliaryTopLeftArea(&self) -> NSRect; + + #[method(auxiliaryTopRightArea)] + pub unsafe fn auxiliaryTopRightArea(&self) -> NSRect; + } +); + +extern_static!(NSScreenColorSpaceDidChangeNotification: &'static NSNotificationName); + +extern_methods!( + unsafe impl NSScreen { + #[method(maximumExtendedDynamicRangeColorComponentValue)] + pub unsafe fn maximumExtendedDynamicRangeColorComponentValue(&self) -> CGFloat; + + #[method(maximumPotentialExtendedDynamicRangeColorComponentValue)] + pub unsafe fn maximumPotentialExtendedDynamicRangeColorComponentValue(&self) -> CGFloat; + + #[method(maximumReferenceExtendedDynamicRangeColorComponentValue)] + pub unsafe fn maximumReferenceExtendedDynamicRangeColorComponentValue(&self) -> CGFloat; + } +); + +extern_methods!( + unsafe impl NSScreen { + #[method(maximumFramesPerSecond)] + pub unsafe fn maximumFramesPerSecond(&self) -> NSInteger; + + #[method(minimumRefreshInterval)] + pub unsafe fn minimumRefreshInterval(&self) -> NSTimeInterval; + + #[method(maximumRefreshInterval)] + pub unsafe fn maximumRefreshInterval(&self) -> NSTimeInterval; + + #[method(displayUpdateGranularity)] + pub unsafe fn displayUpdateGranularity(&self) -> NSTimeInterval; + + #[method(lastDisplayUpdateTimestamp)] + pub unsafe fn lastDisplayUpdateTimestamp(&self) -> NSTimeInterval; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSScreen { + #[method(userSpaceScaleFactor)] + pub unsafe fn userSpaceScaleFactor(&self) -> CGFloat; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSScrollView.rs b/crates/icrate/src/generated/AppKit/NSScrollView.rs new file mode 100644 index 000000000..6012b1338 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSScrollView.rs @@ -0,0 +1,367 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSScrollElasticity { + NSScrollElasticityAutomatic = 0, + NSScrollElasticityNone = 1, + NSScrollElasticityAllowed = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSScrollView; + + unsafe impl ClassType for NSScrollView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSScrollView { + #[method_id(@__retain_semantics Init initWithFrame:)] + pub unsafe fn initWithFrame( + this: Option>, + frameRect: NSRect, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method(frameSizeForContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:)] + pub unsafe fn frameSizeForContentSize_horizontalScrollerClass_verticalScrollerClass_borderType_controlSize_scrollerStyle( + cSize: NSSize, + horizontalScrollerClass: Option<&Class>, + verticalScrollerClass: Option<&Class>, + type_: NSBorderType, + controlSize: NSControlSize, + scrollerStyle: NSScrollerStyle, + ) -> NSSize; + + #[method(contentSizeForFrameSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:)] + pub unsafe fn contentSizeForFrameSize_horizontalScrollerClass_verticalScrollerClass_borderType_controlSize_scrollerStyle( + fSize: NSSize, + horizontalScrollerClass: Option<&Class>, + verticalScrollerClass: Option<&Class>, + type_: NSBorderType, + controlSize: NSControlSize, + scrollerStyle: NSScrollerStyle, + ) -> NSSize; + + #[method(frameSizeForContentSize:hasHorizontalScroller:hasVerticalScroller:borderType:)] + pub unsafe fn frameSizeForContentSize_hasHorizontalScroller_hasVerticalScroller_borderType( + cSize: NSSize, + hFlag: bool, + vFlag: bool, + type_: NSBorderType, + ) -> NSSize; + + #[method(contentSizeForFrameSize:hasHorizontalScroller:hasVerticalScroller:borderType:)] + pub unsafe fn contentSizeForFrameSize_hasHorizontalScroller_hasVerticalScroller_borderType( + fSize: NSSize, + hFlag: bool, + vFlag: bool, + type_: NSBorderType, + ) -> NSSize; + + #[method(documentVisibleRect)] + pub unsafe fn documentVisibleRect(&self) -> NSRect; + + #[method(contentSize)] + pub unsafe fn contentSize(&self) -> NSSize; + + #[method_id(@__retain_semantics Other documentView)] + pub unsafe fn documentView(&self) -> Option>; + + #[method(setDocumentView:)] + pub unsafe fn setDocumentView(&self, documentView: Option<&NSView>); + + #[method_id(@__retain_semantics Other contentView)] + pub unsafe fn contentView(&self) -> Id; + + #[method(setContentView:)] + pub unsafe fn setContentView(&self, contentView: &NSClipView); + + #[method_id(@__retain_semantics Other documentCursor)] + pub unsafe fn documentCursor(&self) -> Option>; + + #[method(setDocumentCursor:)] + pub unsafe fn setDocumentCursor(&self, documentCursor: Option<&NSCursor>); + + #[method(borderType)] + pub unsafe fn borderType(&self) -> NSBorderType; + + #[method(setBorderType:)] + pub unsafe fn setBorderType(&self, borderType: NSBorderType); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Id; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: &NSColor); + + #[method(drawsBackground)] + pub unsafe fn drawsBackground(&self) -> bool; + + #[method(setDrawsBackground:)] + pub unsafe fn setDrawsBackground(&self, drawsBackground: bool); + + #[method(hasVerticalScroller)] + pub unsafe fn hasVerticalScroller(&self) -> bool; + + #[method(setHasVerticalScroller:)] + pub unsafe fn setHasVerticalScroller(&self, hasVerticalScroller: bool); + + #[method(hasHorizontalScroller)] + pub unsafe fn hasHorizontalScroller(&self) -> bool; + + #[method(setHasHorizontalScroller:)] + pub unsafe fn setHasHorizontalScroller(&self, hasHorizontalScroller: bool); + + #[method_id(@__retain_semantics Other verticalScroller)] + pub unsafe fn verticalScroller(&self) -> Option>; + + #[method(setVerticalScroller:)] + pub unsafe fn setVerticalScroller(&self, verticalScroller: Option<&NSScroller>); + + #[method_id(@__retain_semantics Other horizontalScroller)] + pub unsafe fn horizontalScroller(&self) -> Option>; + + #[method(setHorizontalScroller:)] + pub unsafe fn setHorizontalScroller(&self, horizontalScroller: Option<&NSScroller>); + + #[method(autohidesScrollers)] + pub unsafe fn autohidesScrollers(&self) -> bool; + + #[method(setAutohidesScrollers:)] + pub unsafe fn setAutohidesScrollers(&self, autohidesScrollers: bool); + + #[method(horizontalLineScroll)] + pub unsafe fn horizontalLineScroll(&self) -> CGFloat; + + #[method(setHorizontalLineScroll:)] + pub unsafe fn setHorizontalLineScroll(&self, horizontalLineScroll: CGFloat); + + #[method(verticalLineScroll)] + pub unsafe fn verticalLineScroll(&self) -> CGFloat; + + #[method(setVerticalLineScroll:)] + pub unsafe fn setVerticalLineScroll(&self, verticalLineScroll: CGFloat); + + #[method(lineScroll)] + pub unsafe fn lineScroll(&self) -> CGFloat; + + #[method(setLineScroll:)] + pub unsafe fn setLineScroll(&self, lineScroll: CGFloat); + + #[method(horizontalPageScroll)] + pub unsafe fn horizontalPageScroll(&self) -> CGFloat; + + #[method(setHorizontalPageScroll:)] + pub unsafe fn setHorizontalPageScroll(&self, horizontalPageScroll: CGFloat); + + #[method(verticalPageScroll)] + pub unsafe fn verticalPageScroll(&self) -> CGFloat; + + #[method(setVerticalPageScroll:)] + pub unsafe fn setVerticalPageScroll(&self, verticalPageScroll: CGFloat); + + #[method(pageScroll)] + pub unsafe fn pageScroll(&self) -> CGFloat; + + #[method(setPageScroll:)] + pub unsafe fn setPageScroll(&self, pageScroll: CGFloat); + + #[method(scrollsDynamically)] + pub unsafe fn scrollsDynamically(&self) -> bool; + + #[method(setScrollsDynamically:)] + pub unsafe fn setScrollsDynamically(&self, scrollsDynamically: bool); + + #[method(tile)] + pub unsafe fn tile(&self); + + #[method(reflectScrolledClipView:)] + pub unsafe fn reflectScrolledClipView(&self, cView: &NSClipView); + + #[method(scrollWheel:)] + pub unsafe fn scrollWheel(&self, event: &NSEvent); + + #[method(scrollerStyle)] + pub unsafe fn scrollerStyle(&self) -> NSScrollerStyle; + + #[method(setScrollerStyle:)] + pub unsafe fn setScrollerStyle(&self, scrollerStyle: NSScrollerStyle); + + #[method(scrollerKnobStyle)] + pub unsafe fn scrollerKnobStyle(&self) -> NSScrollerKnobStyle; + + #[method(setScrollerKnobStyle:)] + pub unsafe fn setScrollerKnobStyle(&self, scrollerKnobStyle: NSScrollerKnobStyle); + + #[method(flashScrollers)] + pub unsafe fn flashScrollers(&self); + + #[method(horizontalScrollElasticity)] + pub unsafe fn horizontalScrollElasticity(&self) -> NSScrollElasticity; + + #[method(setHorizontalScrollElasticity:)] + pub unsafe fn setHorizontalScrollElasticity( + &self, + horizontalScrollElasticity: NSScrollElasticity, + ); + + #[method(verticalScrollElasticity)] + pub unsafe fn verticalScrollElasticity(&self) -> NSScrollElasticity; + + #[method(setVerticalScrollElasticity:)] + pub unsafe fn setVerticalScrollElasticity( + &self, + verticalScrollElasticity: NSScrollElasticity, + ); + + #[method(usesPredominantAxisScrolling)] + pub unsafe fn usesPredominantAxisScrolling(&self) -> bool; + + #[method(setUsesPredominantAxisScrolling:)] + pub unsafe fn setUsesPredominantAxisScrolling(&self, usesPredominantAxisScrolling: bool); + + #[method(allowsMagnification)] + pub unsafe fn allowsMagnification(&self) -> bool; + + #[method(setAllowsMagnification:)] + pub unsafe fn setAllowsMagnification(&self, allowsMagnification: bool); + + #[method(magnification)] + pub unsafe fn magnification(&self) -> CGFloat; + + #[method(setMagnification:)] + pub unsafe fn setMagnification(&self, magnification: CGFloat); + + #[method(maxMagnification)] + pub unsafe fn maxMagnification(&self) -> CGFloat; + + #[method(setMaxMagnification:)] + pub unsafe fn setMaxMagnification(&self, maxMagnification: CGFloat); + + #[method(minMagnification)] + pub unsafe fn minMagnification(&self) -> CGFloat; + + #[method(setMinMagnification:)] + pub unsafe fn setMinMagnification(&self, minMagnification: CGFloat); + + #[method(magnifyToFitRect:)] + pub unsafe fn magnifyToFitRect(&self, rect: NSRect); + + #[method(setMagnification:centeredAtPoint:)] + pub unsafe fn setMagnification_centeredAtPoint( + &self, + magnification: CGFloat, + point: NSPoint, + ); + + #[method(addFloatingSubview:forAxis:)] + pub unsafe fn addFloatingSubview_forAxis(&self, view: &NSView, axis: NSEventGestureAxis); + + #[method(automaticallyAdjustsContentInsets)] + pub unsafe fn automaticallyAdjustsContentInsets(&self) -> bool; + + #[method(setAutomaticallyAdjustsContentInsets:)] + pub unsafe fn setAutomaticallyAdjustsContentInsets( + &self, + automaticallyAdjustsContentInsets: bool, + ); + + #[method(contentInsets)] + pub unsafe fn contentInsets(&self) -> NSEdgeInsets; + + #[method(setContentInsets:)] + pub unsafe fn setContentInsets(&self, contentInsets: NSEdgeInsets); + + #[method(scrollerInsets)] + pub unsafe fn scrollerInsets(&self) -> NSEdgeInsets; + + #[method(setScrollerInsets:)] + pub unsafe fn setScrollerInsets(&self, scrollerInsets: NSEdgeInsets); + } +); + +extern_static!(NSScrollViewWillStartLiveMagnifyNotification: &'static NSNotificationName); + +extern_static!(NSScrollViewDidEndLiveMagnifyNotification: &'static NSNotificationName); + +extern_static!(NSScrollViewWillStartLiveScrollNotification: &'static NSNotificationName); + +extern_static!(NSScrollViewDidLiveScrollNotification: &'static NSNotificationName); + +extern_static!(NSScrollViewDidEndLiveScrollNotification: &'static NSNotificationName); + +extern_methods!( + /// NSRulerSupport + unsafe impl NSScrollView { + #[method(rulerViewClass)] + pub unsafe fn rulerViewClass() -> Option<&'static Class>; + + #[method(setRulerViewClass:)] + pub unsafe fn setRulerViewClass(rulerViewClass: Option<&Class>); + + #[method(rulersVisible)] + pub unsafe fn rulersVisible(&self) -> bool; + + #[method(setRulersVisible:)] + pub unsafe fn setRulersVisible(&self, rulersVisible: bool); + + #[method(hasHorizontalRuler)] + pub unsafe fn hasHorizontalRuler(&self) -> bool; + + #[method(setHasHorizontalRuler:)] + pub unsafe fn setHasHorizontalRuler(&self, hasHorizontalRuler: bool); + + #[method(hasVerticalRuler)] + pub unsafe fn hasVerticalRuler(&self) -> bool; + + #[method(setHasVerticalRuler:)] + pub unsafe fn setHasVerticalRuler(&self, hasVerticalRuler: bool); + + #[method_id(@__retain_semantics Other horizontalRulerView)] + pub unsafe fn horizontalRulerView(&self) -> Option>; + + #[method(setHorizontalRulerView:)] + pub unsafe fn setHorizontalRulerView(&self, horizontalRulerView: Option<&NSRulerView>); + + #[method_id(@__retain_semantics Other verticalRulerView)] + pub unsafe fn verticalRulerView(&self) -> Option>; + + #[method(setVerticalRulerView:)] + pub unsafe fn setVerticalRulerView(&self, verticalRulerView: Option<&NSRulerView>); + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSScrollViewFindBarPosition { + NSScrollViewFindBarPositionAboveHorizontalRuler = 0, + NSScrollViewFindBarPositionAboveContent = 1, + NSScrollViewFindBarPositionBelowContent = 2, + } +); + +extern_methods!( + /// NSFindBarSupport + unsafe impl NSScrollView { + #[method(findBarPosition)] + pub unsafe fn findBarPosition(&self) -> NSScrollViewFindBarPosition; + + #[method(setFindBarPosition:)] + pub unsafe fn setFindBarPosition(&self, findBarPosition: NSScrollViewFindBarPosition); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSScroller.rs b/crates/icrate/src/generated/AppKit/NSScroller.rs new file mode 100644 index 000000000..09e59612f --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSScroller.rs @@ -0,0 +1,176 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSUsableScrollerParts { + NSNoScrollerParts = 0, + NSOnlyScrollerArrows = 1, + NSAllScrollerParts = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSScrollerPart { + NSScrollerNoPart = 0, + NSScrollerDecrementPage = 1, + NSScrollerKnob = 2, + NSScrollerIncrementPage = 3, + NSScrollerDecrementLine = 4, + NSScrollerIncrementLine = 5, + NSScrollerKnobSlot = 6, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSScrollerStyle { + NSScrollerStyleLegacy = 0, + NSScrollerStyleOverlay = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSScrollerKnobStyle { + NSScrollerKnobStyleDefault = 0, + NSScrollerKnobStyleDark = 1, + NSScrollerKnobStyleLight = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSScroller; + + unsafe impl ClassType for NSScroller { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSScroller { + #[method(isCompatibleWithOverlayScrollers)] + pub unsafe fn isCompatibleWithOverlayScrollers() -> bool; + + #[method(scrollerWidthForControlSize:scrollerStyle:)] + pub unsafe fn scrollerWidthForControlSize_scrollerStyle( + controlSize: NSControlSize, + scrollerStyle: NSScrollerStyle, + ) -> CGFloat; + + #[method(preferredScrollerStyle)] + pub unsafe fn preferredScrollerStyle() -> NSScrollerStyle; + + #[method(scrollerStyle)] + pub unsafe fn scrollerStyle(&self) -> NSScrollerStyle; + + #[method(setScrollerStyle:)] + pub unsafe fn setScrollerStyle(&self, scrollerStyle: NSScrollerStyle); + + #[method(knobStyle)] + pub unsafe fn knobStyle(&self) -> NSScrollerKnobStyle; + + #[method(setKnobStyle:)] + pub unsafe fn setKnobStyle(&self, knobStyle: NSScrollerKnobStyle); + + #[method(rectForPart:)] + pub unsafe fn rectForPart(&self, partCode: NSScrollerPart) -> NSRect; + + #[method(checkSpaceForParts)] + pub unsafe fn checkSpaceForParts(&self); + + #[method(usableParts)] + pub unsafe fn usableParts(&self) -> NSUsableScrollerParts; + + #[method(controlSize)] + pub unsafe fn controlSize(&self) -> NSControlSize; + + #[method(setControlSize:)] + pub unsafe fn setControlSize(&self, controlSize: NSControlSize); + + #[method(drawKnob)] + pub unsafe fn drawKnob(&self); + + #[method(drawKnobSlotInRect:highlight:)] + pub unsafe fn drawKnobSlotInRect_highlight(&self, slotRect: NSRect, flag: bool); + + #[method(testPart:)] + pub unsafe fn testPart(&self, point: NSPoint) -> NSScrollerPart; + + #[method(trackKnob:)] + pub unsafe fn trackKnob(&self, event: &NSEvent); + + #[method(hitPart)] + pub unsafe fn hitPart(&self) -> NSScrollerPart; + + #[method(knobProportion)] + pub unsafe fn knobProportion(&self) -> CGFloat; + + #[method(setKnobProportion:)] + pub unsafe fn setKnobProportion(&self, knobProportion: CGFloat); + } +); + +extern_static!(NSPreferredScrollerStyleDidChangeNotification: &'static NSNotificationName); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSScrollArrowPosition { + NSScrollerArrowsMaxEnd = 0, + NSScrollerArrowsMinEnd = 1, + NSScrollerArrowsDefaultSetting = 0, + NSScrollerArrowsNone = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSScrollerArrow { + NSScrollerIncrementArrow = 0, + NSScrollerDecrementArrow = 1, + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSScroller { + #[method(scrollerWidthForControlSize:)] + pub unsafe fn scrollerWidthForControlSize(controlSize: NSControlSize) -> CGFloat; + + #[method(scrollerWidth)] + pub unsafe fn scrollerWidth() -> CGFloat; + + #[method(setFloatValue:knobProportion:)] + pub unsafe fn setFloatValue_knobProportion(&self, value: c_float, proportion: CGFloat); + + #[method(arrowsPosition)] + pub unsafe fn arrowsPosition(&self) -> NSScrollArrowPosition; + + #[method(setArrowsPosition:)] + pub unsafe fn setArrowsPosition(&self, arrowsPosition: NSScrollArrowPosition); + + #[method(controlTint)] + pub unsafe fn controlTint(&self) -> NSControlTint; + + #[method(setControlTint:)] + pub unsafe fn setControlTint(&self, controlTint: NSControlTint); + + #[method(highlight:)] + pub unsafe fn highlight(&self, flag: bool); + + #[method(trackScrollButtons:)] + pub unsafe fn trackScrollButtons(&self, event: &NSEvent); + + #[method(drawParts)] + pub unsafe fn drawParts(&self); + + #[method(drawArrow:highlight:)] + pub unsafe fn drawArrow_highlight(&self, whichArrow: NSScrollerArrow, flag: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSScrubber.rs b/crates/icrate/src/generated/AppKit/NSScrubber.rs new file mode 100644 index 000000000..2ee5c0293 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSScrubber.rs @@ -0,0 +1,291 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSScrubberDataSource; + + unsafe impl NSScrubberDataSource { + #[method(numberOfItemsForScrubber:)] + pub unsafe fn numberOfItemsForScrubber(&self, scrubber: &NSScrubber) -> NSInteger; + + #[method_id(@__retain_semantics Other scrubber:viewForItemAtIndex:)] + pub unsafe fn scrubber_viewForItemAtIndex( + &self, + scrubber: &NSScrubber, + index: NSInteger, + ) -> Id; + } +); + +extern_protocol!( + pub struct NSScrubberDelegate; + + unsafe impl NSScrubberDelegate { + #[optional] + #[method(scrubber:didSelectItemAtIndex:)] + pub unsafe fn scrubber_didSelectItemAtIndex( + &self, + scrubber: &NSScrubber, + selectedIndex: NSInteger, + ); + + #[optional] + #[method(scrubber:didHighlightItemAtIndex:)] + pub unsafe fn scrubber_didHighlightItemAtIndex( + &self, + scrubber: &NSScrubber, + highlightedIndex: NSInteger, + ); + + #[optional] + #[method(scrubber:didChangeVisibleRange:)] + pub unsafe fn scrubber_didChangeVisibleRange( + &self, + scrubber: &NSScrubber, + visibleRange: NSRange, + ); + + #[optional] + #[method(didBeginInteractingWithScrubber:)] + pub unsafe fn didBeginInteractingWithScrubber(&self, scrubber: &NSScrubber); + + #[optional] + #[method(didFinishInteractingWithScrubber:)] + pub unsafe fn didFinishInteractingWithScrubber(&self, scrubber: &NSScrubber); + + #[optional] + #[method(didCancelInteractingWithScrubber:)] + pub unsafe fn didCancelInteractingWithScrubber(&self, scrubber: &NSScrubber); + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSScrubberMode { + NSScrubberModeFixed = 0, + NSScrubberModeFree = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSScrubberAlignment { + NSScrubberAlignmentNone = 0, + NSScrubberAlignmentLeading = 1, + NSScrubberAlignmentTrailing = 2, + NSScrubberAlignmentCenter = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSScrubberSelectionStyle; + + unsafe impl ClassType for NSScrubberSelectionStyle { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSScrubberSelectionStyle { + #[method_id(@__retain_semantics Other outlineOverlayStyle)] + pub unsafe fn outlineOverlayStyle() -> Id; + + #[method_id(@__retain_semantics Other roundedBackgroundStyle)] + pub unsafe fn roundedBackgroundStyle() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Other makeSelectionView)] + pub unsafe fn makeSelectionView(&self) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSScrubber; + + unsafe impl ClassType for NSScrubber { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSScrubber { + #[method_id(@__retain_semantics Other dataSource)] + pub unsafe fn dataSource(&self) -> Option>; + + #[method(setDataSource:)] + pub unsafe fn setDataSource(&self, dataSource: Option<&NSScrubberDataSource>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSScrubberDelegate>); + + #[method_id(@__retain_semantics Other scrubberLayout)] + pub unsafe fn scrubberLayout(&self) -> Id; + + #[method(setScrubberLayout:)] + pub unsafe fn setScrubberLayout(&self, scrubberLayout: &NSScrubberLayout); + + #[method(numberOfItems)] + pub unsafe fn numberOfItems(&self) -> NSInteger; + + #[method(highlightedIndex)] + pub unsafe fn highlightedIndex(&self) -> NSInteger; + + #[method(selectedIndex)] + pub unsafe fn selectedIndex(&self) -> NSInteger; + + #[method(setSelectedIndex:)] + pub unsafe fn setSelectedIndex(&self, selectedIndex: NSInteger); + + #[method(mode)] + pub unsafe fn mode(&self) -> NSScrubberMode; + + #[method(setMode:)] + pub unsafe fn setMode(&self, mode: NSScrubberMode); + + #[method(itemAlignment)] + pub unsafe fn itemAlignment(&self) -> NSScrubberAlignment; + + #[method(setItemAlignment:)] + pub unsafe fn setItemAlignment(&self, itemAlignment: NSScrubberAlignment); + + #[method(isContinuous)] + pub unsafe fn isContinuous(&self) -> bool; + + #[method(setContinuous:)] + pub unsafe fn setContinuous(&self, continuous: bool); + + #[method(floatsSelectionViews)] + pub unsafe fn floatsSelectionViews(&self) -> bool; + + #[method(setFloatsSelectionViews:)] + pub unsafe fn setFloatsSelectionViews(&self, floatsSelectionViews: bool); + + #[method_id(@__retain_semantics Other selectionBackgroundStyle)] + pub unsafe fn selectionBackgroundStyle( + &self, + ) -> Option>; + + #[method(setSelectionBackgroundStyle:)] + pub unsafe fn setSelectionBackgroundStyle( + &self, + selectionBackgroundStyle: Option<&NSScrubberSelectionStyle>, + ); + + #[method_id(@__retain_semantics Other selectionOverlayStyle)] + pub unsafe fn selectionOverlayStyle(&self) -> Option>; + + #[method(setSelectionOverlayStyle:)] + pub unsafe fn setSelectionOverlayStyle( + &self, + selectionOverlayStyle: Option<&NSScrubberSelectionStyle>, + ); + + #[method(showsArrowButtons)] + pub unsafe fn showsArrowButtons(&self) -> bool; + + #[method(setShowsArrowButtons:)] + pub unsafe fn setShowsArrowButtons(&self, showsArrowButtons: bool); + + #[method(showsAdditionalContentIndicators)] + pub unsafe fn showsAdditionalContentIndicators(&self) -> bool; + + #[method(setShowsAdditionalContentIndicators:)] + pub unsafe fn setShowsAdditionalContentIndicators( + &self, + showsAdditionalContentIndicators: bool, + ); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Option>; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: Option<&NSColor>); + + #[method_id(@__retain_semantics Other backgroundView)] + pub unsafe fn backgroundView(&self) -> Option>; + + #[method(setBackgroundView:)] + pub unsafe fn setBackgroundView(&self, backgroundView: Option<&NSView>); + + #[method_id(@__retain_semantics Init initWithFrame:)] + pub unsafe fn initWithFrame( + this: Option>, + frameRect: NSRect, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method(reloadData)] + pub unsafe fn reloadData(&self); + + #[method(performSequentialBatchUpdates:)] + pub unsafe fn performSequentialBatchUpdates(&self, updateBlock: &Block<(), ()>); + + #[method(insertItemsAtIndexes:)] + pub unsafe fn insertItemsAtIndexes(&self, indexes: &NSIndexSet); + + #[method(removeItemsAtIndexes:)] + pub unsafe fn removeItemsAtIndexes(&self, indexes: &NSIndexSet); + + #[method(reloadItemsAtIndexes:)] + pub unsafe fn reloadItemsAtIndexes(&self, indexes: &NSIndexSet); + + #[method(moveItemAtIndex:toIndex:)] + pub unsafe fn moveItemAtIndex_toIndex(&self, oldIndex: NSInteger, newIndex: NSInteger); + + #[method(scrollItemAtIndex:toAlignment:)] + pub unsafe fn scrollItemAtIndex_toAlignment( + &self, + index: NSInteger, + alignment: NSScrubberAlignment, + ); + + #[method_id(@__retain_semantics Other itemViewForItemAtIndex:)] + pub unsafe fn itemViewForItemAtIndex( + &self, + index: NSInteger, + ) -> Option>; + + #[method(registerClass:forItemIdentifier:)] + pub unsafe fn registerClass_forItemIdentifier( + &self, + itemViewClass: Option<&Class>, + itemIdentifier: &NSUserInterfaceItemIdentifier, + ); + + #[method(registerNib:forItemIdentifier:)] + pub unsafe fn registerNib_forItemIdentifier( + &self, + nib: Option<&NSNib>, + itemIdentifier: &NSUserInterfaceItemIdentifier, + ); + + #[method_id(@__retain_semantics Other makeItemWithIdentifier:owner:)] + pub unsafe fn makeItemWithIdentifier_owner( + &self, + itemIdentifier: &NSUserInterfaceItemIdentifier, + owner: Option<&Object>, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSScrubberItemView.rs b/crates/icrate/src/generated/AppKit/NSScrubberItemView.rs new file mode 100644 index 000000000..4800cc26f --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSScrubberItemView.rs @@ -0,0 +1,110 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSScrubberArrangedView; + + unsafe impl ClassType for NSScrubberArrangedView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSScrubberArrangedView { + #[method(isSelected)] + pub unsafe fn isSelected(&self) -> bool; + + #[method(setSelected:)] + pub unsafe fn setSelected(&self, selected: bool); + + #[method(isHighlighted)] + pub unsafe fn isHighlighted(&self) -> bool; + + #[method(setHighlighted:)] + pub unsafe fn setHighlighted(&self, highlighted: bool); + + #[method(applyLayoutAttributes:)] + pub unsafe fn applyLayoutAttributes(&self, layoutAttributes: &NSScrubberLayoutAttributes); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSScrubberSelectionView; + + unsafe impl ClassType for NSScrubberSelectionView { + type Super = NSScrubberArrangedView; + } +); + +extern_methods!( + unsafe impl NSScrubberSelectionView {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSScrubberItemView; + + unsafe impl ClassType for NSScrubberItemView { + type Super = NSScrubberArrangedView; + } +); + +extern_methods!( + unsafe impl NSScrubberItemView {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSScrubberTextItemView; + + unsafe impl ClassType for NSScrubberTextItemView { + type Super = NSScrubberItemView; + } +); + +extern_methods!( + unsafe impl NSScrubberTextItemView { + #[method_id(@__retain_semantics Other textField)] + pub unsafe fn textField(&self) -> Id; + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSScrubberImageItemView; + + unsafe impl ClassType for NSScrubberImageItemView { + type Super = NSScrubberItemView; + } +); + +extern_methods!( + unsafe impl NSScrubberImageItemView { + #[method_id(@__retain_semantics Other imageView)] + pub unsafe fn imageView(&self) -> Id; + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Id; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: &NSImage); + + #[method(imageAlignment)] + pub unsafe fn imageAlignment(&self) -> NSImageAlignment; + + #[method(setImageAlignment:)] + pub unsafe fn setImageAlignment(&self, imageAlignment: NSImageAlignment); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSScrubberLayout.rs b/crates/icrate/src/generated/AppKit/NSScrubberLayout.rs new file mode 100644 index 000000000..b18140968 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSScrubberLayout.rs @@ -0,0 +1,182 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSScrubberLayoutAttributes; + + unsafe impl ClassType for NSScrubberLayoutAttributes { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSScrubberLayoutAttributes { + #[method(itemIndex)] + pub unsafe fn itemIndex(&self) -> NSInteger; + + #[method(setItemIndex:)] + pub unsafe fn setItemIndex(&self, itemIndex: NSInteger); + + #[method(frame)] + pub unsafe fn frame(&self) -> NSRect; + + #[method(setFrame:)] + pub unsafe fn setFrame(&self, frame: NSRect); + + #[method(alpha)] + pub unsafe fn alpha(&self) -> CGFloat; + + #[method(setAlpha:)] + pub unsafe fn setAlpha(&self, alpha: CGFloat); + + #[method_id(@__retain_semantics Other layoutAttributesForItemAtIndex:)] + pub unsafe fn layoutAttributesForItemAtIndex(index: NSInteger) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSScrubberLayout; + + unsafe impl ClassType for NSScrubberLayout { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSScrubberLayout { + #[method(layoutAttributesClass)] + pub unsafe fn layoutAttributesClass() -> &'static Class; + + #[method_id(@__retain_semantics Other scrubber)] + pub unsafe fn scrubber(&self) -> Option>; + + #[method(visibleRect)] + pub unsafe fn visibleRect(&self) -> NSRect; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method(invalidateLayout)] + pub unsafe fn invalidateLayout(&self); + + #[method(prepareLayout)] + pub unsafe fn prepareLayout(&self); + + #[method(scrubberContentSize)] + pub unsafe fn scrubberContentSize(&self) -> NSSize; + + #[method_id(@__retain_semantics Other layoutAttributesForItemAtIndex:)] + pub unsafe fn layoutAttributesForItemAtIndex( + &self, + index: NSInteger, + ) -> Option>; + + #[method_id(@__retain_semantics Other layoutAttributesForItemsInRect:)] + pub unsafe fn layoutAttributesForItemsInRect( + &self, + rect: NSRect, + ) -> Id, Shared>; + + #[method(shouldInvalidateLayoutForSelectionChange)] + pub unsafe fn shouldInvalidateLayoutForSelectionChange(&self) -> bool; + + #[method(shouldInvalidateLayoutForHighlightChange)] + pub unsafe fn shouldInvalidateLayoutForHighlightChange(&self) -> bool; + + #[method(shouldInvalidateLayoutForChangeFromVisibleRect:toVisibleRect:)] + pub unsafe fn shouldInvalidateLayoutForChangeFromVisibleRect_toVisibleRect( + &self, + fromVisibleRect: NSRect, + toVisibleRect: NSRect, + ) -> bool; + + #[method(automaticallyMirrorsInRightToLeftLayout)] + pub unsafe fn automaticallyMirrorsInRightToLeftLayout(&self) -> bool; + } +); + +extern_protocol!( + pub struct NSScrubberFlowLayoutDelegate; + + unsafe impl NSScrubberFlowLayoutDelegate { + #[optional] + #[method(scrubber:layout:sizeForItemAtIndex:)] + pub unsafe fn scrubber_layout_sizeForItemAtIndex( + &self, + scrubber: &NSScrubber, + layout: &NSScrubberFlowLayout, + itemIndex: NSInteger, + ) -> NSSize; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSScrubberFlowLayout; + + unsafe impl ClassType for NSScrubberFlowLayout { + type Super = NSScrubberLayout; + } +); + +extern_methods!( + unsafe impl NSScrubberFlowLayout { + #[method(itemSpacing)] + pub unsafe fn itemSpacing(&self) -> CGFloat; + + #[method(setItemSpacing:)] + pub unsafe fn setItemSpacing(&self, itemSpacing: CGFloat); + + #[method(itemSize)] + pub unsafe fn itemSize(&self) -> NSSize; + + #[method(setItemSize:)] + pub unsafe fn setItemSize(&self, itemSize: NSSize); + + #[method(invalidateLayoutForItemsAtIndexes:)] + pub unsafe fn invalidateLayoutForItemsAtIndexes(&self, invalidItemIndexes: &NSIndexSet); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSScrubberProportionalLayout; + + unsafe impl ClassType for NSScrubberProportionalLayout { + type Super = NSScrubberLayout; + } +); + +extern_methods!( + unsafe impl NSScrubberProportionalLayout { + #[method(numberOfVisibleItems)] + pub unsafe fn numberOfVisibleItems(&self) -> NSInteger; + + #[method(setNumberOfVisibleItems:)] + pub unsafe fn setNumberOfVisibleItems(&self, numberOfVisibleItems: NSInteger); + + #[method_id(@__retain_semantics Init initWithNumberOfVisibleItems:)] + pub unsafe fn initWithNumberOfVisibleItems( + this: Option>, + numberOfVisibleItems: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSearchField.rs b/crates/icrate/src/generated/AppKit/NSSearchField.rs new file mode 100644 index 000000000..f20629fbe --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSearchField.rs @@ -0,0 +1,111 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSSearchFieldRecentsAutosaveName = NSString; + +extern_protocol!( + pub struct NSSearchFieldDelegate; + + unsafe impl NSSearchFieldDelegate { + #[optional] + #[method(searchFieldDidStartSearching:)] + pub unsafe fn searchFieldDidStartSearching(&self, sender: &NSSearchField); + + #[optional] + #[method(searchFieldDidEndSearching:)] + pub unsafe fn searchFieldDidEndSearching(&self, sender: &NSSearchField); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSSearchField; + + unsafe impl ClassType for NSSearchField { + type Super = NSTextField; + } +); + +extern_methods!( + unsafe impl NSSearchField { + #[method(searchTextBounds)] + pub unsafe fn searchTextBounds(&self) -> NSRect; + + #[method(searchButtonBounds)] + pub unsafe fn searchButtonBounds(&self) -> NSRect; + + #[method(cancelButtonBounds)] + pub unsafe fn cancelButtonBounds(&self) -> NSRect; + + #[method_id(@__retain_semantics Other recentSearches)] + pub unsafe fn recentSearches(&self) -> Id, Shared>; + + #[method(setRecentSearches:)] + pub unsafe fn setRecentSearches(&self, recentSearches: &NSArray); + + #[method_id(@__retain_semantics Other recentsAutosaveName)] + pub unsafe fn recentsAutosaveName( + &self, + ) -> Option>; + + #[method(setRecentsAutosaveName:)] + pub unsafe fn setRecentsAutosaveName( + &self, + recentsAutosaveName: Option<&NSSearchFieldRecentsAutosaveName>, + ); + + #[method_id(@__retain_semantics Other searchMenuTemplate)] + pub unsafe fn searchMenuTemplate(&self) -> Option>; + + #[method(setSearchMenuTemplate:)] + pub unsafe fn setSearchMenuTemplate(&self, searchMenuTemplate: Option<&NSMenu>); + + #[method(sendsWholeSearchString)] + pub unsafe fn sendsWholeSearchString(&self) -> bool; + + #[method(setSendsWholeSearchString:)] + pub unsafe fn setSendsWholeSearchString(&self, sendsWholeSearchString: bool); + + #[method(maximumRecents)] + pub unsafe fn maximumRecents(&self) -> NSInteger; + + #[method(setMaximumRecents:)] + pub unsafe fn setMaximumRecents(&self, maximumRecents: NSInteger); + + #[method(sendsSearchStringImmediately)] + pub unsafe fn sendsSearchStringImmediately(&self) -> bool; + + #[method(setSendsSearchStringImmediately:)] + pub unsafe fn setSendsSearchStringImmediately(&self, sendsSearchStringImmediately: bool); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSSearchFieldDelegate>); + } +); + +extern_methods!( + /// NSSearchField_Deprecated + unsafe impl NSSearchField { + #[method(rectForSearchTextWhenCentered:)] + pub unsafe fn rectForSearchTextWhenCentered(&self, isCentered: bool) -> NSRect; + + #[method(rectForSearchButtonWhenCentered:)] + pub unsafe fn rectForSearchButtonWhenCentered(&self, isCentered: bool) -> NSRect; + + #[method(rectForCancelButtonWhenCentered:)] + pub unsafe fn rectForCancelButtonWhenCentered(&self, isCentered: bool) -> NSRect; + + #[method(centersPlaceholder)] + pub unsafe fn centersPlaceholder(&self) -> bool; + + #[method(setCentersPlaceholder:)] + pub unsafe fn setCentersPlaceholder(&self, centersPlaceholder: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSearchFieldCell.rs b/crates/icrate/src/generated/AppKit/NSSearchFieldCell.rs new file mode 100644 index 000000000..25956da9c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSearchFieldCell.rs @@ -0,0 +1,113 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSSearchFieldRecentsTitleMenuItemTag: NSInteger = 1000); + +extern_static!(NSSearchFieldRecentsMenuItemTag: NSInteger = 1001); + +extern_static!(NSSearchFieldClearRecentsMenuItemTag: NSInteger = 1002); + +extern_static!(NSSearchFieldNoRecentsMenuItemTag: NSInteger = 1003); + +extern_class!( + #[derive(Debug)] + pub struct NSSearchFieldCell; + + unsafe impl ClassType for NSSearchFieldCell { + type Super = NSTextFieldCell; + } +); + +extern_methods!( + unsafe impl NSSearchFieldCell { + #[method_id(@__retain_semantics Init initTextCell:)] + pub unsafe fn initTextCell( + this: Option>, + string: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Init initImageCell:)] + pub unsafe fn initImageCell( + this: Option>, + image: Option<&NSImage>, + ) -> Id; + + #[method_id(@__retain_semantics Other searchButtonCell)] + pub unsafe fn searchButtonCell(&self) -> Option>; + + #[method(setSearchButtonCell:)] + pub unsafe fn setSearchButtonCell(&self, searchButtonCell: Option<&NSButtonCell>); + + #[method_id(@__retain_semantics Other cancelButtonCell)] + pub unsafe fn cancelButtonCell(&self) -> Option>; + + #[method(setCancelButtonCell:)] + pub unsafe fn setCancelButtonCell(&self, cancelButtonCell: Option<&NSButtonCell>); + + #[method(resetSearchButtonCell)] + pub unsafe fn resetSearchButtonCell(&self); + + #[method(resetCancelButtonCell)] + pub unsafe fn resetCancelButtonCell(&self); + + #[method(searchTextRectForBounds:)] + pub unsafe fn searchTextRectForBounds(&self, rect: NSRect) -> NSRect; + + #[method(searchButtonRectForBounds:)] + pub unsafe fn searchButtonRectForBounds(&self, rect: NSRect) -> NSRect; + + #[method(cancelButtonRectForBounds:)] + pub unsafe fn cancelButtonRectForBounds(&self, rect: NSRect) -> NSRect; + + #[method_id(@__retain_semantics Other searchMenuTemplate)] + pub unsafe fn searchMenuTemplate(&self) -> Option>; + + #[method(setSearchMenuTemplate:)] + pub unsafe fn setSearchMenuTemplate(&self, searchMenuTemplate: Option<&NSMenu>); + + #[method(sendsWholeSearchString)] + pub unsafe fn sendsWholeSearchString(&self) -> bool; + + #[method(setSendsWholeSearchString:)] + pub unsafe fn setSendsWholeSearchString(&self, sendsWholeSearchString: bool); + + #[method(maximumRecents)] + pub unsafe fn maximumRecents(&self) -> NSInteger; + + #[method(setMaximumRecents:)] + pub unsafe fn setMaximumRecents(&self, maximumRecents: NSInteger); + + #[method_id(@__retain_semantics Other recentSearches)] + pub unsafe fn recentSearches(&self) -> Id, Shared>; + + #[method(setRecentSearches:)] + pub unsafe fn setRecentSearches(&self, recentSearches: Option<&NSArray>); + + #[method_id(@__retain_semantics Other recentsAutosaveName)] + pub unsafe fn recentsAutosaveName( + &self, + ) -> Option>; + + #[method(setRecentsAutosaveName:)] + pub unsafe fn setRecentsAutosaveName( + &self, + recentsAutosaveName: Option<&NSSearchFieldRecentsAutosaveName>, + ); + + #[method(sendsSearchStringImmediately)] + pub unsafe fn sendsSearchStringImmediately(&self) -> bool; + + #[method(setSendsSearchStringImmediately:)] + pub unsafe fn setSendsSearchStringImmediately(&self, sendsSearchStringImmediately: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSearchToolbarItem.rs b/crates/icrate/src/generated/AppKit/NSSearchToolbarItem.rs new file mode 100644 index 000000000..de4c6a17f --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSearchToolbarItem.rs @@ -0,0 +1,52 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSSearchToolbarItem; + + unsafe impl ClassType for NSSearchToolbarItem { + type Super = NSToolbarItem; + } +); + +extern_methods!( + unsafe impl NSSearchToolbarItem { + #[method_id(@__retain_semantics Other searchField)] + pub unsafe fn searchField(&self) -> Id; + + #[method(setSearchField:)] + pub unsafe fn setSearchField(&self, searchField: &NSSearchField); + + #[method_id(@__retain_semantics Other view)] + pub unsafe fn view(&self) -> Option>; + + #[method(setView:)] + pub unsafe fn setView(&self, view: Option<&NSView>); + + #[method(resignsFirstResponderWithCancel)] + pub unsafe fn resignsFirstResponderWithCancel(&self) -> bool; + + #[method(setResignsFirstResponderWithCancel:)] + pub unsafe fn setResignsFirstResponderWithCancel( + &self, + resignsFirstResponderWithCancel: bool, + ); + + #[method(preferredWidthForSearchField)] + pub unsafe fn preferredWidthForSearchField(&self) -> CGFloat; + + #[method(setPreferredWidthForSearchField:)] + pub unsafe fn setPreferredWidthForSearchField(&self, preferredWidthForSearchField: CGFloat); + + #[method(beginSearchInteraction)] + pub unsafe fn beginSearchInteraction(&self); + + #[method(endSearchInteraction)] + pub unsafe fn endSearchInteraction(&self); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSecureTextField.rs b/crates/icrate/src/generated/AppKit/NSSecureTextField.rs new file mode 100644 index 000000000..91b41b257 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSecureTextField.rs @@ -0,0 +1,38 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSSecureTextField; + + unsafe impl ClassType for NSSecureTextField { + type Super = NSTextField; + } +); + +extern_methods!( + unsafe impl NSSecureTextField {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSSecureTextFieldCell; + + unsafe impl ClassType for NSSecureTextFieldCell { + type Super = NSTextFieldCell; + } +); + +extern_methods!( + unsafe impl NSSecureTextFieldCell { + #[method(echosBullets)] + pub unsafe fn echosBullets(&self) -> bool; + + #[method(setEchosBullets:)] + pub unsafe fn setEchosBullets(&self, echosBullets: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSegmentedCell.rs b/crates/icrate/src/generated/AppKit/NSSegmentedCell.rs new file mode 100644 index 000000000..5a26c7230 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSegmentedCell.rs @@ -0,0 +1,129 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSSegmentedCell; + + unsafe impl ClassType for NSSegmentedCell { + type Super = NSActionCell; + } +); + +extern_methods!( + unsafe impl NSSegmentedCell { + #[method(segmentCount)] + pub unsafe fn segmentCount(&self) -> NSInteger; + + #[method(setSegmentCount:)] + pub unsafe fn setSegmentCount(&self, segmentCount: NSInteger); + + #[method(selectedSegment)] + pub unsafe fn selectedSegment(&self) -> NSInteger; + + #[method(setSelectedSegment:)] + pub unsafe fn setSelectedSegment(&self, selectedSegment: NSInteger); + + #[method(selectSegmentWithTag:)] + pub unsafe fn selectSegmentWithTag(&self, tag: NSInteger) -> bool; + + #[method(makeNextSegmentKey)] + pub unsafe fn makeNextSegmentKey(&self); + + #[method(makePreviousSegmentKey)] + pub unsafe fn makePreviousSegmentKey(&self); + + #[method(trackingMode)] + pub unsafe fn trackingMode(&self) -> NSSegmentSwitchTracking; + + #[method(setTrackingMode:)] + pub unsafe fn setTrackingMode(&self, trackingMode: NSSegmentSwitchTracking); + + #[method(setWidth:forSegment:)] + pub unsafe fn setWidth_forSegment(&self, width: CGFloat, segment: NSInteger); + + #[method(widthForSegment:)] + pub unsafe fn widthForSegment(&self, segment: NSInteger) -> CGFloat; + + #[method(setImage:forSegment:)] + pub unsafe fn setImage_forSegment(&self, image: Option<&NSImage>, segment: NSInteger); + + #[method_id(@__retain_semantics Other imageForSegment:)] + pub unsafe fn imageForSegment(&self, segment: NSInteger) -> Option>; + + #[method(setImageScaling:forSegment:)] + pub unsafe fn setImageScaling_forSegment( + &self, + scaling: NSImageScaling, + segment: NSInteger, + ); + + #[method(imageScalingForSegment:)] + pub unsafe fn imageScalingForSegment(&self, segment: NSInteger) -> NSImageScaling; + + #[method(setLabel:forSegment:)] + pub unsafe fn setLabel_forSegment(&self, label: &NSString, segment: NSInteger); + + #[method_id(@__retain_semantics Other labelForSegment:)] + pub unsafe fn labelForSegment(&self, segment: NSInteger) -> Option>; + + #[method(setSelected:forSegment:)] + pub unsafe fn setSelected_forSegment(&self, selected: bool, segment: NSInteger); + + #[method(isSelectedForSegment:)] + pub unsafe fn isSelectedForSegment(&self, segment: NSInteger) -> bool; + + #[method(setEnabled:forSegment:)] + pub unsafe fn setEnabled_forSegment(&self, enabled: bool, segment: NSInteger); + + #[method(isEnabledForSegment:)] + pub unsafe fn isEnabledForSegment(&self, segment: NSInteger) -> bool; + + #[method(setMenu:forSegment:)] + pub unsafe fn setMenu_forSegment(&self, menu: Option<&NSMenu>, segment: NSInteger); + + #[method_id(@__retain_semantics Other menuForSegment:)] + pub unsafe fn menuForSegment(&self, segment: NSInteger) -> Option>; + + #[method(setToolTip:forSegment:)] + pub unsafe fn setToolTip_forSegment(&self, toolTip: Option<&NSString>, segment: NSInteger); + + #[method_id(@__retain_semantics Other toolTipForSegment:)] + pub unsafe fn toolTipForSegment(&self, segment: NSInteger) -> Option>; + + #[method(setTag:forSegment:)] + pub unsafe fn setTag_forSegment(&self, tag: NSInteger, segment: NSInteger); + + #[method(tagForSegment:)] + pub unsafe fn tagForSegment(&self, segment: NSInteger) -> NSInteger; + + #[method(segmentStyle)] + pub unsafe fn segmentStyle(&self) -> NSSegmentStyle; + + #[method(setSegmentStyle:)] + pub unsafe fn setSegmentStyle(&self, segmentStyle: NSSegmentStyle); + + #[method(drawSegment:inFrame:withView:)] + pub unsafe fn drawSegment_inFrame_withView( + &self, + segment: NSInteger, + frame: NSRect, + controlView: &NSView, + ); + } +); + +extern_methods!( + /// NSSegmentBackgroundStyle + unsafe impl NSSegmentedCell { + #[method(interiorBackgroundStyleForSegment:)] + pub unsafe fn interiorBackgroundStyleForSegment( + &self, + segment: NSInteger, + ) -> NSBackgroundStyle; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSegmentedControl.rs b/crates/icrate/src/generated/AppKit/NSSegmentedControl.rs new file mode 100644 index 000000000..228fd68e9 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSegmentedControl.rs @@ -0,0 +1,223 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSSegmentSwitchTracking { + NSSegmentSwitchTrackingSelectOne = 0, + NSSegmentSwitchTrackingSelectAny = 1, + NSSegmentSwitchTrackingMomentary = 2, + NSSegmentSwitchTrackingMomentaryAccelerator = 3, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSSegmentStyle { + NSSegmentStyleAutomatic = 0, + NSSegmentStyleRounded = 1, + NSSegmentStyleRoundRect = 3, + NSSegmentStyleTexturedSquare = 4, + NSSegmentStyleSmallSquare = 6, + NSSegmentStyleSeparated = 8, + NSSegmentStyleTexturedRounded = 2, + NSSegmentStyleCapsule = 5, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSSegmentDistribution { + NSSegmentDistributionFit = 0, + NSSegmentDistributionFill = 1, + NSSegmentDistributionFillEqually = 2, + NSSegmentDistributionFillProportionally = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSSegmentedControl; + + unsafe impl ClassType for NSSegmentedControl { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSSegmentedControl { + #[method(segmentCount)] + pub unsafe fn segmentCount(&self) -> NSInteger; + + #[method(setSegmentCount:)] + pub unsafe fn setSegmentCount(&self, segmentCount: NSInteger); + + #[method(selectedSegment)] + pub unsafe fn selectedSegment(&self) -> NSInteger; + + #[method(setSelectedSegment:)] + pub unsafe fn setSelectedSegment(&self, selectedSegment: NSInteger); + + #[method(selectSegmentWithTag:)] + pub unsafe fn selectSegmentWithTag(&self, tag: NSInteger) -> bool; + + #[method(setWidth:forSegment:)] + pub unsafe fn setWidth_forSegment(&self, width: CGFloat, segment: NSInteger); + + #[method(widthForSegment:)] + pub unsafe fn widthForSegment(&self, segment: NSInteger) -> CGFloat; + + #[method(setImage:forSegment:)] + pub unsafe fn setImage_forSegment(&self, image: Option<&NSImage>, segment: NSInteger); + + #[method_id(@__retain_semantics Other imageForSegment:)] + pub unsafe fn imageForSegment(&self, segment: NSInteger) -> Option>; + + #[method(setImageScaling:forSegment:)] + pub unsafe fn setImageScaling_forSegment( + &self, + scaling: NSImageScaling, + segment: NSInteger, + ); + + #[method(imageScalingForSegment:)] + pub unsafe fn imageScalingForSegment(&self, segment: NSInteger) -> NSImageScaling; + + #[method(setLabel:forSegment:)] + pub unsafe fn setLabel_forSegment(&self, label: &NSString, segment: NSInteger); + + #[method_id(@__retain_semantics Other labelForSegment:)] + pub unsafe fn labelForSegment(&self, segment: NSInteger) -> Option>; + + #[method(setMenu:forSegment:)] + pub unsafe fn setMenu_forSegment(&self, menu: Option<&NSMenu>, segment: NSInteger); + + #[method_id(@__retain_semantics Other menuForSegment:)] + pub unsafe fn menuForSegment(&self, segment: NSInteger) -> Option>; + + #[method(setSelected:forSegment:)] + pub unsafe fn setSelected_forSegment(&self, selected: bool, segment: NSInteger); + + #[method(isSelectedForSegment:)] + pub unsafe fn isSelectedForSegment(&self, segment: NSInteger) -> bool; + + #[method(setEnabled:forSegment:)] + pub unsafe fn setEnabled_forSegment(&self, enabled: bool, segment: NSInteger); + + #[method(isEnabledForSegment:)] + pub unsafe fn isEnabledForSegment(&self, segment: NSInteger) -> bool; + + #[method(setToolTip:forSegment:)] + pub unsafe fn setToolTip_forSegment(&self, toolTip: Option<&NSString>, segment: NSInteger); + + #[method_id(@__retain_semantics Other toolTipForSegment:)] + pub unsafe fn toolTipForSegment(&self, segment: NSInteger) -> Option>; + + #[method(setTag:forSegment:)] + pub unsafe fn setTag_forSegment(&self, tag: NSInteger, segment: NSInteger); + + #[method(tagForSegment:)] + pub unsafe fn tagForSegment(&self, segment: NSInteger) -> NSInteger; + + #[method(setShowsMenuIndicator:forSegment:)] + pub unsafe fn setShowsMenuIndicator_forSegment( + &self, + showsMenuIndicator: bool, + segment: NSInteger, + ); + + #[method(showsMenuIndicatorForSegment:)] + pub unsafe fn showsMenuIndicatorForSegment(&self, segment: NSInteger) -> bool; + + #[method(segmentStyle)] + pub unsafe fn segmentStyle(&self) -> NSSegmentStyle; + + #[method(setSegmentStyle:)] + pub unsafe fn setSegmentStyle(&self, segmentStyle: NSSegmentStyle); + + #[method(isSpringLoaded)] + pub unsafe fn isSpringLoaded(&self) -> bool; + + #[method(setSpringLoaded:)] + pub unsafe fn setSpringLoaded(&self, springLoaded: bool); + + #[method(trackingMode)] + pub unsafe fn trackingMode(&self) -> NSSegmentSwitchTracking; + + #[method(setTrackingMode:)] + pub unsafe fn setTrackingMode(&self, trackingMode: NSSegmentSwitchTracking); + + #[method(doubleValueForSelectedSegment)] + pub unsafe fn doubleValueForSelectedSegment(&self) -> c_double; + + #[method_id(@__retain_semantics Other selectedSegmentBezelColor)] + pub unsafe fn selectedSegmentBezelColor(&self) -> Option>; + + #[method(setSelectedSegmentBezelColor:)] + pub unsafe fn setSelectedSegmentBezelColor( + &self, + selectedSegmentBezelColor: Option<&NSColor>, + ); + + #[method(indexOfSelectedItem)] + pub unsafe fn indexOfSelectedItem(&self) -> NSInteger; + + #[method(setAlignment:forSegment:)] + pub unsafe fn setAlignment_forSegment( + &self, + alignment: NSTextAlignment, + segment: NSInteger, + ); + + #[method(alignmentForSegment:)] + pub unsafe fn alignmentForSegment(&self, segment: NSInteger) -> NSTextAlignment; + + #[method(segmentDistribution)] + pub unsafe fn segmentDistribution(&self) -> NSSegmentDistribution; + + #[method(setSegmentDistribution:)] + pub unsafe fn setSegmentDistribution(&self, segmentDistribution: NSSegmentDistribution); + + #[method(compressWithPrioritizedCompressionOptions:)] + pub unsafe fn compressWithPrioritizedCompressionOptions( + &self, + prioritizedOptions: &NSArray, + ); + + #[method(minimumSizeWithPrioritizedCompressionOptions:)] + pub unsafe fn minimumSizeWithPrioritizedCompressionOptions( + &self, + prioritizedOptions: &NSArray, + ) -> NSSize; + + #[method_id(@__retain_semantics Other activeCompressionOptions)] + pub unsafe fn activeCompressionOptions( + &self, + ) -> Id; + } +); + +extern_methods!( + /// NSSegmentedControlConvenience + unsafe impl NSSegmentedControl { + #[method_id(@__retain_semantics Other segmentedControlWithLabels:trackingMode:target:action:)] + pub unsafe fn segmentedControlWithLabels_trackingMode_target_action( + labels: &NSArray, + trackingMode: NSSegmentSwitchTracking, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Other segmentedControlWithImages:trackingMode:target:action:)] + pub unsafe fn segmentedControlWithImages_trackingMode_target_action( + images: &NSArray, + trackingMode: NSSegmentSwitchTracking, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSShadow.rs b/crates/icrate/src/generated/AppKit/NSShadow.rs new file mode 100644 index 000000000..db96e5ed1 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSShadow.rs @@ -0,0 +1,43 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSShadow; + + unsafe impl ClassType for NSShadow { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSShadow { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(shadowOffset)] + pub unsafe fn shadowOffset(&self) -> NSSize; + + #[method(setShadowOffset:)] + pub unsafe fn setShadowOffset(&self, shadowOffset: NSSize); + + #[method(shadowBlurRadius)] + pub unsafe fn shadowBlurRadius(&self) -> CGFloat; + + #[method(setShadowBlurRadius:)] + pub unsafe fn setShadowBlurRadius(&self, shadowBlurRadius: CGFloat); + + #[method_id(@__retain_semantics Other shadowColor)] + pub unsafe fn shadowColor(&self) -> Option>; + + #[method(setShadowColor:)] + pub unsafe fn setShadowColor(&self, shadowColor: Option<&NSColor>); + + #[method(set)] + pub unsafe fn set(&self); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSharingService.rs b/crates/icrate/src/generated/AppKit/NSSharingService.rs new file mode 100644 index 000000000..a85ae5741 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSharingService.rs @@ -0,0 +1,331 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSSharingServiceName = NSString; + +extern_static!(NSSharingServiceNameComposeEmail: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNameComposeMessage: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNameSendViaAirDrop: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNameAddToSafariReadingList: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNameAddToIPhoto: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNameAddToAperture: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNameUseAsDesktopPicture: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNamePostOnFacebook: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNamePostOnTwitter: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNamePostOnSinaWeibo: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNamePostOnTencentWeibo: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNamePostOnLinkedIn: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNameUseAsTwitterProfileImage: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNameUseAsFacebookProfileImage: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNameUseAsLinkedInProfileImage: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNamePostImageOnFlickr: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNamePostVideoOnVimeo: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNamePostVideoOnYouku: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNamePostVideoOnTudou: &'static NSSharingServiceName); + +extern_static!(NSSharingServiceNameCloudSharing: &'static NSSharingServiceName); + +extern_class!( + #[derive(Debug)] + pub struct NSSharingService; + + unsafe impl ClassType for NSSharingService { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSSharingService { + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSSharingServiceDelegate>); + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Id; + + #[method_id(@__retain_semantics Other alternateImage)] + pub unsafe fn alternateImage(&self) -> Option>; + + #[method_id(@__retain_semantics Other menuItemTitle)] + pub unsafe fn menuItemTitle(&self) -> Id; + + #[method(setMenuItemTitle:)] + pub unsafe fn setMenuItemTitle(&self, menuItemTitle: &NSString); + + #[method_id(@__retain_semantics Other recipients)] + pub unsafe fn recipients(&self) -> Option, Shared>>; + + #[method(setRecipients:)] + pub unsafe fn setRecipients(&self, recipients: Option<&NSArray>); + + #[method_id(@__retain_semantics Other subject)] + pub unsafe fn subject(&self) -> Option>; + + #[method(setSubject:)] + pub unsafe fn setSubject(&self, subject: Option<&NSString>); + + #[method_id(@__retain_semantics Other messageBody)] + pub unsafe fn messageBody(&self) -> Option>; + + #[method_id(@__retain_semantics Other permanentLink)] + pub unsafe fn permanentLink(&self) -> Option>; + + #[method_id(@__retain_semantics Other accountName)] + pub unsafe fn accountName(&self) -> Option>; + + #[method_id(@__retain_semantics Other attachmentFileURLs)] + pub unsafe fn attachmentFileURLs(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other sharingServicesForItems:)] + pub unsafe fn sharingServicesForItems( + items: &NSArray, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other sharingServiceNamed:)] + pub unsafe fn sharingServiceNamed( + serviceName: &NSSharingServiceName, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithTitle:image:alternateImage:handler:)] + pub unsafe fn initWithTitle_image_alternateImage_handler( + this: Option>, + title: &NSString, + image: &NSImage, + alternateImage: Option<&NSImage>, + block: &Block<(), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(canPerformWithItems:)] + pub unsafe fn canPerformWithItems(&self, items: Option<&NSArray>) -> bool; + + #[method(performWithItems:)] + pub unsafe fn performWithItems(&self, items: &NSArray); + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSSharingContentScope { + NSSharingContentScopeItem = 0, + NSSharingContentScopePartial = 1, + NSSharingContentScopeFull = 2, + } +); + +extern_protocol!( + pub struct NSSharingServiceDelegate; + + unsafe impl NSSharingServiceDelegate { + #[optional] + #[method(sharingService:willShareItems:)] + pub unsafe fn sharingService_willShareItems( + &self, + sharingService: &NSSharingService, + items: &NSArray, + ); + + #[optional] + #[method(sharingService:didFailToShareItems:error:)] + pub unsafe fn sharingService_didFailToShareItems_error( + &self, + sharingService: &NSSharingService, + items: &NSArray, + error: &NSError, + ); + + #[optional] + #[method(sharingService:didShareItems:)] + pub unsafe fn sharingService_didShareItems( + &self, + sharingService: &NSSharingService, + items: &NSArray, + ); + + #[optional] + #[method(sharingService:sourceFrameOnScreenForShareItem:)] + pub unsafe fn sharingService_sourceFrameOnScreenForShareItem( + &self, + sharingService: &NSSharingService, + item: &Object, + ) -> NSRect; + + #[optional] + #[method_id(@__retain_semantics Other sharingService:transitionImageForShareItem:contentRect:)] + pub unsafe fn sharingService_transitionImageForShareItem_contentRect( + &self, + sharingService: &NSSharingService, + item: &Object, + contentRect: NonNull, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other sharingService:sourceWindowForShareItems:sharingContentScope:)] + pub unsafe fn sharingService_sourceWindowForShareItems_sharingContentScope( + &self, + sharingService: &NSSharingService, + items: &NSArray, + sharingContentScope: NonNull, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other anchoringViewForSharingService:showRelativeToRect:preferredEdge:)] + pub unsafe fn anchoringViewForSharingService_showRelativeToRect_preferredEdge( + &self, + sharingService: &NSSharingService, + positioningRect: NonNull, + preferredEdge: NonNull, + ) -> Option>; + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSCloudKitSharingServiceOptions { + NSCloudKitSharingServiceStandard = 0, + NSCloudKitSharingServiceAllowPublic = 1 << 0, + NSCloudKitSharingServiceAllowPrivate = 1 << 1, + NSCloudKitSharingServiceAllowReadOnly = 1 << 4, + NSCloudKitSharingServiceAllowReadWrite = 1 << 5, + } +); + +extern_protocol!( + pub struct NSCloudSharingServiceDelegate; + + unsafe impl NSCloudSharingServiceDelegate { + #[optional] + #[method(sharingService:didCompleteForItems:error:)] + pub unsafe fn sharingService_didCompleteForItems_error( + &self, + sharingService: &NSSharingService, + items: &NSArray, + error: Option<&NSError>, + ); + + #[optional] + #[method(optionsForSharingService:shareProvider:)] + pub unsafe fn optionsForSharingService_shareProvider( + &self, + cloudKitSharingService: &NSSharingService, + provider: &NSItemProvider, + ) -> NSCloudKitSharingServiceOptions; + + #[optional] + #[method(sharingService:didSaveShare:)] + pub unsafe fn sharingService_didSaveShare( + &self, + sharingService: &NSSharingService, + share: &CKShare, + ); + + #[optional] + #[method(sharingService:didStopSharing:)] + pub unsafe fn sharingService_didStopSharing( + &self, + sharingService: &NSSharingService, + share: &CKShare, + ); + } +); + +extern_methods!( + /// NSCloudKitSharing + unsafe impl NSItemProvider {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSSharingServicePicker; + + unsafe impl ClassType for NSSharingServicePicker { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSSharingServicePicker { + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSSharingServicePickerDelegate>); + + #[method_id(@__retain_semantics Init initWithItems:)] + pub unsafe fn initWithItems( + this: Option>, + items: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(showRelativeToRect:ofView:preferredEdge:)] + pub unsafe fn showRelativeToRect_ofView_preferredEdge( + &self, + rect: NSRect, + view: &NSView, + preferredEdge: NSRectEdge, + ); + } +); + +extern_protocol!( + pub struct NSSharingServicePickerDelegate; + + unsafe impl NSSharingServicePickerDelegate { + #[optional] + #[method_id(@__retain_semantics Other sharingServicePicker:sharingServicesForItems:proposedSharingServices:)] + pub unsafe fn sharingServicePicker_sharingServicesForItems_proposedSharingServices( + &self, + sharingServicePicker: &NSSharingServicePicker, + items: &NSArray, + proposedServices: &NSArray, + ) -> Id, Shared>; + + #[optional] + #[method_id(@__retain_semantics Other sharingServicePicker:delegateForSharingService:)] + pub unsafe fn sharingServicePicker_delegateForSharingService( + &self, + sharingServicePicker: &NSSharingServicePicker, + sharingService: &NSSharingService, + ) -> Option>; + + #[optional] + #[method(sharingServicePicker:didChooseSharingService:)] + pub unsafe fn sharingServicePicker_didChooseSharingService( + &self, + sharingServicePicker: &NSSharingServicePicker, + service: Option<&NSSharingService>, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSharingServicePickerToolbarItem.rs b/crates/icrate/src/generated/AppKit/NSSharingServicePickerToolbarItem.rs new file mode 100644 index 000000000..b4e33008f --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSharingServicePickerToolbarItem.rs @@ -0,0 +1,42 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSSharingServicePickerToolbarItem; + + unsafe impl ClassType for NSSharingServicePickerToolbarItem { + type Super = NSToolbarItem; + } +); + +extern_methods!( + unsafe impl NSSharingServicePickerToolbarItem { + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate( + &self, + ) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate( + &self, + delegate: Option<&NSSharingServicePickerToolbarItemDelegate>, + ); + } +); + +extern_protocol!( + pub struct NSSharingServicePickerToolbarItemDelegate; + + unsafe impl NSSharingServicePickerToolbarItemDelegate { + #[method_id(@__retain_semantics Other itemsForSharingServicePickerToolbarItem:)] + pub unsafe fn itemsForSharingServicePickerToolbarItem( + &self, + pickerToolbarItem: &NSSharingServicePickerToolbarItem, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSharingServicePickerTouchBarItem.rs b/crates/icrate/src/generated/AppKit/NSSharingServicePickerTouchBarItem.rs new file mode 100644 index 000000000..feb23989f --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSharingServicePickerTouchBarItem.rs @@ -0,0 +1,60 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSSharingServicePickerTouchBarItem; + + unsafe impl ClassType for NSSharingServicePickerTouchBarItem { + type Super = NSTouchBarItem; + } +); + +extern_methods!( + unsafe impl NSSharingServicePickerTouchBarItem { + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate( + &self, + ) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate( + &self, + delegate: Option<&NSSharingServicePickerTouchBarItemDelegate>, + ); + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + + #[method_id(@__retain_semantics Other buttonTitle)] + pub unsafe fn buttonTitle(&self) -> Id; + + #[method(setButtonTitle:)] + pub unsafe fn setButtonTitle(&self, buttonTitle: &NSString); + + #[method_id(@__retain_semantics Other buttonImage)] + pub unsafe fn buttonImage(&self) -> Option>; + + #[method(setButtonImage:)] + pub unsafe fn setButtonImage(&self, buttonImage: Option<&NSImage>); + } +); + +extern_protocol!( + pub struct NSSharingServicePickerTouchBarItemDelegate; + + unsafe impl NSSharingServicePickerTouchBarItemDelegate { + #[method_id(@__retain_semantics Other itemsForSharingServicePickerTouchBarItem:)] + pub unsafe fn itemsForSharingServicePickerTouchBarItem( + &self, + pickerTouchBarItem: &NSSharingServicePickerTouchBarItem, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSlider.rs b/crates/icrate/src/generated/AppKit/NSSlider.rs new file mode 100644 index 000000000..c42f8d3be --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSlider.rs @@ -0,0 +1,153 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSSlider; + + unsafe impl ClassType for NSSlider { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSSlider { + #[method(sliderType)] + pub unsafe fn sliderType(&self) -> NSSliderType; + + #[method(setSliderType:)] + pub unsafe fn setSliderType(&self, sliderType: NSSliderType); + + #[method(minValue)] + pub unsafe fn minValue(&self) -> c_double; + + #[method(setMinValue:)] + pub unsafe fn setMinValue(&self, minValue: c_double); + + #[method(maxValue)] + pub unsafe fn maxValue(&self) -> c_double; + + #[method(setMaxValue:)] + pub unsafe fn setMaxValue(&self, maxValue: c_double); + + #[method(altIncrementValue)] + pub unsafe fn altIncrementValue(&self) -> c_double; + + #[method(setAltIncrementValue:)] + pub unsafe fn setAltIncrementValue(&self, altIncrementValue: c_double); + + #[method(knobThickness)] + pub unsafe fn knobThickness(&self) -> CGFloat; + + #[method(acceptsFirstMouse:)] + pub unsafe fn acceptsFirstMouse(&self, event: Option<&NSEvent>) -> bool; + + #[method_id(@__retain_semantics Other trackFillColor)] + pub unsafe fn trackFillColor(&self) -> Option>; + + #[method(setTrackFillColor:)] + pub unsafe fn setTrackFillColor(&self, trackFillColor: Option<&NSColor>); + } +); + +extern_methods!( + /// NSSliderVerticalGetter + unsafe impl NSSlider {} +); + +extern_methods!( + /// NSTickMarkSupport + unsafe impl NSSlider { + #[method(numberOfTickMarks)] + pub unsafe fn numberOfTickMarks(&self) -> NSInteger; + + #[method(setNumberOfTickMarks:)] + pub unsafe fn setNumberOfTickMarks(&self, numberOfTickMarks: NSInteger); + + #[method(tickMarkPosition)] + pub unsafe fn tickMarkPosition(&self) -> NSTickMarkPosition; + + #[method(setTickMarkPosition:)] + pub unsafe fn setTickMarkPosition(&self, tickMarkPosition: NSTickMarkPosition); + + #[method(allowsTickMarkValuesOnly)] + pub unsafe fn allowsTickMarkValuesOnly(&self) -> bool; + + #[method(setAllowsTickMarkValuesOnly:)] + pub unsafe fn setAllowsTickMarkValuesOnly(&self, allowsTickMarkValuesOnly: bool); + + #[method(tickMarkValueAtIndex:)] + pub unsafe fn tickMarkValueAtIndex(&self, index: NSInteger) -> c_double; + + #[method(rectOfTickMarkAtIndex:)] + pub unsafe fn rectOfTickMarkAtIndex(&self, index: NSInteger) -> NSRect; + + #[method(indexOfTickMarkAtPoint:)] + pub unsafe fn indexOfTickMarkAtPoint(&self, point: NSPoint) -> NSInteger; + + #[method(closestTickMarkValueToValue:)] + pub unsafe fn closestTickMarkValueToValue(&self, value: c_double) -> c_double; + } +); + +extern_methods!( + /// NSSliderConvenience + unsafe impl NSSlider { + #[method_id(@__retain_semantics Other sliderWithTarget:action:)] + pub unsafe fn sliderWithTarget_action( + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Other sliderWithValue:minValue:maxValue:target:action:)] + pub unsafe fn sliderWithValue_minValue_maxValue_target_action( + value: c_double, + minValue: c_double, + maxValue: c_double, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + } +); + +extern_methods!( + /// NSSliderDeprecated + unsafe impl NSSlider { + #[method(setTitleCell:)] + pub unsafe fn setTitleCell(&self, cell: Option<&NSCell>); + + #[method_id(@__retain_semantics Other titleCell)] + pub unsafe fn titleCell(&self) -> Option>; + + #[method(setTitleColor:)] + pub unsafe fn setTitleColor(&self, newColor: Option<&NSColor>); + + #[method_id(@__retain_semantics Other titleColor)] + pub unsafe fn titleColor(&self) -> Option>; + + #[method(setTitleFont:)] + pub unsafe fn setTitleFont(&self, fontObj: Option<&NSFont>); + + #[method_id(@__retain_semantics Other titleFont)] + pub unsafe fn titleFont(&self) -> Option>; + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Option>; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, string: Option<&NSString>); + + #[method(setKnobThickness:)] + pub unsafe fn setKnobThickness(&self, thickness: CGFloat); + + #[method(setImage:)] + pub unsafe fn setImage(&self, backgroundImage: Option<&NSImage>); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSliderAccessory.rs b/crates/icrate/src/generated/AppKit/NSSliderAccessory.rs new file mode 100644 index 000000000..974914bf7 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSliderAccessory.rs @@ -0,0 +1,74 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSSliderAccessory; + + unsafe impl ClassType for NSSliderAccessory { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSSliderAccessory { + #[method_id(@__retain_semantics Other accessoryWithImage:)] + pub unsafe fn accessoryWithImage(image: &NSImage) -> Id; + + #[method_id(@__retain_semantics Other behavior)] + pub unsafe fn behavior(&self) -> Id; + + #[method(setBehavior:)] + pub unsafe fn setBehavior(&self, behavior: &NSSliderAccessoryBehavior); + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + } +); + +extern_methods!( + unsafe impl NSSliderAccessory {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSSliderAccessoryBehavior; + + unsafe impl ClassType for NSSliderAccessoryBehavior { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSSliderAccessoryBehavior { + #[method_id(@__retain_semantics Other automaticBehavior)] + pub unsafe fn automaticBehavior() -> Id; + + #[method_id(@__retain_semantics Other valueStepBehavior)] + pub unsafe fn valueStepBehavior() -> Id; + + #[method_id(@__retain_semantics Other valueResetBehavior)] + pub unsafe fn valueResetBehavior() -> Id; + + #[method_id(@__retain_semantics Other behaviorWithTarget:action:)] + pub unsafe fn behaviorWithTarget_action( + target: Option<&Object>, + action: Sel, + ) -> Id; + + #[method_id(@__retain_semantics Other behaviorWithHandler:)] + pub unsafe fn behaviorWithHandler( + handler: &Block<(NonNull,), ()>, + ) -> Id; + + #[method(handleAction:)] + pub unsafe fn handleAction(&self, sender: &NSSliderAccessory); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSliderCell.rs b/crates/icrate/src/generated/AppKit/NSSliderCell.rs new file mode 100644 index 000000000..41fb3f065 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSliderCell.rs @@ -0,0 +1,172 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTickMarkPosition { + NSTickMarkPositionBelow = 0, + NSTickMarkPositionAbove = 1, + NSTickMarkPositionLeading = NSTickMarkPositionAbove, + NSTickMarkPositionTrailing = NSTickMarkPositionBelow, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSSliderType { + NSSliderTypeLinear = 0, + NSSliderTypeCircular = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSSliderCell; + + unsafe impl ClassType for NSSliderCell { + type Super = NSActionCell; + } +); + +extern_methods!( + unsafe impl NSSliderCell { + #[method(prefersTrackingUntilMouseUp)] + pub unsafe fn prefersTrackingUntilMouseUp() -> bool; + + #[method(minValue)] + pub unsafe fn minValue(&self) -> c_double; + + #[method(setMinValue:)] + pub unsafe fn setMinValue(&self, minValue: c_double); + + #[method(maxValue)] + pub unsafe fn maxValue(&self) -> c_double; + + #[method(setMaxValue:)] + pub unsafe fn setMaxValue(&self, maxValue: c_double); + + #[method(altIncrementValue)] + pub unsafe fn altIncrementValue(&self) -> c_double; + + #[method(setAltIncrementValue:)] + pub unsafe fn setAltIncrementValue(&self, altIncrementValue: c_double); + + #[method(sliderType)] + pub unsafe fn sliderType(&self) -> NSSliderType; + + #[method(setSliderType:)] + pub unsafe fn setSliderType(&self, sliderType: NSSliderType); + + #[method(trackRect)] + pub unsafe fn trackRect(&self) -> NSRect; + + #[method(knobThickness)] + pub unsafe fn knobThickness(&self) -> CGFloat; + + #[method(knobRectFlipped:)] + pub unsafe fn knobRectFlipped(&self, flipped: bool) -> NSRect; + + #[method(barRectFlipped:)] + pub unsafe fn barRectFlipped(&self, flipped: bool) -> NSRect; + + #[method(drawBarInside:flipped:)] + pub unsafe fn drawBarInside_flipped(&self, rect: NSRect, flipped: bool); + } +); + +extern_methods!( + /// NSSliderCellVerticalGetter + unsafe impl NSSliderCell {} +); + +extern_methods!( + /// NSTickMarkSupport + unsafe impl NSSliderCell { + #[method(numberOfTickMarks)] + pub unsafe fn numberOfTickMarks(&self) -> NSInteger; + + #[method(setNumberOfTickMarks:)] + pub unsafe fn setNumberOfTickMarks(&self, numberOfTickMarks: NSInteger); + + #[method(tickMarkPosition)] + pub unsafe fn tickMarkPosition(&self) -> NSTickMarkPosition; + + #[method(setTickMarkPosition:)] + pub unsafe fn setTickMarkPosition(&self, tickMarkPosition: NSTickMarkPosition); + + #[method(allowsTickMarkValuesOnly)] + pub unsafe fn allowsTickMarkValuesOnly(&self) -> bool; + + #[method(setAllowsTickMarkValuesOnly:)] + pub unsafe fn setAllowsTickMarkValuesOnly(&self, allowsTickMarkValuesOnly: bool); + + #[method(tickMarkValueAtIndex:)] + pub unsafe fn tickMarkValueAtIndex(&self, index: NSInteger) -> c_double; + + #[method(rectOfTickMarkAtIndex:)] + pub unsafe fn rectOfTickMarkAtIndex(&self, index: NSInteger) -> NSRect; + + #[method(indexOfTickMarkAtPoint:)] + pub unsafe fn indexOfTickMarkAtPoint(&self, point: NSPoint) -> NSInteger; + + #[method(closestTickMarkValueToValue:)] + pub unsafe fn closestTickMarkValueToValue(&self, value: c_double) -> c_double; + + #[method(drawTickMarks)] + pub unsafe fn drawTickMarks(&self); + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSSliderCell { + #[method(setTitleCell:)] + pub unsafe fn setTitleCell(&self, cell: Option<&NSCell>); + + #[method_id(@__retain_semantics Other titleCell)] + pub unsafe fn titleCell(&self) -> Option>; + + #[method(setTitleColor:)] + pub unsafe fn setTitleColor(&self, newColor: Option<&NSColor>); + + #[method_id(@__retain_semantics Other titleColor)] + pub unsafe fn titleColor(&self) -> Option>; + + #[method(setTitleFont:)] + pub unsafe fn setTitleFont(&self, fontObj: Option<&NSFont>); + + #[method_id(@__retain_semantics Other titleFont)] + pub unsafe fn titleFont(&self) -> Option>; + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Option>; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, string: Option<&NSString>); + + #[method(setKnobThickness:)] + pub unsafe fn setKnobThickness(&self, thickness: CGFloat); + + #[method(setImage:)] + pub unsafe fn setImage(&self, backgroundImage: Option<&NSImage>); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + } +); + +extern_static!(NSTickMarkBelow: NSTickMarkPosition = NSTickMarkPositionBelow); + +extern_static!(NSTickMarkAbove: NSTickMarkPosition = NSTickMarkPositionAbove); + +extern_static!(NSTickMarkLeft: NSTickMarkPosition = NSTickMarkPositionLeading); + +extern_static!(NSTickMarkRight: NSTickMarkPosition = NSTickMarkPositionTrailing); + +extern_static!(NSLinearSlider: NSSliderType = NSSliderTypeLinear); + +extern_static!(NSCircularSlider: NSSliderType = NSSliderTypeCircular); diff --git a/crates/icrate/src/generated/AppKit/NSSliderTouchBarItem.rs b/crates/icrate/src/generated/AppKit/NSSliderTouchBarItem.rs new file mode 100644 index 000000000..e0244fd85 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSliderTouchBarItem.rs @@ -0,0 +1,100 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSSliderAccessoryWidth = CGFloat; + +extern_static!(NSSliderAccessoryWidthDefault: NSSliderAccessoryWidth); + +extern_static!(NSSliderAccessoryWidthWide: NSSliderAccessoryWidth); + +extern_class!( + #[derive(Debug)] + pub struct NSSliderTouchBarItem; + + unsafe impl ClassType for NSSliderTouchBarItem { + type Super = NSTouchBarItem; + } +); + +extern_methods!( + unsafe impl NSSliderTouchBarItem { + #[method_id(@__retain_semantics Other view)] + pub unsafe fn view(&self) -> Id; + + #[method_id(@__retain_semantics Other slider)] + pub unsafe fn slider(&self) -> Id; + + #[method(setSlider:)] + pub unsafe fn setSlider(&self, slider: &NSSlider); + + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + + #[method(setDoubleValue:)] + pub unsafe fn setDoubleValue(&self, doubleValue: c_double); + + #[method(minimumSliderWidth)] + pub unsafe fn minimumSliderWidth(&self) -> CGFloat; + + #[method(setMinimumSliderWidth:)] + pub unsafe fn setMinimumSliderWidth(&self, minimumSliderWidth: CGFloat); + + #[method(maximumSliderWidth)] + pub unsafe fn maximumSliderWidth(&self) -> CGFloat; + + #[method(setMaximumSliderWidth:)] + pub unsafe fn setMaximumSliderWidth(&self, maximumSliderWidth: CGFloat); + + #[method_id(@__retain_semantics Other label)] + pub unsafe fn label(&self) -> Option>; + + #[method(setLabel:)] + pub unsafe fn setLabel(&self, label: Option<&NSString>); + + #[method_id(@__retain_semantics Other minimumValueAccessory)] + pub unsafe fn minimumValueAccessory(&self) -> Option>; + + #[method(setMinimumValueAccessory:)] + pub unsafe fn setMinimumValueAccessory( + &self, + minimumValueAccessory: Option<&NSSliderAccessory>, + ); + + #[method_id(@__retain_semantics Other maximumValueAccessory)] + pub unsafe fn maximumValueAccessory(&self) -> Option>; + + #[method(setMaximumValueAccessory:)] + pub unsafe fn setMaximumValueAccessory( + &self, + maximumValueAccessory: Option<&NSSliderAccessory>, + ); + + #[method(valueAccessoryWidth)] + pub unsafe fn valueAccessoryWidth(&self) -> NSSliderAccessoryWidth; + + #[method(setValueAccessoryWidth:)] + pub unsafe fn setValueAccessoryWidth(&self, valueAccessoryWidth: NSSliderAccessoryWidth); + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: OptionSel); + + #[method_id(@__retain_semantics Other customizationLabel)] + pub unsafe fn customizationLabel(&self) -> Id; + + #[method(setCustomizationLabel:)] + pub unsafe fn setCustomizationLabel(&self, customizationLabel: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSound.rs b/crates/icrate/src/generated/AppKit/NSSound.rs new file mode 100644 index 000000000..1642ed71d --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSound.rs @@ -0,0 +1,160 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSSoundPboardType: &'static NSPasteboardType); + +pub type NSSoundName = NSString; + +pub type NSSoundPlaybackDeviceIdentifier = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSSound; + + unsafe impl ClassType for NSSound { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSSound { + #[method_id(@__retain_semantics Other soundNamed:)] + pub unsafe fn soundNamed(name: &NSSoundName) -> Option>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:byReference:)] + pub unsafe fn initWithContentsOfURL_byReference( + this: Option>, + url: &NSURL, + byRef: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContentsOfFile:byReference:)] + pub unsafe fn initWithContentsOfFile_byReference( + this: Option>, + path: &NSString, + byRef: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithData:)] + pub unsafe fn initWithData( + this: Option>, + data: &NSData, + ) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, string: Option<&NSSoundName>) -> bool; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(canInitWithPasteboard:)] + pub unsafe fn canInitWithPasteboard(pasteboard: &NSPasteboard) -> bool; + + #[method_id(@__retain_semantics Other soundUnfilteredTypes)] + pub unsafe fn soundUnfilteredTypes() -> Id, Shared>; + + #[method_id(@__retain_semantics Init initWithPasteboard:)] + pub unsafe fn initWithPasteboard( + this: Option>, + pasteboard: &NSPasteboard, + ) -> Option>; + + #[method(writeToPasteboard:)] + pub unsafe fn writeToPasteboard(&self, pasteboard: &NSPasteboard); + + #[method(play)] + pub unsafe fn play(&self) -> bool; + + #[method(pause)] + pub unsafe fn pause(&self) -> bool; + + #[method(resume)] + pub unsafe fn resume(&self) -> bool; + + #[method(stop)] + pub unsafe fn stop(&self) -> bool; + + #[method(isPlaying)] + pub unsafe fn isPlaying(&self) -> bool; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSSoundDelegate>); + + #[method(duration)] + pub unsafe fn duration(&self) -> NSTimeInterval; + + #[method(volume)] + pub unsafe fn volume(&self) -> c_float; + + #[method(setVolume:)] + pub unsafe fn setVolume(&self, volume: c_float); + + #[method(currentTime)] + pub unsafe fn currentTime(&self) -> NSTimeInterval; + + #[method(setCurrentTime:)] + pub unsafe fn setCurrentTime(&self, currentTime: NSTimeInterval); + + #[method(loops)] + pub unsafe fn loops(&self) -> bool; + + #[method(setLoops:)] + pub unsafe fn setLoops(&self, loops: bool); + + #[method_id(@__retain_semantics Other playbackDeviceIdentifier)] + pub unsafe fn playbackDeviceIdentifier( + &self, + ) -> Option>; + + #[method(setPlaybackDeviceIdentifier:)] + pub unsafe fn setPlaybackDeviceIdentifier( + &self, + playbackDeviceIdentifier: Option<&NSSoundPlaybackDeviceIdentifier>, + ); + + #[method(setChannelMapping:)] + pub unsafe fn setChannelMapping(&self, channelMapping: Option<&NSArray>); + + #[method_id(@__retain_semantics Other channelMapping)] + pub unsafe fn channelMapping(&self) -> Option>; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSSound { + #[method_id(@__retain_semantics Other soundUnfilteredFileTypes)] + pub unsafe fn soundUnfilteredFileTypes() -> Option>; + + #[method_id(@__retain_semantics Other soundUnfilteredPasteboardTypes)] + pub unsafe fn soundUnfilteredPasteboardTypes() -> Option>; + } +); + +extern_protocol!( + pub struct NSSoundDelegate; + + unsafe impl NSSoundDelegate { + #[optional] + #[method(sound:didFinishPlaying:)] + pub unsafe fn sound_didFinishPlaying(&self, sound: &NSSound, flag: bool); + } +); + +extern_methods!( + /// NSBundleSoundExtensions + unsafe impl NSBundle { + #[method_id(@__retain_semantics Other pathForSoundResource:)] + pub unsafe fn pathForSoundResource( + &self, + name: &NSSoundName, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSpeechRecognizer.rs b/crates/icrate/src/generated/AppKit/NSSpeechRecognizer.rs new file mode 100644 index 000000000..269e994eb --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSpeechRecognizer.rs @@ -0,0 +1,72 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSSpeechRecognizer; + + unsafe impl ClassType for NSSpeechRecognizer { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSSpeechRecognizer { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Option>; + + #[method(startListening)] + pub unsafe fn startListening(&self); + + #[method(stopListening)] + pub unsafe fn stopListening(&self); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSSpeechRecognizerDelegate>); + + #[method_id(@__retain_semantics Other commands)] + pub unsafe fn commands(&self) -> Option, Shared>>; + + #[method(setCommands:)] + pub unsafe fn setCommands(&self, commands: Option<&NSArray>); + + #[method_id(@__retain_semantics Other displayedCommandsTitle)] + pub unsafe fn displayedCommandsTitle(&self) -> Option>; + + #[method(setDisplayedCommandsTitle:)] + pub unsafe fn setDisplayedCommandsTitle(&self, displayedCommandsTitle: Option<&NSString>); + + #[method(listensInForegroundOnly)] + pub unsafe fn listensInForegroundOnly(&self) -> bool; + + #[method(setListensInForegroundOnly:)] + pub unsafe fn setListensInForegroundOnly(&self, listensInForegroundOnly: bool); + + #[method(blocksOtherRecognizers)] + pub unsafe fn blocksOtherRecognizers(&self) -> bool; + + #[method(setBlocksOtherRecognizers:)] + pub unsafe fn setBlocksOtherRecognizers(&self, blocksOtherRecognizers: bool); + } +); + +extern_protocol!( + pub struct NSSpeechRecognizerDelegate; + + unsafe impl NSSpeechRecognizerDelegate { + #[optional] + #[method(speechRecognizer:didRecognizeCommand:)] + pub unsafe fn speechRecognizer_didRecognizeCommand( + &self, + sender: &NSSpeechRecognizer, + command: &NSString, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSpeechSynthesizer.rs b/crates/icrate/src/generated/AppKit/NSSpeechSynthesizer.rs new file mode 100644 index 000000000..ae9ab5794 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSpeechSynthesizer.rs @@ -0,0 +1,306 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSSpeechSynthesizerVoiceName = NSString; + +pub type NSVoiceAttributeKey = NSString; + +extern_static!(NSVoiceName: &'static NSVoiceAttributeKey); + +extern_static!(NSVoiceIdentifier: &'static NSVoiceAttributeKey); + +extern_static!(NSVoiceAge: &'static NSVoiceAttributeKey); + +extern_static!(NSVoiceGender: &'static NSVoiceAttributeKey); + +extern_static!(NSVoiceDemoText: &'static NSVoiceAttributeKey); + +extern_static!(NSVoiceLocaleIdentifier: &'static NSVoiceAttributeKey); + +extern_static!(NSVoiceSupportedCharacters: &'static NSVoiceAttributeKey); + +extern_static!(NSVoiceIndividuallySpokenCharacters: &'static NSVoiceAttributeKey); + +pub type NSSpeechDictionaryKey = NSString; + +extern_static!(NSSpeechDictionaryLocaleIdentifier: &'static NSSpeechDictionaryKey); + +extern_static!(NSSpeechDictionaryModificationDate: &'static NSSpeechDictionaryKey); + +extern_static!(NSSpeechDictionaryPronunciations: &'static NSSpeechDictionaryKey); + +extern_static!(NSSpeechDictionaryAbbreviations: &'static NSSpeechDictionaryKey); + +extern_static!(NSSpeechDictionaryEntrySpelling: &'static NSSpeechDictionaryKey); + +extern_static!(NSSpeechDictionaryEntryPhonemes: &'static NSSpeechDictionaryKey); + +pub type NSVoiceGenderName = NSString; + +extern_static!(NSVoiceGenderNeuter: &'static NSVoiceGenderName); + +extern_static!(NSVoiceGenderMale: &'static NSVoiceGenderName); + +extern_static!(NSVoiceGenderFemale: &'static NSVoiceGenderName); + +extern_static!(NSVoiceGenderNeutral: &'static NSVoiceGenderName); + +pub type NSSpeechPropertyKey = NSString; + +extern_static!(NSSpeechStatusProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechErrorsProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechInputModeProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechCharacterModeProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechNumberModeProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechRateProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechPitchBaseProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechPitchModProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechVolumeProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechSynthesizerInfoProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechRecentSyncProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechPhonemeSymbolsProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechCurrentVoiceProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechCommandDelimiterProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechResetProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSSpeechOutputToFileURLProperty: &'static NSSpeechPropertyKey); + +extern_static!(NSVoiceLanguage: &'static NSVoiceAttributeKey); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSSpeechBoundary { + NSSpeechImmediateBoundary = 0, + NSSpeechWordBoundary = 1, + NSSpeechSentenceBoundary = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSSpeechSynthesizer; + + unsafe impl ClassType for NSSpeechSynthesizer { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSSpeechSynthesizer { + #[method_id(@__retain_semantics Init initWithVoice:)] + pub unsafe fn initWithVoice( + this: Option>, + voice: Option<&NSSpeechSynthesizerVoiceName>, + ) -> Option>; + + #[method(startSpeakingString:)] + pub unsafe fn startSpeakingString(&self, string: &NSString) -> bool; + + #[method(startSpeakingString:toURL:)] + pub unsafe fn startSpeakingString_toURL(&self, string: &NSString, url: &NSURL) -> bool; + + #[method(isSpeaking)] + pub unsafe fn isSpeaking(&self) -> bool; + + #[method(stopSpeaking)] + pub unsafe fn stopSpeaking(&self); + + #[method(stopSpeakingAtBoundary:)] + pub unsafe fn stopSpeakingAtBoundary(&self, boundary: NSSpeechBoundary); + + #[method(pauseSpeakingAtBoundary:)] + pub unsafe fn pauseSpeakingAtBoundary(&self, boundary: NSSpeechBoundary); + + #[method(continueSpeaking)] + pub unsafe fn continueSpeaking(&self); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSSpeechSynthesizerDelegate>); + + #[method_id(@__retain_semantics Other voice)] + pub unsafe fn voice(&self) -> Option>; + + #[method(setVoice:)] + pub unsafe fn setVoice(&self, voice: Option<&NSSpeechSynthesizerVoiceName>) -> bool; + + #[method(rate)] + pub unsafe fn rate(&self) -> c_float; + + #[method(setRate:)] + pub unsafe fn setRate(&self, rate: c_float); + + #[method(volume)] + pub unsafe fn volume(&self) -> c_float; + + #[method(setVolume:)] + pub unsafe fn setVolume(&self, volume: c_float); + + #[method(usesFeedbackWindow)] + pub unsafe fn usesFeedbackWindow(&self) -> bool; + + #[method(setUsesFeedbackWindow:)] + pub unsafe fn setUsesFeedbackWindow(&self, usesFeedbackWindow: bool); + + #[method(addSpeechDictionary:)] + pub unsafe fn addSpeechDictionary( + &self, + speechDictionary: &NSDictionary, + ); + + #[method_id(@__retain_semantics Other phonemesFromText:)] + pub unsafe fn phonemesFromText(&self, text: &NSString) -> Id; + + #[method_id(@__retain_semantics Other objectForProperty:error:)] + pub unsafe fn objectForProperty_error( + &self, + property: &NSSpeechPropertyKey, + ) -> Result, Id>; + + #[method(setObject:forProperty:error:)] + pub unsafe fn setObject_forProperty_error( + &self, + object: Option<&Object>, + property: &NSSpeechPropertyKey, + ) -> Result<(), Id>; + + #[method(isAnyApplicationSpeaking)] + pub unsafe fn isAnyApplicationSpeaking() -> bool; + + #[method_id(@__retain_semantics Other defaultVoice)] + pub unsafe fn defaultVoice() -> Id; + + #[method_id(@__retain_semantics Other availableVoices)] + pub unsafe fn availableVoices() -> Id, Shared>; + + #[method_id(@__retain_semantics Other attributesForVoice:)] + pub unsafe fn attributesForVoice( + voice: &NSSpeechSynthesizerVoiceName, + ) -> Id, Shared>; + } +); + +extern_protocol!( + pub struct NSSpeechSynthesizerDelegate; + + unsafe impl NSSpeechSynthesizerDelegate { + #[optional] + #[method(speechSynthesizer:didFinishSpeaking:)] + pub unsafe fn speechSynthesizer_didFinishSpeaking( + &self, + sender: &NSSpeechSynthesizer, + finishedSpeaking: bool, + ); + + #[optional] + #[method(speechSynthesizer:willSpeakWord:ofString:)] + pub unsafe fn speechSynthesizer_willSpeakWord_ofString( + &self, + sender: &NSSpeechSynthesizer, + characterRange: NSRange, + string: &NSString, + ); + + #[optional] + #[method(speechSynthesizer:willSpeakPhoneme:)] + pub unsafe fn speechSynthesizer_willSpeakPhoneme( + &self, + sender: &NSSpeechSynthesizer, + phonemeOpcode: c_short, + ); + + #[optional] + #[method(speechSynthesizer:didEncounterErrorAtIndex:ofString:message:)] + pub unsafe fn speechSynthesizer_didEncounterErrorAtIndex_ofString_message( + &self, + sender: &NSSpeechSynthesizer, + characterIndex: NSUInteger, + string: &NSString, + message: &NSString, + ); + + #[optional] + #[method(speechSynthesizer:didEncounterSyncMessage:)] + pub unsafe fn speechSynthesizer_didEncounterSyncMessage( + &self, + sender: &NSSpeechSynthesizer, + message: &NSString, + ); + } +); + +pub type NSSpeechMode = NSString; + +extern_static!(NSSpeechModeText: &'static NSSpeechMode); + +extern_static!(NSSpeechModePhoneme: &'static NSSpeechMode); + +extern_static!(NSSpeechModeNormal: &'static NSSpeechMode); + +extern_static!(NSSpeechModeLiteral: &'static NSSpeechMode); + +pub type NSSpeechStatusKey = NSString; + +extern_static!(NSSpeechStatusOutputBusy: &'static NSSpeechStatusKey); + +extern_static!(NSSpeechStatusOutputPaused: &'static NSSpeechStatusKey); + +extern_static!(NSSpeechStatusNumberOfCharactersLeft: &'static NSSpeechStatusKey); + +extern_static!(NSSpeechStatusPhonemeCode: &'static NSSpeechStatusKey); + +pub type NSSpeechErrorKey = NSString; + +extern_static!(NSSpeechErrorCount: &'static NSSpeechErrorKey); + +extern_static!(NSSpeechErrorOldestCode: &'static NSSpeechErrorKey); + +extern_static!(NSSpeechErrorOldestCharacterOffset: &'static NSSpeechErrorKey); + +extern_static!(NSSpeechErrorNewestCode: &'static NSSpeechErrorKey); + +extern_static!(NSSpeechErrorNewestCharacterOffset: &'static NSSpeechErrorKey); + +pub type NSSpeechSynthesizerInfoKey = NSString; + +extern_static!(NSSpeechSynthesizerInfoIdentifier: &'static NSSpeechSynthesizerInfoKey); + +extern_static!(NSSpeechSynthesizerInfoVersion: &'static NSSpeechSynthesizerInfoKey); + +pub type NSSpeechPhonemeInfoKey = NSString; + +extern_static!(NSSpeechPhonemeInfoOpcode: &'static NSSpeechPhonemeInfoKey); + +extern_static!(NSSpeechPhonemeInfoSymbol: &'static NSSpeechPhonemeInfoKey); + +extern_static!(NSSpeechPhonemeInfoExample: &'static NSSpeechPhonemeInfoKey); + +extern_static!(NSSpeechPhonemeInfoHiliteStart: &'static NSSpeechPhonemeInfoKey); + +extern_static!(NSSpeechPhonemeInfoHiliteEnd: &'static NSSpeechPhonemeInfoKey); + +pub type NSSpeechCommandDelimiterKey = NSString; + +extern_static!(NSSpeechCommandPrefix: &'static NSSpeechCommandDelimiterKey); + +extern_static!(NSSpeechCommandSuffix: &'static NSSpeechCommandDelimiterKey); diff --git a/crates/icrate/src/generated/AppKit/NSSpellChecker.rs b/crates/icrate/src/generated/AppKit/NSSpellChecker.rs new file mode 100644 index 000000000..48fbf9dc5 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSpellChecker.rs @@ -0,0 +1,401 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSTextCheckingOptionKey = NSString; + +extern_static!(NSTextCheckingOrthographyKey: &'static NSTextCheckingOptionKey); + +extern_static!(NSTextCheckingQuotesKey: &'static NSTextCheckingOptionKey); + +extern_static!(NSTextCheckingReplacementsKey: &'static NSTextCheckingOptionKey); + +extern_static!(NSTextCheckingReferenceDateKey: &'static NSTextCheckingOptionKey); + +extern_static!(NSTextCheckingReferenceTimeZoneKey: &'static NSTextCheckingOptionKey); + +extern_static!(NSTextCheckingDocumentURLKey: &'static NSTextCheckingOptionKey); + +extern_static!(NSTextCheckingDocumentTitleKey: &'static NSTextCheckingOptionKey); + +extern_static!(NSTextCheckingDocumentAuthorKey: &'static NSTextCheckingOptionKey); + +extern_static!(NSTextCheckingRegularExpressionsKey: &'static NSTextCheckingOptionKey); + +extern_static!(NSTextCheckingSelectedRangeKey: &'static NSTextCheckingOptionKey); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSCorrectionResponse { + NSCorrectionResponseNone = 0, + NSCorrectionResponseAccepted = 1, + NSCorrectionResponseRejected = 2, + NSCorrectionResponseIgnored = 3, + NSCorrectionResponseEdited = 4, + NSCorrectionResponseReverted = 5, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSCorrectionIndicatorType { + NSCorrectionIndicatorTypeDefault = 0, + NSCorrectionIndicatorTypeReversion = 1, + NSCorrectionIndicatorTypeGuesses = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSSpellChecker; + + unsafe impl ClassType for NSSpellChecker { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSSpellChecker { + #[method_id(@__retain_semantics Other sharedSpellChecker)] + pub unsafe fn sharedSpellChecker() -> Id; + + #[method(sharedSpellCheckerExists)] + pub unsafe fn sharedSpellCheckerExists() -> bool; + + #[method(uniqueSpellDocumentTag)] + pub unsafe fn uniqueSpellDocumentTag() -> NSInteger; + + #[method(checkSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount:)] + pub unsafe fn checkSpellingOfString_startingAt_language_wrap_inSpellDocumentWithTag_wordCount( + &self, + stringToCheck: &NSString, + startingOffset: NSInteger, + language: Option<&NSString>, + wrapFlag: bool, + tag: NSInteger, + wordCount: *mut NSInteger, + ) -> NSRange; + + #[method(checkSpellingOfString:startingAt:)] + pub unsafe fn checkSpellingOfString_startingAt( + &self, + stringToCheck: &NSString, + startingOffset: NSInteger, + ) -> NSRange; + + #[method(countWordsInString:language:)] + pub unsafe fn countWordsInString_language( + &self, + stringToCount: &NSString, + language: Option<&NSString>, + ) -> NSInteger; + + #[method(checkGrammarOfString:startingAt:language:wrap:inSpellDocumentWithTag:details:)] + pub unsafe fn checkGrammarOfString_startingAt_language_wrap_inSpellDocumentWithTag_details( + &self, + stringToCheck: &NSString, + startingOffset: NSInteger, + language: Option<&NSString>, + wrapFlag: bool, + tag: NSInteger, + details: *mut *mut NSArray>, + ) -> NSRange; + + #[method_id(@__retain_semantics Other checkString:range:types:options:inSpellDocumentWithTag:orthography:wordCount:)] + pub unsafe fn checkString_range_types_options_inSpellDocumentWithTag_orthography_wordCount( + &self, + stringToCheck: &NSString, + range: NSRange, + checkingTypes: NSTextCheckingTypes, + options: Option<&NSDictionary>, + tag: NSInteger, + orthography: *mut *mut NSOrthography, + wordCount: *mut NSInteger, + ) -> Id, Shared>; + + #[method(requestCheckingOfString:range:types:options:inSpellDocumentWithTag:completionHandler:)] + pub unsafe fn requestCheckingOfString_range_types_options_inSpellDocumentWithTag_completionHandler( + &self, + stringToCheck: &NSString, + range: NSRange, + checkingTypes: NSTextCheckingTypes, + options: Option<&NSDictionary>, + tag: NSInteger, + completionHandler: Option< + &Block< + ( + NSInteger, + NonNull>, + NonNull, + NSInteger, + ), + (), + >, + >, + ) -> NSInteger; + + #[method(requestCandidatesForSelectedRange:inString:types:options:inSpellDocumentWithTag:completionHandler:)] + pub unsafe fn requestCandidatesForSelectedRange_inString_types_options_inSpellDocumentWithTag_completionHandler( + &self, + selectedRange: NSRange, + stringToCheck: &NSString, + checkingTypes: NSTextCheckingTypes, + options: Option<&NSDictionary>, + tag: NSInteger, + completionHandler: Option< + &Block<(NSInteger, NonNull>), ()>, + >, + ) -> NSInteger; + + #[method_id(@__retain_semantics Other menuForResult:string:options:atLocation:inView:)] + pub unsafe fn menuForResult_string_options_atLocation_inView( + &self, + result: &NSTextCheckingResult, + checkedString: &NSString, + options: Option<&NSDictionary>, + location: NSPoint, + view: &NSView, + ) -> Option>; + + #[method_id(@__retain_semantics Other userQuotesArrayForLanguage:)] + pub unsafe fn userQuotesArrayForLanguage( + &self, + language: &NSString, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other userReplacementsDictionary)] + pub unsafe fn userReplacementsDictionary( + &self, + ) -> Id, Shared>; + + #[method(updateSpellingPanelWithMisspelledWord:)] + pub unsafe fn updateSpellingPanelWithMisspelledWord(&self, word: &NSString); + + #[method(updateSpellingPanelWithGrammarString:detail:)] + pub unsafe fn updateSpellingPanelWithGrammarString_detail( + &self, + string: &NSString, + detail: &NSDictionary, + ); + + #[method_id(@__retain_semantics Other spellingPanel)] + pub unsafe fn spellingPanel(&self) -> Id; + + #[method_id(@__retain_semantics Other accessoryView)] + pub unsafe fn accessoryView(&self) -> Option>; + + #[method(setAccessoryView:)] + pub unsafe fn setAccessoryView(&self, accessoryView: Option<&NSView>); + + #[method_id(@__retain_semantics Other substitutionsPanel)] + pub unsafe fn substitutionsPanel(&self) -> Id; + + #[method_id(@__retain_semantics Other substitutionsPanelAccessoryViewController)] + pub unsafe fn substitutionsPanelAccessoryViewController( + &self, + ) -> Option>; + + #[method(setSubstitutionsPanelAccessoryViewController:)] + pub unsafe fn setSubstitutionsPanelAccessoryViewController( + &self, + substitutionsPanelAccessoryViewController: Option<&NSViewController>, + ); + + #[method(updatePanels)] + pub unsafe fn updatePanels(&self); + + #[method(ignoreWord:inSpellDocumentWithTag:)] + pub unsafe fn ignoreWord_inSpellDocumentWithTag( + &self, + wordToIgnore: &NSString, + tag: NSInteger, + ); + + #[method_id(@__retain_semantics Other ignoredWordsInSpellDocumentWithTag:)] + pub unsafe fn ignoredWordsInSpellDocumentWithTag( + &self, + tag: NSInteger, + ) -> Option, Shared>>; + + #[method(setIgnoredWords:inSpellDocumentWithTag:)] + pub unsafe fn setIgnoredWords_inSpellDocumentWithTag( + &self, + words: &NSArray, + tag: NSInteger, + ); + + #[method_id(@__retain_semantics Other guessesForWordRange:inString:language:inSpellDocumentWithTag:)] + pub unsafe fn guessesForWordRange_inString_language_inSpellDocumentWithTag( + &self, + range: NSRange, + string: &NSString, + language: Option<&NSString>, + tag: NSInteger, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other correctionForWordRange:inString:language:inSpellDocumentWithTag:)] + pub unsafe fn correctionForWordRange_inString_language_inSpellDocumentWithTag( + &self, + range: NSRange, + string: &NSString, + language: &NSString, + tag: NSInteger, + ) -> Option>; + + #[method_id(@__retain_semantics Other completionsForPartialWordRange:inString:language:inSpellDocumentWithTag:)] + pub unsafe fn completionsForPartialWordRange_inString_language_inSpellDocumentWithTag( + &self, + range: NSRange, + string: &NSString, + language: Option<&NSString>, + tag: NSInteger, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other languageForWordRange:inString:orthography:)] + pub unsafe fn languageForWordRange_inString_orthography( + &self, + range: NSRange, + string: &NSString, + orthography: Option<&NSOrthography>, + ) -> Option>; + + #[method(closeSpellDocumentWithTag:)] + pub unsafe fn closeSpellDocumentWithTag(&self, tag: NSInteger); + + #[method(recordResponse:toCorrection:forWord:language:inSpellDocumentWithTag:)] + pub unsafe fn recordResponse_toCorrection_forWord_language_inSpellDocumentWithTag( + &self, + response: NSCorrectionResponse, + correction: &NSString, + word: &NSString, + language: Option<&NSString>, + tag: NSInteger, + ); + + #[method(showCorrectionIndicatorOfType:primaryString:alternativeStrings:forStringInRect:view:completionHandler:)] + pub unsafe fn showCorrectionIndicatorOfType_primaryString_alternativeStrings_forStringInRect_view_completionHandler( + &self, + type_: NSCorrectionIndicatorType, + primaryString: &NSString, + alternativeStrings: &NSArray, + rectOfTypedString: NSRect, + view: &NSView, + completionBlock: Option<&Block<(*mut NSString,), ()>>, + ); + + #[method(dismissCorrectionIndicatorForView:)] + pub unsafe fn dismissCorrectionIndicatorForView(&self, view: &NSView); + + #[method(preventsAutocorrectionBeforeString:language:)] + pub unsafe fn preventsAutocorrectionBeforeString_language( + &self, + string: &NSString, + language: Option<&NSString>, + ) -> bool; + + #[method(deletesAutospaceBetweenString:andString:language:)] + pub unsafe fn deletesAutospaceBetweenString_andString_language( + &self, + precedingString: &NSString, + followingString: &NSString, + language: Option<&NSString>, + ) -> bool; + + #[method_id(@__retain_semantics Other availableLanguages)] + pub unsafe fn availableLanguages(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other userPreferredLanguages)] + pub unsafe fn userPreferredLanguages(&self) -> Id, Shared>; + + #[method(automaticallyIdentifiesLanguages)] + pub unsafe fn automaticallyIdentifiesLanguages(&self) -> bool; + + #[method(setAutomaticallyIdentifiesLanguages:)] + pub unsafe fn setAutomaticallyIdentifiesLanguages( + &self, + automaticallyIdentifiesLanguages: bool, + ); + + #[method(setWordFieldStringValue:)] + pub unsafe fn setWordFieldStringValue(&self, string: &NSString); + + #[method(learnWord:)] + pub unsafe fn learnWord(&self, word: &NSString); + + #[method(hasLearnedWord:)] + pub unsafe fn hasLearnedWord(&self, word: &NSString) -> bool; + + #[method(unlearnWord:)] + pub unsafe fn unlearnWord(&self, word: &NSString); + + #[method(isAutomaticTextReplacementEnabled)] + pub unsafe fn isAutomaticTextReplacementEnabled() -> bool; + + #[method(isAutomaticSpellingCorrectionEnabled)] + pub unsafe fn isAutomaticSpellingCorrectionEnabled() -> bool; + + #[method(isAutomaticQuoteSubstitutionEnabled)] + pub unsafe fn isAutomaticQuoteSubstitutionEnabled() -> bool; + + #[method(isAutomaticDashSubstitutionEnabled)] + pub unsafe fn isAutomaticDashSubstitutionEnabled() -> bool; + + #[method(isAutomaticCapitalizationEnabled)] + pub unsafe fn isAutomaticCapitalizationEnabled() -> bool; + + #[method(isAutomaticPeriodSubstitutionEnabled)] + pub unsafe fn isAutomaticPeriodSubstitutionEnabled() -> bool; + + #[method(isAutomaticTextCompletionEnabled)] + pub unsafe fn isAutomaticTextCompletionEnabled() -> bool; + + #[method_id(@__retain_semantics Other language)] + pub unsafe fn language(&self) -> Id; + + #[method(setLanguage:)] + pub unsafe fn setLanguage(&self, language: &NSString) -> bool; + } +); + +extern_static!( + NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification: &'static NSNotificationName +); + +extern_static!( + NSSpellCheckerDidChangeAutomaticTextReplacementNotification: &'static NSNotificationName +); + +extern_static!( + NSSpellCheckerDidChangeAutomaticQuoteSubstitutionNotification: &'static NSNotificationName +); + +extern_static!( + NSSpellCheckerDidChangeAutomaticDashSubstitutionNotification: &'static NSNotificationName +); + +extern_static!( + NSSpellCheckerDidChangeAutomaticCapitalizationNotification: &'static NSNotificationName +); + +extern_static!( + NSSpellCheckerDidChangeAutomaticPeriodSubstitutionNotification: &'static NSNotificationName +); + +extern_static!( + NSSpellCheckerDidChangeAutomaticTextCompletionNotification: &'static NSNotificationName +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSSpellChecker { + #[method_id(@__retain_semantics Other guessesForWord:)] + pub unsafe fn guessesForWord(&self, word: Option<&NSString>) + -> Option>; + + #[method(forgetWord:)] + pub unsafe fn forgetWord(&self, word: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSpellProtocol.rs b/crates/icrate/src/generated/AppKit/NSSpellProtocol.rs new file mode 100644 index 000000000..b77857ff6 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSpellProtocol.rs @@ -0,0 +1,24 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSChangeSpelling; + + unsafe impl NSChangeSpelling { + #[method(changeSpelling:)] + pub unsafe fn changeSpelling(&self, sender: Option<&Object>); + } +); + +extern_protocol!( + pub struct NSIgnoreMisspelledWords; + + unsafe impl NSIgnoreMisspelledWords { + #[method(ignoreSpelling:)] + pub unsafe fn ignoreSpelling(&self, sender: Option<&Object>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSplitView.rs b/crates/icrate/src/generated/AppKit/NSSplitView.rs new file mode 100644 index 000000000..4d06318b9 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSplitView.rs @@ -0,0 +1,239 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSSplitViewAutosaveName = NSString; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSSplitViewDividerStyle { + NSSplitViewDividerStyleThick = 1, + NSSplitViewDividerStyleThin = 2, + NSSplitViewDividerStylePaneSplitter = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSSplitView; + + unsafe impl ClassType for NSSplitView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSSplitView { + #[method(isVertical)] + pub unsafe fn isVertical(&self) -> bool; + + #[method(setVertical:)] + pub unsafe fn setVertical(&self, vertical: bool); + + #[method(dividerStyle)] + pub unsafe fn dividerStyle(&self) -> NSSplitViewDividerStyle; + + #[method(setDividerStyle:)] + pub unsafe fn setDividerStyle(&self, dividerStyle: NSSplitViewDividerStyle); + + #[method_id(@__retain_semantics Other autosaveName)] + pub unsafe fn autosaveName(&self) -> Option>; + + #[method(setAutosaveName:)] + pub unsafe fn setAutosaveName(&self, autosaveName: Option<&NSSplitViewAutosaveName>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSSplitViewDelegate>); + + #[method(drawDividerInRect:)] + pub unsafe fn drawDividerInRect(&self, rect: NSRect); + + #[method_id(@__retain_semantics Other dividerColor)] + pub unsafe fn dividerColor(&self) -> Id; + + #[method(dividerThickness)] + pub unsafe fn dividerThickness(&self) -> CGFloat; + + #[method(adjustSubviews)] + pub unsafe fn adjustSubviews(&self); + + #[method(isSubviewCollapsed:)] + pub unsafe fn isSubviewCollapsed(&self, subview: &NSView) -> bool; + + #[method(minPossiblePositionOfDividerAtIndex:)] + pub unsafe fn minPossiblePositionOfDividerAtIndex( + &self, + dividerIndex: NSInteger, + ) -> CGFloat; + + #[method(maxPossiblePositionOfDividerAtIndex:)] + pub unsafe fn maxPossiblePositionOfDividerAtIndex( + &self, + dividerIndex: NSInteger, + ) -> CGFloat; + + #[method(setPosition:ofDividerAtIndex:)] + pub unsafe fn setPosition_ofDividerAtIndex( + &self, + position: CGFloat, + dividerIndex: NSInteger, + ); + + #[method(holdingPriorityForSubviewAtIndex:)] + pub unsafe fn holdingPriorityForSubviewAtIndex( + &self, + subviewIndex: NSInteger, + ) -> NSLayoutPriority; + + #[method(setHoldingPriority:forSubviewAtIndex:)] + pub unsafe fn setHoldingPriority_forSubviewAtIndex( + &self, + priority: NSLayoutPriority, + subviewIndex: NSInteger, + ); + } +); + +extern_methods!( + /// NSSplitViewArrangedSubviews + unsafe impl NSSplitView { + #[method(arrangesAllSubviews)] + pub unsafe fn arrangesAllSubviews(&self) -> bool; + + #[method(setArrangesAllSubviews:)] + pub unsafe fn setArrangesAllSubviews(&self, arrangesAllSubviews: bool); + + #[method_id(@__retain_semantics Other arrangedSubviews)] + pub unsafe fn arrangedSubviews(&self) -> Id, Shared>; + + #[method(addArrangedSubview:)] + pub unsafe fn addArrangedSubview(&self, view: &NSView); + + #[method(insertArrangedSubview:atIndex:)] + pub unsafe fn insertArrangedSubview_atIndex(&self, view: &NSView, index: NSInteger); + + #[method(removeArrangedSubview:)] + pub unsafe fn removeArrangedSubview(&self, view: &NSView); + } +); + +extern_protocol!( + pub struct NSSplitViewDelegate; + + unsafe impl NSSplitViewDelegate { + #[optional] + #[method(splitView:canCollapseSubview:)] + pub unsafe fn splitView_canCollapseSubview( + &self, + splitView: &NSSplitView, + subview: &NSView, + ) -> bool; + + #[optional] + #[method(splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:)] + pub unsafe fn splitView_shouldCollapseSubview_forDoubleClickOnDividerAtIndex( + &self, + splitView: &NSSplitView, + subview: &NSView, + dividerIndex: NSInteger, + ) -> bool; + + #[optional] + #[method(splitView:constrainMinCoordinate:ofSubviewAt:)] + pub unsafe fn splitView_constrainMinCoordinate_ofSubviewAt( + &self, + splitView: &NSSplitView, + proposedMinimumPosition: CGFloat, + dividerIndex: NSInteger, + ) -> CGFloat; + + #[optional] + #[method(splitView:constrainMaxCoordinate:ofSubviewAt:)] + pub unsafe fn splitView_constrainMaxCoordinate_ofSubviewAt( + &self, + splitView: &NSSplitView, + proposedMaximumPosition: CGFloat, + dividerIndex: NSInteger, + ) -> CGFloat; + + #[optional] + #[method(splitView:constrainSplitPosition:ofSubviewAt:)] + pub unsafe fn splitView_constrainSplitPosition_ofSubviewAt( + &self, + splitView: &NSSplitView, + proposedPosition: CGFloat, + dividerIndex: NSInteger, + ) -> CGFloat; + + #[optional] + #[method(splitView:resizeSubviewsWithOldSize:)] + pub unsafe fn splitView_resizeSubviewsWithOldSize( + &self, + splitView: &NSSplitView, + oldSize: NSSize, + ); + + #[optional] + #[method(splitView:shouldAdjustSizeOfSubview:)] + pub unsafe fn splitView_shouldAdjustSizeOfSubview( + &self, + splitView: &NSSplitView, + view: &NSView, + ) -> bool; + + #[optional] + #[method(splitView:shouldHideDividerAtIndex:)] + pub unsafe fn splitView_shouldHideDividerAtIndex( + &self, + splitView: &NSSplitView, + dividerIndex: NSInteger, + ) -> bool; + + #[optional] + #[method(splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:)] + pub unsafe fn splitView_effectiveRect_forDrawnRect_ofDividerAtIndex( + &self, + splitView: &NSSplitView, + proposedEffectiveRect: NSRect, + drawnRect: NSRect, + dividerIndex: NSInteger, + ) -> NSRect; + + #[optional] + #[method(splitView:additionalEffectiveRectOfDividerAtIndex:)] + pub unsafe fn splitView_additionalEffectiveRectOfDividerAtIndex( + &self, + splitView: &NSSplitView, + dividerIndex: NSInteger, + ) -> NSRect; + + #[optional] + #[method(splitViewWillResizeSubviews:)] + pub unsafe fn splitViewWillResizeSubviews(&self, notification: &NSNotification); + + #[optional] + #[method(splitViewDidResizeSubviews:)] + pub unsafe fn splitViewDidResizeSubviews(&self, notification: &NSNotification); + } +); + +extern_static!(NSSplitViewWillResizeSubviewsNotification: &'static NSNotificationName); + +extern_static!(NSSplitViewDidResizeSubviewsNotification: &'static NSNotificationName); + +extern_methods!( + /// NSDeprecated + unsafe impl NSSplitView { + #[method(setIsPaneSplitter:)] + pub unsafe fn setIsPaneSplitter(&self, flag: bool); + + #[method(isPaneSplitter)] + pub unsafe fn isPaneSplitter(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSplitViewController.rs b/crates/icrate/src/generated/AppKit/NSSplitViewController.rs new file mode 100644 index 000000000..995c3e3ae --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSplitViewController.rs @@ -0,0 +1,114 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSSplitViewControllerAutomaticDimension: CGFloat); + +extern_class!( + #[derive(Debug)] + pub struct NSSplitViewController; + + unsafe impl ClassType for NSSplitViewController { + type Super = NSViewController; + } +); + +extern_methods!( + unsafe impl NSSplitViewController { + #[method_id(@__retain_semantics Other splitView)] + pub unsafe fn splitView(&self) -> Id; + + #[method(setSplitView:)] + pub unsafe fn setSplitView(&self, splitView: &NSSplitView); + + #[method_id(@__retain_semantics Other splitViewItems)] + pub unsafe fn splitViewItems(&self) -> Id, Shared>; + + #[method(setSplitViewItems:)] + pub unsafe fn setSplitViewItems(&self, splitViewItems: &NSArray); + + #[method(addSplitViewItem:)] + pub unsafe fn addSplitViewItem(&self, splitViewItem: &NSSplitViewItem); + + #[method(insertSplitViewItem:atIndex:)] + pub unsafe fn insertSplitViewItem_atIndex( + &self, + splitViewItem: &NSSplitViewItem, + index: NSInteger, + ); + + #[method(removeSplitViewItem:)] + pub unsafe fn removeSplitViewItem(&self, splitViewItem: &NSSplitViewItem); + + #[method_id(@__retain_semantics Other splitViewItemForViewController:)] + pub unsafe fn splitViewItemForViewController( + &self, + viewController: &NSViewController, + ) -> Option>; + + #[method(minimumThicknessForInlineSidebars)] + pub unsafe fn minimumThicknessForInlineSidebars(&self) -> CGFloat; + + #[method(setMinimumThicknessForInlineSidebars:)] + pub unsafe fn setMinimumThicknessForInlineSidebars( + &self, + minimumThicknessForInlineSidebars: CGFloat, + ); + + #[method(validateUserInterfaceItem:)] + pub unsafe fn validateUserInterfaceItem(&self, item: &NSValidatedUserInterfaceItem) + -> bool; + + #[method(viewDidLoad)] + pub unsafe fn viewDidLoad(&self); + + #[method(splitView:canCollapseSubview:)] + pub unsafe fn splitView_canCollapseSubview( + &self, + splitView: &NSSplitView, + subview: &NSView, + ) -> bool; + + #[method(splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:)] + pub unsafe fn splitView_shouldCollapseSubview_forDoubleClickOnDividerAtIndex( + &self, + splitView: &NSSplitView, + subview: &NSView, + dividerIndex: NSInteger, + ) -> bool; + + #[method(splitView:shouldHideDividerAtIndex:)] + pub unsafe fn splitView_shouldHideDividerAtIndex( + &self, + splitView: &NSSplitView, + dividerIndex: NSInteger, + ) -> bool; + + #[method(splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:)] + pub unsafe fn splitView_effectiveRect_forDrawnRect_ofDividerAtIndex( + &self, + splitView: &NSSplitView, + proposedEffectiveRect: NSRect, + drawnRect: NSRect, + dividerIndex: NSInteger, + ) -> NSRect; + + #[method(splitView:additionalEffectiveRectOfDividerAtIndex:)] + pub unsafe fn splitView_additionalEffectiveRectOfDividerAtIndex( + &self, + splitView: &NSSplitView, + dividerIndex: NSInteger, + ) -> NSRect; + } +); + +extern_methods!( + /// NSSplitViewControllerToggleSidebarAction + unsafe impl NSSplitViewController { + #[method(toggleSidebar:)] + pub unsafe fn toggleSidebar(&self, sender: Option<&Object>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSplitViewItem.rs b/crates/icrate/src/generated/AppKit/NSSplitViewItem.rs new file mode 100644 index 000000000..7e2192a51 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSplitViewItem.rs @@ -0,0 +1,133 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSSplitViewItemBehavior { + NSSplitViewItemBehaviorDefault = 0, + NSSplitViewItemBehaviorSidebar = 1, + NSSplitViewItemBehaviorContentList = 2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSSplitViewItemCollapseBehavior { + NSSplitViewItemCollapseBehaviorDefault = 0, + NSSplitViewItemCollapseBehaviorPreferResizingSplitViewWithFixedSiblings = 1, + NSSplitViewItemCollapseBehaviorPreferResizingSiblingsWithFixedSplitView = 2, + NSSplitViewItemCollapseBehaviorUseConstraints = 3, + } +); + +extern_static!(NSSplitViewItemUnspecifiedDimension: CGFloat); + +extern_class!( + #[derive(Debug)] + pub struct NSSplitViewItem; + + unsafe impl ClassType for NSSplitViewItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSSplitViewItem { + #[method_id(@__retain_semantics Other splitViewItemWithViewController:)] + pub unsafe fn splitViewItemWithViewController( + viewController: &NSViewController, + ) -> Id; + + #[method_id(@__retain_semantics Other sidebarWithViewController:)] + pub unsafe fn sidebarWithViewController( + viewController: &NSViewController, + ) -> Id; + + #[method_id(@__retain_semantics Other contentListWithViewController:)] + pub unsafe fn contentListWithViewController( + viewController: &NSViewController, + ) -> Id; + + #[method(behavior)] + pub unsafe fn behavior(&self) -> NSSplitViewItemBehavior; + + #[method_id(@__retain_semantics Other viewController)] + pub unsafe fn viewController(&self) -> Id; + + #[method(setViewController:)] + pub unsafe fn setViewController(&self, viewController: &NSViewController); + + #[method(isCollapsed)] + pub unsafe fn isCollapsed(&self) -> bool; + + #[method(setCollapsed:)] + pub unsafe fn setCollapsed(&self, collapsed: bool); + + #[method(canCollapse)] + pub unsafe fn canCollapse(&self) -> bool; + + #[method(setCanCollapse:)] + pub unsafe fn setCanCollapse(&self, canCollapse: bool); + + #[method(collapseBehavior)] + pub unsafe fn collapseBehavior(&self) -> NSSplitViewItemCollapseBehavior; + + #[method(setCollapseBehavior:)] + pub unsafe fn setCollapseBehavior(&self, collapseBehavior: NSSplitViewItemCollapseBehavior); + + #[method(minimumThickness)] + pub unsafe fn minimumThickness(&self) -> CGFloat; + + #[method(setMinimumThickness:)] + pub unsafe fn setMinimumThickness(&self, minimumThickness: CGFloat); + + #[method(maximumThickness)] + pub unsafe fn maximumThickness(&self) -> CGFloat; + + #[method(setMaximumThickness:)] + pub unsafe fn setMaximumThickness(&self, maximumThickness: CGFloat); + + #[method(preferredThicknessFraction)] + pub unsafe fn preferredThicknessFraction(&self) -> CGFloat; + + #[method(setPreferredThicknessFraction:)] + pub unsafe fn setPreferredThicknessFraction(&self, preferredThicknessFraction: CGFloat); + + #[method(holdingPriority)] + pub unsafe fn holdingPriority(&self) -> NSLayoutPriority; + + #[method(setHoldingPriority:)] + pub unsafe fn setHoldingPriority(&self, holdingPriority: NSLayoutPriority); + + #[method(automaticMaximumThickness)] + pub unsafe fn automaticMaximumThickness(&self) -> CGFloat; + + #[method(setAutomaticMaximumThickness:)] + pub unsafe fn setAutomaticMaximumThickness(&self, automaticMaximumThickness: CGFloat); + + #[method(isSpringLoaded)] + pub unsafe fn isSpringLoaded(&self) -> bool; + + #[method(setSpringLoaded:)] + pub unsafe fn setSpringLoaded(&self, springLoaded: bool); + + #[method(allowsFullHeightLayout)] + pub unsafe fn allowsFullHeightLayout(&self) -> bool; + + #[method(setAllowsFullHeightLayout:)] + pub unsafe fn setAllowsFullHeightLayout(&self, allowsFullHeightLayout: bool); + + #[method(titlebarSeparatorStyle)] + pub unsafe fn titlebarSeparatorStyle(&self) -> NSTitlebarSeparatorStyle; + + #[method(setTitlebarSeparatorStyle:)] + pub unsafe fn setTitlebarSeparatorStyle( + &self, + titlebarSeparatorStyle: NSTitlebarSeparatorStyle, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSStackView.rs b/crates/icrate/src/generated/AppKit/NSStackView.rs new file mode 100644 index 000000000..086d39f54 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSStackView.rs @@ -0,0 +1,225 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSStackViewGravity { + NSStackViewGravityTop = 1, + NSStackViewGravityLeading = 1, + NSStackViewGravityCenter = 2, + NSStackViewGravityBottom = 3, + NSStackViewGravityTrailing = 3, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSStackViewDistribution { + NSStackViewDistributionGravityAreas = -1, + NSStackViewDistributionFill = 0, + NSStackViewDistributionFillEqually = 1, + NSStackViewDistributionFillProportionally = 2, + NSStackViewDistributionEqualSpacing = 3, + NSStackViewDistributionEqualCentering = 4, + } +); + +pub type NSStackViewVisibilityPriority = c_float; + +extern_static!(NSStackViewVisibilityPriorityMustHold: NSStackViewVisibilityPriority = 1000); + +extern_static!( + NSStackViewVisibilityPriorityDetachOnlyIfNecessary: NSStackViewVisibilityPriority = 900 +); + +extern_static!(NSStackViewVisibilityPriorityNotVisible: NSStackViewVisibilityPriority = 0); + +extern_class!( + #[derive(Debug)] + pub struct NSStackView; + + unsafe impl ClassType for NSStackView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSStackView { + #[method_id(@__retain_semantics Other stackViewWithViews:)] + pub unsafe fn stackViewWithViews(views: &NSArray) -> Id; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSStackViewDelegate>); + + #[method(orientation)] + pub unsafe fn orientation(&self) -> NSUserInterfaceLayoutOrientation; + + #[method(setOrientation:)] + pub unsafe fn setOrientation(&self, orientation: NSUserInterfaceLayoutOrientation); + + #[method(alignment)] + pub unsafe fn alignment(&self) -> NSLayoutAttribute; + + #[method(setAlignment:)] + pub unsafe fn setAlignment(&self, alignment: NSLayoutAttribute); + + #[method(edgeInsets)] + pub unsafe fn edgeInsets(&self) -> NSEdgeInsets; + + #[method(setEdgeInsets:)] + pub unsafe fn setEdgeInsets(&self, edgeInsets: NSEdgeInsets); + + #[method(distribution)] + pub unsafe fn distribution(&self) -> NSStackViewDistribution; + + #[method(setDistribution:)] + pub unsafe fn setDistribution(&self, distribution: NSStackViewDistribution); + + #[method(spacing)] + pub unsafe fn spacing(&self) -> CGFloat; + + #[method(setSpacing:)] + pub unsafe fn setSpacing(&self, spacing: CGFloat); + + #[method(setCustomSpacing:afterView:)] + pub unsafe fn setCustomSpacing_afterView(&self, spacing: CGFloat, view: &NSView); + + #[method(customSpacingAfterView:)] + pub unsafe fn customSpacingAfterView(&self, view: &NSView) -> CGFloat; + + #[method(detachesHiddenViews)] + pub unsafe fn detachesHiddenViews(&self) -> bool; + + #[method(setDetachesHiddenViews:)] + pub unsafe fn setDetachesHiddenViews(&self, detachesHiddenViews: bool); + + #[method_id(@__retain_semantics Other arrangedSubviews)] + pub unsafe fn arrangedSubviews(&self) -> Id, Shared>; + + #[method(addArrangedSubview:)] + pub unsafe fn addArrangedSubview(&self, view: &NSView); + + #[method(insertArrangedSubview:atIndex:)] + pub unsafe fn insertArrangedSubview_atIndex(&self, view: &NSView, index: NSInteger); + + #[method(removeArrangedSubview:)] + pub unsafe fn removeArrangedSubview(&self, view: &NSView); + + #[method_id(@__retain_semantics Other detachedViews)] + pub unsafe fn detachedViews(&self) -> Id, Shared>; + + #[method(setVisibilityPriority:forView:)] + pub unsafe fn setVisibilityPriority_forView( + &self, + priority: NSStackViewVisibilityPriority, + view: &NSView, + ); + + #[method(visibilityPriorityForView:)] + pub unsafe fn visibilityPriorityForView( + &self, + view: &NSView, + ) -> NSStackViewVisibilityPriority; + + #[method(clippingResistancePriorityForOrientation:)] + pub unsafe fn clippingResistancePriorityForOrientation( + &self, + orientation: NSLayoutConstraintOrientation, + ) -> NSLayoutPriority; + + #[method(setClippingResistancePriority:forOrientation:)] + pub unsafe fn setClippingResistancePriority_forOrientation( + &self, + clippingResistancePriority: NSLayoutPriority, + orientation: NSLayoutConstraintOrientation, + ); + + #[method(huggingPriorityForOrientation:)] + pub unsafe fn huggingPriorityForOrientation( + &self, + orientation: NSLayoutConstraintOrientation, + ) -> NSLayoutPriority; + + #[method(setHuggingPriority:forOrientation:)] + pub unsafe fn setHuggingPriority_forOrientation( + &self, + huggingPriority: NSLayoutPriority, + orientation: NSLayoutConstraintOrientation, + ); + } +); + +extern_protocol!( + pub struct NSStackViewDelegate; + + unsafe impl NSStackViewDelegate { + #[optional] + #[method(stackView:willDetachViews:)] + pub unsafe fn stackView_willDetachViews( + &self, + stackView: &NSStackView, + views: &NSArray, + ); + + #[optional] + #[method(stackView:didReattachViews:)] + pub unsafe fn stackView_didReattachViews( + &self, + stackView: &NSStackView, + views: &NSArray, + ); + } +); + +extern_methods!( + /// NSStackViewGravityAreas + unsafe impl NSStackView { + #[method(addView:inGravity:)] + pub unsafe fn addView_inGravity(&self, view: &NSView, gravity: NSStackViewGravity); + + #[method(insertView:atIndex:inGravity:)] + pub unsafe fn insertView_atIndex_inGravity( + &self, + view: &NSView, + index: NSUInteger, + gravity: NSStackViewGravity, + ); + + #[method(removeView:)] + pub unsafe fn removeView(&self, view: &NSView); + + #[method_id(@__retain_semantics Other viewsInGravity:)] + pub unsafe fn viewsInGravity( + &self, + gravity: NSStackViewGravity, + ) -> Id, Shared>; + + #[method(setViews:inGravity:)] + pub unsafe fn setViews_inGravity( + &self, + views: &NSArray, + gravity: NSStackViewGravity, + ); + + #[method_id(@__retain_semantics Other views)] + pub unsafe fn views(&self) -> Id, Shared>; + } +); + +extern_methods!( + /// NSStackViewDeprecated + unsafe impl NSStackView { + #[method(hasEqualSpacing)] + pub unsafe fn hasEqualSpacing(&self) -> bool; + + #[method(setHasEqualSpacing:)] + pub unsafe fn setHasEqualSpacing(&self, hasEqualSpacing: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSStatusBar.rs b/crates/icrate/src/generated/AppKit/NSStatusBar.rs new file mode 100644 index 000000000..c8c1c907a --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSStatusBar.rs @@ -0,0 +1,38 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSVariableStatusItemLength: CGFloat = -1.0); + +extern_static!(NSSquareStatusItemLength: CGFloat = -2.0); + +extern_class!( + #[derive(Debug)] + pub struct NSStatusBar; + + unsafe impl ClassType for NSStatusBar { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSStatusBar { + #[method_id(@__retain_semantics Other systemStatusBar)] + pub unsafe fn systemStatusBar() -> Id; + + #[method_id(@__retain_semantics Other statusItemWithLength:)] + pub unsafe fn statusItemWithLength(&self, length: CGFloat) -> Id; + + #[method(removeStatusItem:)] + pub unsafe fn removeStatusItem(&self, item: &NSStatusItem); + + #[method(isVertical)] + pub unsafe fn isVertical(&self) -> bool; + + #[method(thickness)] + pub unsafe fn thickness(&self) -> CGFloat; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSStatusBarButton.rs b/crates/icrate/src/generated/AppKit/NSStatusBarButton.rs new file mode 100644 index 000000000..f0ff3b7b4 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSStatusBarButton.rs @@ -0,0 +1,25 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSStatusBarButton; + + unsafe impl ClassType for NSStatusBarButton { + type Super = NSButton; + } +); + +extern_methods!( + unsafe impl NSStatusBarButton { + #[method(appearsDisabled)] + pub unsafe fn appearsDisabled(&self) -> bool; + + #[method(setAppearsDisabled:)] + pub unsafe fn setAppearsDisabled(&self, appearsDisabled: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSStatusItem.rs b/crates/icrate/src/generated/AppKit/NSStatusItem.rs new file mode 100644 index 000000000..a034206ef --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSStatusItem.rs @@ -0,0 +1,149 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSStatusItemAutosaveName = NSString; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSStatusItemBehavior { + NSStatusItemBehaviorRemovalAllowed = 1 << 1, + NSStatusItemBehaviorTerminationOnRemoval = 1 << 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSStatusItem; + + unsafe impl ClassType for NSStatusItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSStatusItem { + #[method_id(@__retain_semantics Other statusBar)] + pub unsafe fn statusBar(&self) -> Option>; + + #[method(length)] + pub unsafe fn length(&self) -> CGFloat; + + #[method(setLength:)] + pub unsafe fn setLength(&self, length: CGFloat); + + #[method_id(@__retain_semantics Other menu)] + pub unsafe fn menu(&self) -> Option>; + + #[method(setMenu:)] + pub unsafe fn setMenu(&self, menu: Option<&NSMenu>); + + #[method_id(@__retain_semantics Other button)] + pub unsafe fn button(&self) -> Option>; + + #[method(behavior)] + pub unsafe fn behavior(&self) -> NSStatusItemBehavior; + + #[method(setBehavior:)] + pub unsafe fn setBehavior(&self, behavior: NSStatusItemBehavior); + + #[method(isVisible)] + pub unsafe fn isVisible(&self) -> bool; + + #[method(setVisible:)] + pub unsafe fn setVisible(&self, visible: bool); + + #[method_id(@__retain_semantics Other autosaveName)] + pub unsafe fn autosaveName(&self) -> Id; + + #[method(setAutosaveName:)] + pub unsafe fn setAutosaveName(&self, autosaveName: Option<&NSStatusItemAutosaveName>); + } +); + +extern_methods!( + /// NSStatusItemDeprecated + unsafe impl NSStatusItem { + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: OptionSel); + + #[method(doubleAction)] + pub unsafe fn doubleAction(&self) -> OptionSel; + + #[method(setDoubleAction:)] + pub unsafe fn setDoubleAction(&self, doubleAction: OptionSel); + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Option>; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: Option<&NSString>); + + #[method_id(@__retain_semantics Other attributedTitle)] + pub unsafe fn attributedTitle(&self) -> Option>; + + #[method(setAttributedTitle:)] + pub unsafe fn setAttributedTitle(&self, attributedTitle: Option<&NSAttributedString>); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + + #[method_id(@__retain_semantics Other alternateImage)] + pub unsafe fn alternateImage(&self) -> Option>; + + #[method(setAlternateImage:)] + pub unsafe fn setAlternateImage(&self, alternateImage: Option<&NSImage>); + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + + #[method(highlightMode)] + pub unsafe fn highlightMode(&self) -> bool; + + #[method(setHighlightMode:)] + pub unsafe fn setHighlightMode(&self, highlightMode: bool); + + #[method_id(@__retain_semantics Other toolTip)] + pub unsafe fn toolTip(&self) -> Option>; + + #[method(setToolTip:)] + pub unsafe fn setToolTip(&self, toolTip: Option<&NSString>); + + #[method(sendActionOn:)] + pub unsafe fn sendActionOn(&self, mask: NSEventMask) -> NSInteger; + + #[method_id(@__retain_semantics Other view)] + pub unsafe fn view(&self) -> Option>; + + #[method(setView:)] + pub unsafe fn setView(&self, view: Option<&NSView>); + + #[method(drawStatusBarBackgroundInRect:withHighlight:)] + pub unsafe fn drawStatusBarBackgroundInRect_withHighlight( + &self, + rect: NSRect, + highlight: bool, + ); + + #[method(popUpStatusItemMenu:)] + pub unsafe fn popUpStatusItemMenu(&self, menu: &NSMenu); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSStepper.rs b/crates/icrate/src/generated/AppKit/NSStepper.rs new file mode 100644 index 000000000..ec710bfc4 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSStepper.rs @@ -0,0 +1,49 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSStepper; + + unsafe impl ClassType for NSStepper { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSStepper { + #[method(minValue)] + pub unsafe fn minValue(&self) -> c_double; + + #[method(setMinValue:)] + pub unsafe fn setMinValue(&self, minValue: c_double); + + #[method(maxValue)] + pub unsafe fn maxValue(&self) -> c_double; + + #[method(setMaxValue:)] + pub unsafe fn setMaxValue(&self, maxValue: c_double); + + #[method(increment)] + pub unsafe fn increment(&self) -> c_double; + + #[method(setIncrement:)] + pub unsafe fn setIncrement(&self, increment: c_double); + + #[method(valueWraps)] + pub unsafe fn valueWraps(&self) -> bool; + + #[method(setValueWraps:)] + pub unsafe fn setValueWraps(&self, valueWraps: bool); + + #[method(autorepeat)] + pub unsafe fn autorepeat(&self) -> bool; + + #[method(setAutorepeat:)] + pub unsafe fn setAutorepeat(&self, autorepeat: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSStepperCell.rs b/crates/icrate/src/generated/AppKit/NSStepperCell.rs new file mode 100644 index 000000000..166bae696 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSStepperCell.rs @@ -0,0 +1,49 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSStepperCell; + + unsafe impl ClassType for NSStepperCell { + type Super = NSActionCell; + } +); + +extern_methods!( + unsafe impl NSStepperCell { + #[method(minValue)] + pub unsafe fn minValue(&self) -> c_double; + + #[method(setMinValue:)] + pub unsafe fn setMinValue(&self, minValue: c_double); + + #[method(maxValue)] + pub unsafe fn maxValue(&self) -> c_double; + + #[method(setMaxValue:)] + pub unsafe fn setMaxValue(&self, maxValue: c_double); + + #[method(increment)] + pub unsafe fn increment(&self) -> c_double; + + #[method(setIncrement:)] + pub unsafe fn setIncrement(&self, increment: c_double); + + #[method(valueWraps)] + pub unsafe fn valueWraps(&self) -> bool; + + #[method(setValueWraps:)] + pub unsafe fn setValueWraps(&self, valueWraps: bool); + + #[method(autorepeat)] + pub unsafe fn autorepeat(&self) -> bool; + + #[method(setAutorepeat:)] + pub unsafe fn setAutorepeat(&self, autorepeat: bool); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSStepperTouchBarItem.rs b/crates/icrate/src/generated/AppKit/NSStepperTouchBarItem.rs new file mode 100644 index 000000000..43bbdadeb --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSStepperTouchBarItem.rs @@ -0,0 +1,73 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSStepperTouchBarItem; + + unsafe impl ClassType for NSStepperTouchBarItem { + type Super = NSTouchBarItem; + } +); + +extern_methods!( + unsafe impl NSStepperTouchBarItem { + #[method_id(@__retain_semantics Other stepperTouchBarItemWithIdentifier:formatter:)] + pub unsafe fn stepperTouchBarItemWithIdentifier_formatter( + identifier: &NSTouchBarItemIdentifier, + formatter: &NSFormatter, + ) -> Id; + + #[method_id(@__retain_semantics Other stepperTouchBarItemWithIdentifier:drawingHandler:)] + pub unsafe fn stepperTouchBarItemWithIdentifier_drawingHandler( + identifier: &NSTouchBarItemIdentifier, + drawingHandler: &Block<(NSRect, c_double), ()>, + ) -> Id; + + #[method(maxValue)] + pub unsafe fn maxValue(&self) -> c_double; + + #[method(setMaxValue:)] + pub unsafe fn setMaxValue(&self, maxValue: c_double); + + #[method(minValue)] + pub unsafe fn minValue(&self) -> c_double; + + #[method(setMinValue:)] + pub unsafe fn setMinValue(&self, minValue: c_double); + + #[method(increment)] + pub unsafe fn increment(&self) -> c_double; + + #[method(setIncrement:)] + pub unsafe fn setIncrement(&self, increment: c_double); + + #[method(value)] + pub unsafe fn value(&self) -> c_double; + + #[method(setValue:)] + pub unsafe fn setValue(&self, value: c_double); + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: OptionSel); + + #[method_id(@__retain_semantics Other customizationLabel)] + pub unsafe fn customizationLabel(&self) -> Id; + + #[method(setCustomizationLabel:)] + pub unsafe fn setCustomizationLabel(&self, customizationLabel: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSStoryboard.rs b/crates/icrate/src/generated/AppKit/NSStoryboard.rs new file mode 100644 index 000000000..8693d4a1d --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSStoryboard.rs @@ -0,0 +1,56 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSStoryboardName = NSString; + +pub type NSStoryboardSceneIdentifier = NSString; + +pub type NSStoryboardControllerCreator = *mut Block<(NonNull,), *mut Object>; + +extern_class!( + #[derive(Debug)] + pub struct NSStoryboard; + + unsafe impl ClassType for NSStoryboard { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSStoryboard { + #[method_id(@__retain_semantics Other mainStoryboard)] + pub unsafe fn mainStoryboard() -> Option>; + + #[method_id(@__retain_semantics Other storyboardWithName:bundle:)] + pub unsafe fn storyboardWithName_bundle( + name: &NSStoryboardName, + storyboardBundleOrNil: Option<&NSBundle>, + ) -> Id; + + #[method_id(@__retain_semantics Other instantiateInitialController)] + pub unsafe fn instantiateInitialController(&self) -> Option>; + + #[method_id(@__retain_semantics Other instantiateInitialControllerWithCreator:)] + pub unsafe fn instantiateInitialControllerWithCreator( + &self, + block: NSStoryboardControllerCreator, + ) -> Option>; + + #[method_id(@__retain_semantics Other instantiateControllerWithIdentifier:)] + pub unsafe fn instantiateControllerWithIdentifier( + &self, + identifier: &NSStoryboardSceneIdentifier, + ) -> Id; + + #[method_id(@__retain_semantics Other instantiateControllerWithIdentifier:creator:)] + pub unsafe fn instantiateControllerWithIdentifier_creator( + &self, + identifier: &NSStoryboardSceneIdentifier, + block: NSStoryboardControllerCreator, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSStoryboardSegue.rs b/crates/icrate/src/generated/AppKit/NSStoryboardSegue.rs new file mode 100644 index 000000000..12ca14226 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSStoryboardSegue.rs @@ -0,0 +1,79 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSStoryboardSegueIdentifier = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSStoryboardSegue; + + unsafe impl ClassType for NSStoryboardSegue { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSStoryboardSegue { + #[method_id(@__retain_semantics Other segueWithIdentifier:source:destination:performHandler:)] + pub unsafe fn segueWithIdentifier_source_destination_performHandler( + identifier: &NSStoryboardSegueIdentifier, + sourceController: &Object, + destinationController: &Object, + performHandler: &Block<(), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithIdentifier:source:destination:)] + pub unsafe fn initWithIdentifier_source_destination( + this: Option>, + identifier: &NSStoryboardSegueIdentifier, + sourceController: &Object, + destinationController: &Object, + ) -> Id; + + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Option>; + + #[method_id(@__retain_semantics Other sourceController)] + pub unsafe fn sourceController(&self) -> Id; + + #[method_id(@__retain_semantics Other destinationController)] + pub unsafe fn destinationController(&self) -> Id; + + #[method(perform)] + pub unsafe fn perform(&self); + } +); + +extern_protocol!( + pub struct NSSeguePerforming; + + unsafe impl NSSeguePerforming { + #[optional] + #[method(prepareForSegue:sender:)] + pub unsafe fn prepareForSegue_sender( + &self, + segue: &NSStoryboardSegue, + sender: Option<&Object>, + ); + + #[optional] + #[method(performSegueWithIdentifier:sender:)] + pub unsafe fn performSegueWithIdentifier_sender( + &self, + identifier: &NSStoryboardSegueIdentifier, + sender: Option<&Object>, + ); + + #[optional] + #[method(shouldPerformSegueWithIdentifier:sender:)] + pub unsafe fn shouldPerformSegueWithIdentifier_sender( + &self, + identifier: &NSStoryboardSegueIdentifier, + sender: Option<&Object>, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSStringDrawing.rs b/crates/icrate/src/generated/AppKit/NSStringDrawing.rs new file mode 100644 index 000000000..df36c5672 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSStringDrawing.rs @@ -0,0 +1,162 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSStringDrawingContext; + + unsafe impl ClassType for NSStringDrawingContext { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSStringDrawingContext { + #[method(minimumScaleFactor)] + pub unsafe fn minimumScaleFactor(&self) -> CGFloat; + + #[method(setMinimumScaleFactor:)] + pub unsafe fn setMinimumScaleFactor(&self, minimumScaleFactor: CGFloat); + + #[method(actualScaleFactor)] + pub unsafe fn actualScaleFactor(&self) -> CGFloat; + + #[method(totalBounds)] + pub unsafe fn totalBounds(&self) -> NSRect; + } +); + +extern_methods!( + /// NSStringDrawing + unsafe impl NSString { + #[method(sizeWithAttributes:)] + pub unsafe fn sizeWithAttributes( + &self, + attrs: Option<&NSDictionary>, + ) -> NSSize; + + #[method(drawAtPoint:withAttributes:)] + pub unsafe fn drawAtPoint_withAttributes( + &self, + point: NSPoint, + attrs: Option<&NSDictionary>, + ); + + #[method(drawInRect:withAttributes:)] + pub unsafe fn drawInRect_withAttributes( + &self, + rect: NSRect, + attrs: Option<&NSDictionary>, + ); + } +); + +extern_methods!( + /// NSStringDrawing + unsafe impl NSAttributedString { + #[method(size)] + pub unsafe fn size(&self) -> NSSize; + + #[method(drawAtPoint:)] + pub unsafe fn drawAtPoint(&self, point: NSPoint); + + #[method(drawInRect:)] + pub unsafe fn drawInRect(&self, rect: NSRect); + } +); + +ns_options!( + #[underlying(NSInteger)] + pub enum NSStringDrawingOptions { + NSStringDrawingUsesLineFragmentOrigin = 1 << 0, + NSStringDrawingUsesFontLeading = 1 << 1, + NSStringDrawingUsesDeviceMetrics = 1 << 3, + NSStringDrawingTruncatesLastVisibleLine = 1 << 5, + NSStringDrawingDisableScreenFontSubstitution = 1 << 2, + NSStringDrawingOneShot = 1 << 4, + } +); + +extern_methods!( + /// NSExtendedStringDrawing + unsafe impl NSString { + #[method(drawWithRect:options:attributes:context:)] + pub unsafe fn drawWithRect_options_attributes_context( + &self, + rect: NSRect, + options: NSStringDrawingOptions, + attributes: Option<&NSDictionary>, + context: Option<&NSStringDrawingContext>, + ); + + #[method(boundingRectWithSize:options:attributes:context:)] + pub unsafe fn boundingRectWithSize_options_attributes_context( + &self, + size: NSSize, + options: NSStringDrawingOptions, + attributes: Option<&NSDictionary>, + context: Option<&NSStringDrawingContext>, + ) -> NSRect; + } +); + +extern_methods!( + /// NSExtendedStringDrawing + unsafe impl NSAttributedString { + #[method(drawWithRect:options:context:)] + pub unsafe fn drawWithRect_options_context( + &self, + rect: NSRect, + options: NSStringDrawingOptions, + context: Option<&NSStringDrawingContext>, + ); + + #[method(boundingRectWithSize:options:context:)] + pub unsafe fn boundingRectWithSize_options_context( + &self, + size: NSSize, + options: NSStringDrawingOptions, + context: Option<&NSStringDrawingContext>, + ) -> NSRect; + } +); + +extern_methods!( + /// NSStringDrawingDeprecated + unsafe impl NSString { + #[method(drawWithRect:options:attributes:)] + pub unsafe fn drawWithRect_options_attributes( + &self, + rect: NSRect, + options: NSStringDrawingOptions, + attributes: Option<&NSDictionary>, + ); + + #[method(boundingRectWithSize:options:attributes:)] + pub unsafe fn boundingRectWithSize_options_attributes( + &self, + size: NSSize, + options: NSStringDrawingOptions, + attributes: Option<&NSDictionary>, + ) -> NSRect; + } +); + +extern_methods!( + /// NSStringDrawingDeprecated + unsafe impl NSAttributedString { + #[method(drawWithRect:options:)] + pub unsafe fn drawWithRect_options(&self, rect: NSRect, options: NSStringDrawingOptions); + + #[method(boundingRectWithSize:options:)] + pub unsafe fn boundingRectWithSize_options( + &self, + size: NSSize, + options: NSStringDrawingOptions, + ) -> NSRect; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSSwitch.rs b/crates/icrate/src/generated/AppKit/NSSwitch.rs new file mode 100644 index 000000000..c6554710a --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSSwitch.rs @@ -0,0 +1,25 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSSwitch; + + unsafe impl ClassType for NSSwitch { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSSwitch { + #[method(state)] + pub unsafe fn state(&self) -> NSControlStateValue; + + #[method(setState:)] + pub unsafe fn setState(&self, state: NSControlStateValue); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTabView.rs b/crates/icrate/src/generated/AppKit/NSTabView.rs new file mode 100644 index 000000000..7b3fe2fb1 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTabView.rs @@ -0,0 +1,212 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSAppKitVersionNumberWithDirectionalTabs: NSAppKitVersion = 631.0); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTabViewType { + NSTopTabsBezelBorder = 0, + NSLeftTabsBezelBorder = 1, + NSBottomTabsBezelBorder = 2, + NSRightTabsBezelBorder = 3, + NSNoTabsBezelBorder = 4, + NSNoTabsLineBorder = 5, + NSNoTabsNoBorder = 6, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTabPosition { + NSTabPositionNone = 0, + NSTabPositionTop = 1, + NSTabPositionLeft = 2, + NSTabPositionBottom = 3, + NSTabPositionRight = 4, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTabViewBorderType { + NSTabViewBorderTypeNone = 0, + NSTabViewBorderTypeLine = 1, + NSTabViewBorderTypeBezel = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTabView; + + unsafe impl ClassType for NSTabView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSTabView { + #[method(selectTabViewItem:)] + pub unsafe fn selectTabViewItem(&self, tabViewItem: Option<&NSTabViewItem>); + + #[method(selectTabViewItemAtIndex:)] + pub unsafe fn selectTabViewItemAtIndex(&self, index: NSInteger); + + #[method(selectTabViewItemWithIdentifier:)] + pub unsafe fn selectTabViewItemWithIdentifier(&self, identifier: &Object); + + #[method(takeSelectedTabViewItemFromSender:)] + pub unsafe fn takeSelectedTabViewItemFromSender(&self, sender: Option<&Object>); + + #[method(selectFirstTabViewItem:)] + pub unsafe fn selectFirstTabViewItem(&self, sender: Option<&Object>); + + #[method(selectLastTabViewItem:)] + pub unsafe fn selectLastTabViewItem(&self, sender: Option<&Object>); + + #[method(selectNextTabViewItem:)] + pub unsafe fn selectNextTabViewItem(&self, sender: Option<&Object>); + + #[method(selectPreviousTabViewItem:)] + pub unsafe fn selectPreviousTabViewItem(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other selectedTabViewItem)] + pub unsafe fn selectedTabViewItem(&self) -> Option>; + + #[method_id(@__retain_semantics Other font)] + pub unsafe fn font(&self) -> Id; + + #[method(setFont:)] + pub unsafe fn setFont(&self, font: &NSFont); + + #[method(tabViewType)] + pub unsafe fn tabViewType(&self) -> NSTabViewType; + + #[method(setTabViewType:)] + pub unsafe fn setTabViewType(&self, tabViewType: NSTabViewType); + + #[method(tabPosition)] + pub unsafe fn tabPosition(&self) -> NSTabPosition; + + #[method(setTabPosition:)] + pub unsafe fn setTabPosition(&self, tabPosition: NSTabPosition); + + #[method(tabViewBorderType)] + pub unsafe fn tabViewBorderType(&self) -> NSTabViewBorderType; + + #[method(setTabViewBorderType:)] + pub unsafe fn setTabViewBorderType(&self, tabViewBorderType: NSTabViewBorderType); + + #[method_id(@__retain_semantics Other tabViewItems)] + pub unsafe fn tabViewItems(&self) -> Id, Shared>; + + #[method(setTabViewItems:)] + pub unsafe fn setTabViewItems(&self, tabViewItems: &NSArray); + + #[method(allowsTruncatedLabels)] + pub unsafe fn allowsTruncatedLabels(&self) -> bool; + + #[method(setAllowsTruncatedLabels:)] + pub unsafe fn setAllowsTruncatedLabels(&self, allowsTruncatedLabels: bool); + + #[method(minimumSize)] + pub unsafe fn minimumSize(&self) -> NSSize; + + #[method(drawsBackground)] + pub unsafe fn drawsBackground(&self) -> bool; + + #[method(setDrawsBackground:)] + pub unsafe fn setDrawsBackground(&self, drawsBackground: bool); + + #[method(controlSize)] + pub unsafe fn controlSize(&self) -> NSControlSize; + + #[method(setControlSize:)] + pub unsafe fn setControlSize(&self, controlSize: NSControlSize); + + #[method(addTabViewItem:)] + pub unsafe fn addTabViewItem(&self, tabViewItem: &NSTabViewItem); + + #[method(insertTabViewItem:atIndex:)] + pub unsafe fn insertTabViewItem_atIndex( + &self, + tabViewItem: &NSTabViewItem, + index: NSInteger, + ); + + #[method(removeTabViewItem:)] + pub unsafe fn removeTabViewItem(&self, tabViewItem: &NSTabViewItem); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTabViewDelegate>); + + #[method_id(@__retain_semantics Other tabViewItemAtPoint:)] + pub unsafe fn tabViewItemAtPoint( + &self, + point: NSPoint, + ) -> Option>; + + #[method(contentRect)] + pub unsafe fn contentRect(&self) -> NSRect; + + #[method(numberOfTabViewItems)] + pub unsafe fn numberOfTabViewItems(&self) -> NSInteger; + + #[method(indexOfTabViewItem:)] + pub unsafe fn indexOfTabViewItem(&self, tabViewItem: &NSTabViewItem) -> NSInteger; + + #[method_id(@__retain_semantics Other tabViewItemAtIndex:)] + pub unsafe fn tabViewItemAtIndex(&self, index: NSInteger) -> Id; + + #[method(indexOfTabViewItemWithIdentifier:)] + pub unsafe fn indexOfTabViewItemWithIdentifier(&self, identifier: &Object) -> NSInteger; + + #[method(controlTint)] + pub unsafe fn controlTint(&self) -> NSControlTint; + + #[method(setControlTint:)] + pub unsafe fn setControlTint(&self, controlTint: NSControlTint); + } +); + +extern_protocol!( + pub struct NSTabViewDelegate; + + unsafe impl NSTabViewDelegate { + #[optional] + #[method(tabView:shouldSelectTabViewItem:)] + pub unsafe fn tabView_shouldSelectTabViewItem( + &self, + tabView: &NSTabView, + tabViewItem: Option<&NSTabViewItem>, + ) -> bool; + + #[optional] + #[method(tabView:willSelectTabViewItem:)] + pub unsafe fn tabView_willSelectTabViewItem( + &self, + tabView: &NSTabView, + tabViewItem: Option<&NSTabViewItem>, + ); + + #[optional] + #[method(tabView:didSelectTabViewItem:)] + pub unsafe fn tabView_didSelectTabViewItem( + &self, + tabView: &NSTabView, + tabViewItem: Option<&NSTabViewItem>, + ); + + #[optional] + #[method(tabViewDidChangeNumberOfTabViewItems:)] + pub unsafe fn tabViewDidChangeNumberOfTabViewItems(&self, tabView: &NSTabView); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTabViewController.rs b/crates/icrate/src/generated/AppKit/NSTabViewController.rs new file mode 100644 index 000000000..405fbe406 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTabViewController.rs @@ -0,0 +1,140 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTabViewControllerTabStyle { + NSTabViewControllerTabStyleSegmentedControlOnTop = 0, + NSTabViewControllerTabStyleSegmentedControlOnBottom = 1, + NSTabViewControllerTabStyleToolbar = 2, + NSTabViewControllerTabStyleUnspecified = -1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTabViewController; + + unsafe impl ClassType for NSTabViewController { + type Super = NSViewController; + } +); + +extern_methods!( + unsafe impl NSTabViewController { + #[method(tabStyle)] + pub unsafe fn tabStyle(&self) -> NSTabViewControllerTabStyle; + + #[method(setTabStyle:)] + pub unsafe fn setTabStyle(&self, tabStyle: NSTabViewControllerTabStyle); + + #[method_id(@__retain_semantics Other tabView)] + pub unsafe fn tabView(&self) -> Id; + + #[method(setTabView:)] + pub unsafe fn setTabView(&self, tabView: &NSTabView); + + #[method(transitionOptions)] + pub unsafe fn transitionOptions(&self) -> NSViewControllerTransitionOptions; + + #[method(setTransitionOptions:)] + pub unsafe fn setTransitionOptions( + &self, + transitionOptions: NSViewControllerTransitionOptions, + ); + + #[method(canPropagateSelectedChildViewControllerTitle)] + pub unsafe fn canPropagateSelectedChildViewControllerTitle(&self) -> bool; + + #[method(setCanPropagateSelectedChildViewControllerTitle:)] + pub unsafe fn setCanPropagateSelectedChildViewControllerTitle( + &self, + canPropagateSelectedChildViewControllerTitle: bool, + ); + + #[method_id(@__retain_semantics Other tabViewItems)] + pub unsafe fn tabViewItems(&self) -> Id, Shared>; + + #[method(setTabViewItems:)] + pub unsafe fn setTabViewItems(&self, tabViewItems: &NSArray); + + #[method(selectedTabViewItemIndex)] + pub unsafe fn selectedTabViewItemIndex(&self) -> NSInteger; + + #[method(setSelectedTabViewItemIndex:)] + pub unsafe fn setSelectedTabViewItemIndex(&self, selectedTabViewItemIndex: NSInteger); + + #[method(addTabViewItem:)] + pub unsafe fn addTabViewItem(&self, tabViewItem: &NSTabViewItem); + + #[method(insertTabViewItem:atIndex:)] + pub unsafe fn insertTabViewItem_atIndex( + &self, + tabViewItem: &NSTabViewItem, + index: NSInteger, + ); + + #[method(removeTabViewItem:)] + pub unsafe fn removeTabViewItem(&self, tabViewItem: &NSTabViewItem); + + #[method_id(@__retain_semantics Other tabViewItemForViewController:)] + pub unsafe fn tabViewItemForViewController( + &self, + viewController: &NSViewController, + ) -> Option>; + + #[method(viewDidLoad)] + pub unsafe fn viewDidLoad(&self); + + #[method(tabView:willSelectTabViewItem:)] + pub unsafe fn tabView_willSelectTabViewItem( + &self, + tabView: &NSTabView, + tabViewItem: Option<&NSTabViewItem>, + ); + + #[method(tabView:didSelectTabViewItem:)] + pub unsafe fn tabView_didSelectTabViewItem( + &self, + tabView: &NSTabView, + tabViewItem: Option<&NSTabViewItem>, + ); + + #[method(tabView:shouldSelectTabViewItem:)] + pub unsafe fn tabView_shouldSelectTabViewItem( + &self, + tabView: &NSTabView, + tabViewItem: Option<&NSTabViewItem>, + ) -> bool; + + #[method_id(@__retain_semantics Other toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:)] + pub unsafe fn toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar( + &self, + toolbar: &NSToolbar, + itemIdentifier: &NSToolbarItemIdentifier, + flag: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other toolbarDefaultItemIdentifiers:)] + pub unsafe fn toolbarDefaultItemIdentifiers( + &self, + toolbar: &NSToolbar, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other toolbarAllowedItemIdentifiers:)] + pub unsafe fn toolbarAllowedItemIdentifiers( + &self, + toolbar: &NSToolbar, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other toolbarSelectableItemIdentifiers:)] + pub unsafe fn toolbarSelectableItemIdentifiers( + &self, + toolbar: &NSToolbar, + ) -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTabViewItem.rs b/crates/icrate/src/generated/AppKit/NSTabViewItem.rs new file mode 100644 index 000000000..5ae56ed8d --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTabViewItem.rs @@ -0,0 +1,99 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTabState { + NSSelectedTab = 0, + NSBackgroundTab = 1, + NSPressedTab = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTabViewItem; + + unsafe impl ClassType for NSTabViewItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTabViewItem { + #[method_id(@__retain_semantics Other tabViewItemWithViewController:)] + pub unsafe fn tabViewItemWithViewController( + viewController: &NSViewController, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithIdentifier:)] + pub unsafe fn initWithIdentifier( + this: Option>, + identifier: Option<&Object>, + ) -> Id; + + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Option>; + + #[method(setIdentifier:)] + pub unsafe fn setIdentifier(&self, identifier: Option<&Object>); + + #[method_id(@__retain_semantics Other color)] + pub unsafe fn color(&self) -> Id; + + #[method(setColor:)] + pub unsafe fn setColor(&self, color: &NSColor); + + #[method_id(@__retain_semantics Other label)] + pub unsafe fn label(&self) -> Id; + + #[method(setLabel:)] + pub unsafe fn setLabel(&self, label: &NSString); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + + #[method_id(@__retain_semantics Other view)] + pub unsafe fn view(&self) -> Option>; + + #[method(setView:)] + pub unsafe fn setView(&self, view: Option<&NSView>); + + #[method_id(@__retain_semantics Other viewController)] + pub unsafe fn viewController(&self) -> Option>; + + #[method(setViewController:)] + pub unsafe fn setViewController(&self, viewController: Option<&NSViewController>); + + #[method(tabState)] + pub unsafe fn tabState(&self) -> NSTabState; + + #[method_id(@__retain_semantics Other tabView)] + pub unsafe fn tabView(&self) -> Option>; + + #[method_id(@__retain_semantics Other initialFirstResponder)] + pub unsafe fn initialFirstResponder(&self) -> Option>; + + #[method(setInitialFirstResponder:)] + pub unsafe fn setInitialFirstResponder(&self, initialFirstResponder: Option<&NSView>); + + #[method_id(@__retain_semantics Other toolTip)] + pub unsafe fn toolTip(&self) -> Option>; + + #[method(setToolTip:)] + pub unsafe fn setToolTip(&self, toolTip: Option<&NSString>); + + #[method(drawLabel:inRect:)] + pub unsafe fn drawLabel_inRect(&self, shouldTruncateLabel: bool, labelRect: NSRect); + + #[method(sizeOfLabel:)] + pub unsafe fn sizeOfLabel(&self, computeMin: bool) -> NSSize; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTableCellView.rs b/crates/icrate/src/generated/AppKit/NSTableCellView.rs new file mode 100644 index 000000000..8dc498773 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTableCellView.rs @@ -0,0 +1,54 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTableCellView; + + unsafe impl ClassType for NSTableCellView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSTableCellView { + #[method_id(@__retain_semantics Other objectValue)] + pub unsafe fn objectValue(&self) -> Option>; + + #[method(setObjectValue:)] + pub unsafe fn setObjectValue(&self, objectValue: Option<&Object>); + + #[method_id(@__retain_semantics Other textField)] + pub unsafe fn textField(&self) -> Option>; + + #[method(setTextField:)] + pub unsafe fn setTextField(&self, textField: Option<&NSTextField>); + + #[method_id(@__retain_semantics Other imageView)] + pub unsafe fn imageView(&self) -> Option>; + + #[method(setImageView:)] + pub unsafe fn setImageView(&self, imageView: Option<&NSImageView>); + + #[method(backgroundStyle)] + pub unsafe fn backgroundStyle(&self) -> NSBackgroundStyle; + + #[method(setBackgroundStyle:)] + pub unsafe fn setBackgroundStyle(&self, backgroundStyle: NSBackgroundStyle); + + #[method(rowSizeStyle)] + pub unsafe fn rowSizeStyle(&self) -> NSTableViewRowSizeStyle; + + #[method(setRowSizeStyle:)] + pub unsafe fn setRowSizeStyle(&self, rowSizeStyle: NSTableViewRowSizeStyle); + + #[method_id(@__retain_semantics Other draggingImageComponents)] + pub unsafe fn draggingImageComponents( + &self, + ) -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTableColumn.rs b/crates/icrate/src/generated/AppKit/NSTableColumn.rs new file mode 100644 index 000000000..3ac97620c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTableColumn.rs @@ -0,0 +1,138 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTableColumnResizingOptions { + NSTableColumnNoResizing = 0, + NSTableColumnAutoresizingMask = 1 << 0, + NSTableColumnUserResizingMask = 1 << 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTableColumn; + + unsafe impl ClassType for NSTableColumn { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTableColumn { + #[method_id(@__retain_semantics Init initWithIdentifier:)] + pub unsafe fn initWithIdentifier( + this: Option>, + identifier: &NSUserInterfaceItemIdentifier, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Id; + + #[method(setIdentifier:)] + pub unsafe fn setIdentifier(&self, identifier: &NSUserInterfaceItemIdentifier); + + #[method_id(@__retain_semantics Other tableView)] + pub unsafe fn tableView(&self) -> Option>; + + #[method(setTableView:)] + pub unsafe fn setTableView(&self, tableView: Option<&NSTableView>); + + #[method(width)] + pub unsafe fn width(&self) -> CGFloat; + + #[method(setWidth:)] + pub unsafe fn setWidth(&self, width: CGFloat); + + #[method(minWidth)] + pub unsafe fn minWidth(&self) -> CGFloat; + + #[method(setMinWidth:)] + pub unsafe fn setMinWidth(&self, minWidth: CGFloat); + + #[method(maxWidth)] + pub unsafe fn maxWidth(&self) -> CGFloat; + + #[method(setMaxWidth:)] + pub unsafe fn setMaxWidth(&self, maxWidth: CGFloat); + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + + #[method_id(@__retain_semantics Other headerCell)] + pub unsafe fn headerCell(&self) -> Id; + + #[method(setHeaderCell:)] + pub unsafe fn setHeaderCell(&self, headerCell: &NSTableHeaderCell); + + #[method(isEditable)] + pub unsafe fn isEditable(&self) -> bool; + + #[method(setEditable:)] + pub unsafe fn setEditable(&self, editable: bool); + + #[method(sizeToFit)] + pub unsafe fn sizeToFit(&self); + + #[method_id(@__retain_semantics Other sortDescriptorPrototype)] + pub unsafe fn sortDescriptorPrototype(&self) -> Option>; + + #[method(setSortDescriptorPrototype:)] + pub unsafe fn setSortDescriptorPrototype( + &self, + sortDescriptorPrototype: Option<&NSSortDescriptor>, + ); + + #[method(resizingMask)] + pub unsafe fn resizingMask(&self) -> NSTableColumnResizingOptions; + + #[method(setResizingMask:)] + pub unsafe fn setResizingMask(&self, resizingMask: NSTableColumnResizingOptions); + + #[method_id(@__retain_semantics Other headerToolTip)] + pub unsafe fn headerToolTip(&self) -> Option>; + + #[method(setHeaderToolTip:)] + pub unsafe fn setHeaderToolTip(&self, headerToolTip: Option<&NSString>); + + #[method(isHidden)] + pub unsafe fn isHidden(&self) -> bool; + + #[method(setHidden:)] + pub unsafe fn setHidden(&self, hidden: bool); + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSTableColumn { + #[method(setResizable:)] + pub unsafe fn setResizable(&self, flag: bool); + + #[method(isResizable)] + pub unsafe fn isResizable(&self) -> bool; + + #[method_id(@__retain_semantics Other dataCell)] + pub unsafe fn dataCell(&self) -> Id; + + #[method(setDataCell:)] + pub unsafe fn setDataCell(&self, dataCell: &Object); + + #[method_id(@__retain_semantics Other dataCellForRow:)] + pub unsafe fn dataCellForRow(&self, row: NSInteger) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTableHeaderCell.rs b/crates/icrate/src/generated/AppKit/NSTableHeaderCell.rs new file mode 100644 index 000000000..2fdfdc94c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTableHeaderCell.rs @@ -0,0 +1,31 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTableHeaderCell; + + unsafe impl ClassType for NSTableHeaderCell { + type Super = NSTextFieldCell; + } +); + +extern_methods!( + unsafe impl NSTableHeaderCell { + #[method(drawSortIndicatorWithFrame:inView:ascending:priority:)] + pub unsafe fn drawSortIndicatorWithFrame_inView_ascending_priority( + &self, + cellFrame: NSRect, + controlView: &NSView, + ascending: bool, + priority: NSInteger, + ); + + #[method(sortIndicatorRectForBounds:)] + pub unsafe fn sortIndicatorRectForBounds(&self, rect: NSRect) -> NSRect; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTableHeaderView.rs b/crates/icrate/src/generated/AppKit/NSTableHeaderView.rs new file mode 100644 index 000000000..069d918cb --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTableHeaderView.rs @@ -0,0 +1,40 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTableHeaderView; + + unsafe impl ClassType for NSTableHeaderView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSTableHeaderView { + #[method_id(@__retain_semantics Other tableView)] + pub unsafe fn tableView(&self) -> Option>; + + #[method(setTableView:)] + pub unsafe fn setTableView(&self, tableView: Option<&NSTableView>); + + #[method(draggedColumn)] + pub unsafe fn draggedColumn(&self) -> NSInteger; + + #[method(draggedDistance)] + pub unsafe fn draggedDistance(&self) -> CGFloat; + + #[method(resizedColumn)] + pub unsafe fn resizedColumn(&self) -> NSInteger; + + #[method(headerRectOfColumn:)] + pub unsafe fn headerRectOfColumn(&self, column: NSInteger) -> NSRect; + + #[method(columnAtPoint:)] + pub unsafe fn columnAtPoint(&self, point: NSPoint) -> NSInteger; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTableRowView.rs b/crates/icrate/src/generated/AppKit/NSTableRowView.rs new file mode 100644 index 000000000..0b93f72ab --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTableRowView.rs @@ -0,0 +1,114 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTableRowView; + + unsafe impl ClassType for NSTableRowView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSTableRowView { + #[method(selectionHighlightStyle)] + pub unsafe fn selectionHighlightStyle(&self) -> NSTableViewSelectionHighlightStyle; + + #[method(setSelectionHighlightStyle:)] + pub unsafe fn setSelectionHighlightStyle( + &self, + selectionHighlightStyle: NSTableViewSelectionHighlightStyle, + ); + + #[method(isEmphasized)] + pub unsafe fn isEmphasized(&self) -> bool; + + #[method(setEmphasized:)] + pub unsafe fn setEmphasized(&self, emphasized: bool); + + #[method(isGroupRowStyle)] + pub unsafe fn isGroupRowStyle(&self) -> bool; + + #[method(setGroupRowStyle:)] + pub unsafe fn setGroupRowStyle(&self, groupRowStyle: bool); + + #[method(isSelected)] + pub unsafe fn isSelected(&self) -> bool; + + #[method(setSelected:)] + pub unsafe fn setSelected(&self, selected: bool); + + #[method(isPreviousRowSelected)] + pub unsafe fn isPreviousRowSelected(&self) -> bool; + + #[method(setPreviousRowSelected:)] + pub unsafe fn setPreviousRowSelected(&self, previousRowSelected: bool); + + #[method(isNextRowSelected)] + pub unsafe fn isNextRowSelected(&self) -> bool; + + #[method(setNextRowSelected:)] + pub unsafe fn setNextRowSelected(&self, nextRowSelected: bool); + + #[method(isFloating)] + pub unsafe fn isFloating(&self) -> bool; + + #[method(setFloating:)] + pub unsafe fn setFloating(&self, floating: bool); + + #[method(isTargetForDropOperation)] + pub unsafe fn isTargetForDropOperation(&self) -> bool; + + #[method(setTargetForDropOperation:)] + pub unsafe fn setTargetForDropOperation(&self, targetForDropOperation: bool); + + #[method(draggingDestinationFeedbackStyle)] + pub unsafe fn draggingDestinationFeedbackStyle( + &self, + ) -> NSTableViewDraggingDestinationFeedbackStyle; + + #[method(setDraggingDestinationFeedbackStyle:)] + pub unsafe fn setDraggingDestinationFeedbackStyle( + &self, + draggingDestinationFeedbackStyle: NSTableViewDraggingDestinationFeedbackStyle, + ); + + #[method(indentationForDropOperation)] + pub unsafe fn indentationForDropOperation(&self) -> CGFloat; + + #[method(setIndentationForDropOperation:)] + pub unsafe fn setIndentationForDropOperation(&self, indentationForDropOperation: CGFloat); + + #[method(interiorBackgroundStyle)] + pub unsafe fn interiorBackgroundStyle(&self) -> NSBackgroundStyle; + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Id; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: &NSColor); + + #[method(drawBackgroundInRect:)] + pub unsafe fn drawBackgroundInRect(&self, dirtyRect: NSRect); + + #[method(drawSelectionInRect:)] + pub unsafe fn drawSelectionInRect(&self, dirtyRect: NSRect); + + #[method(drawSeparatorInRect:)] + pub unsafe fn drawSeparatorInRect(&self, dirtyRect: NSRect); + + #[method(drawDraggingDestinationFeedbackInRect:)] + pub unsafe fn drawDraggingDestinationFeedbackInRect(&self, dirtyRect: NSRect); + + #[method_id(@__retain_semantics Other viewAtColumn:)] + pub unsafe fn viewAtColumn(&self, column: NSInteger) -> Option>; + + #[method(numberOfColumns)] + pub unsafe fn numberOfColumns(&self) -> NSInteger; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTableView.rs b/crates/icrate/src/generated/AppKit/NSTableView.rs new file mode 100644 index 000000000..07d008ba1 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTableView.rs @@ -0,0 +1,1090 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTableViewDropOperation { + NSTableViewDropOn = 0, + NSTableViewDropAbove = 1, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTableViewColumnAutoresizingStyle { + NSTableViewNoColumnAutoresizing = 0, + NSTableViewUniformColumnAutoresizingStyle = 1, + NSTableViewSequentialColumnAutoresizingStyle = 2, + NSTableViewReverseSequentialColumnAutoresizingStyle = 3, + NSTableViewLastColumnOnlyAutoresizingStyle = 4, + NSTableViewFirstColumnOnlyAutoresizingStyle = 5, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTableViewGridLineStyle { + NSTableViewGridNone = 0, + NSTableViewSolidVerticalGridLineMask = 1 << 0, + NSTableViewSolidHorizontalGridLineMask = 1 << 1, + NSTableViewDashedHorizontalGridLineMask = 1 << 3, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTableViewRowSizeStyle { + NSTableViewRowSizeStyleDefault = -1, + NSTableViewRowSizeStyleCustom = 0, + NSTableViewRowSizeStyleSmall = 1, + NSTableViewRowSizeStyleMedium = 2, + NSTableViewRowSizeStyleLarge = 3, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTableViewStyle { + NSTableViewStyleAutomatic = 0, + NSTableViewStyleFullWidth = 1, + NSTableViewStyleInset = 2, + NSTableViewStyleSourceList = 3, + NSTableViewStylePlain = 4, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTableViewSelectionHighlightStyle { + NSTableViewSelectionHighlightStyleNone = -1, + NSTableViewSelectionHighlightStyleRegular = 0, + NSTableViewSelectionHighlightStyleSourceList = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTableViewDraggingDestinationFeedbackStyle { + NSTableViewDraggingDestinationFeedbackStyleNone = -1, + NSTableViewDraggingDestinationFeedbackStyleRegular = 0, + NSTableViewDraggingDestinationFeedbackStyleSourceList = 1, + NSTableViewDraggingDestinationFeedbackStyleGap = 2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTableRowActionEdge { + NSTableRowActionEdgeLeading = 0, + NSTableRowActionEdgeTrailing = 1, + } +); + +pub type NSTableViewAutosaveName = NSString; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTableViewAnimationOptions { + NSTableViewAnimationEffectNone = 0x0, + NSTableViewAnimationEffectFade = 0x1, + NSTableViewAnimationEffectGap = 0x2, + NSTableViewAnimationSlideUp = 0x10, + NSTableViewAnimationSlideDown = 0x20, + NSTableViewAnimationSlideLeft = 0x30, + NSTableViewAnimationSlideRight = 0x40, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTableView; + + unsafe impl ClassType for NSTableView { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSTableView { + #[method_id(@__retain_semantics Init initWithFrame:)] + pub unsafe fn initWithFrame( + this: Option>, + frameRect: NSRect, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other dataSource)] + pub unsafe fn dataSource(&self) -> Option>; + + #[method(setDataSource:)] + pub unsafe fn setDataSource(&self, dataSource: Option<&NSTableViewDataSource>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTableViewDelegate>); + + #[method_id(@__retain_semantics Other headerView)] + pub unsafe fn headerView(&self) -> Option>; + + #[method(setHeaderView:)] + pub unsafe fn setHeaderView(&self, headerView: Option<&NSTableHeaderView>); + + #[method_id(@__retain_semantics Other cornerView)] + pub unsafe fn cornerView(&self) -> Option>; + + #[method(setCornerView:)] + pub unsafe fn setCornerView(&self, cornerView: Option<&NSView>); + + #[method(allowsColumnReordering)] + pub unsafe fn allowsColumnReordering(&self) -> bool; + + #[method(setAllowsColumnReordering:)] + pub unsafe fn setAllowsColumnReordering(&self, allowsColumnReordering: bool); + + #[method(allowsColumnResizing)] + pub unsafe fn allowsColumnResizing(&self) -> bool; + + #[method(setAllowsColumnResizing:)] + pub unsafe fn setAllowsColumnResizing(&self, allowsColumnResizing: bool); + + #[method(columnAutoresizingStyle)] + pub unsafe fn columnAutoresizingStyle(&self) -> NSTableViewColumnAutoresizingStyle; + + #[method(setColumnAutoresizingStyle:)] + pub unsafe fn setColumnAutoresizingStyle( + &self, + columnAutoresizingStyle: NSTableViewColumnAutoresizingStyle, + ); + + #[method(gridStyleMask)] + pub unsafe fn gridStyleMask(&self) -> NSTableViewGridLineStyle; + + #[method(setGridStyleMask:)] + pub unsafe fn setGridStyleMask(&self, gridStyleMask: NSTableViewGridLineStyle); + + #[method(intercellSpacing)] + pub unsafe fn intercellSpacing(&self) -> NSSize; + + #[method(setIntercellSpacing:)] + pub unsafe fn setIntercellSpacing(&self, intercellSpacing: NSSize); + + #[method(usesAlternatingRowBackgroundColors)] + pub unsafe fn usesAlternatingRowBackgroundColors(&self) -> bool; + + #[method(setUsesAlternatingRowBackgroundColors:)] + pub unsafe fn setUsesAlternatingRowBackgroundColors( + &self, + usesAlternatingRowBackgroundColors: bool, + ); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Id; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: &NSColor); + + #[method_id(@__retain_semantics Other gridColor)] + pub unsafe fn gridColor(&self) -> Id; + + #[method(setGridColor:)] + pub unsafe fn setGridColor(&self, gridColor: &NSColor); + + #[method(rowSizeStyle)] + pub unsafe fn rowSizeStyle(&self) -> NSTableViewRowSizeStyle; + + #[method(setRowSizeStyle:)] + pub unsafe fn setRowSizeStyle(&self, rowSizeStyle: NSTableViewRowSizeStyle); + + #[method(effectiveRowSizeStyle)] + pub unsafe fn effectiveRowSizeStyle(&self) -> NSTableViewRowSizeStyle; + + #[method(rowHeight)] + pub unsafe fn rowHeight(&self) -> CGFloat; + + #[method(setRowHeight:)] + pub unsafe fn setRowHeight(&self, rowHeight: CGFloat); + + #[method(noteHeightOfRowsWithIndexesChanged:)] + pub unsafe fn noteHeightOfRowsWithIndexesChanged(&self, indexSet: &NSIndexSet); + + #[method_id(@__retain_semantics Other tableColumns)] + pub unsafe fn tableColumns(&self) -> Id, Shared>; + + #[method(numberOfColumns)] + pub unsafe fn numberOfColumns(&self) -> NSInteger; + + #[method(numberOfRows)] + pub unsafe fn numberOfRows(&self) -> NSInteger; + + #[method(addTableColumn:)] + pub unsafe fn addTableColumn(&self, tableColumn: &NSTableColumn); + + #[method(removeTableColumn:)] + pub unsafe fn removeTableColumn(&self, tableColumn: &NSTableColumn); + + #[method(moveColumn:toColumn:)] + pub unsafe fn moveColumn_toColumn(&self, oldIndex: NSInteger, newIndex: NSInteger); + + #[method(columnWithIdentifier:)] + pub unsafe fn columnWithIdentifier( + &self, + identifier: &NSUserInterfaceItemIdentifier, + ) -> NSInteger; + + #[method_id(@__retain_semantics Other tableColumnWithIdentifier:)] + pub unsafe fn tableColumnWithIdentifier( + &self, + identifier: &NSUserInterfaceItemIdentifier, + ) -> Option>; + + #[method(tile)] + pub unsafe fn tile(&self); + + #[method(sizeToFit)] + pub unsafe fn sizeToFit(&self); + + #[method(sizeLastColumnToFit)] + pub unsafe fn sizeLastColumnToFit(&self); + + #[method(scrollRowToVisible:)] + pub unsafe fn scrollRowToVisible(&self, row: NSInteger); + + #[method(scrollColumnToVisible:)] + pub unsafe fn scrollColumnToVisible(&self, column: NSInteger); + + #[method(reloadData)] + pub unsafe fn reloadData(&self); + + #[method(noteNumberOfRowsChanged)] + pub unsafe fn noteNumberOfRowsChanged(&self); + + #[method(reloadDataForRowIndexes:columnIndexes:)] + pub unsafe fn reloadDataForRowIndexes_columnIndexes( + &self, + rowIndexes: &NSIndexSet, + columnIndexes: &NSIndexSet, + ); + + #[method(editedColumn)] + pub unsafe fn editedColumn(&self) -> NSInteger; + + #[method(editedRow)] + pub unsafe fn editedRow(&self) -> NSInteger; + + #[method(clickedColumn)] + pub unsafe fn clickedColumn(&self) -> NSInteger; + + #[method(clickedRow)] + pub unsafe fn clickedRow(&self) -> NSInteger; + + #[method(doubleAction)] + pub unsafe fn doubleAction(&self) -> OptionSel; + + #[method(setDoubleAction:)] + pub unsafe fn setDoubleAction(&self, doubleAction: OptionSel); + + #[method_id(@__retain_semantics Other sortDescriptors)] + pub unsafe fn sortDescriptors(&self) -> Id, Shared>; + + #[method(setSortDescriptors:)] + pub unsafe fn setSortDescriptors(&self, sortDescriptors: &NSArray); + + #[method(setIndicatorImage:inTableColumn:)] + pub unsafe fn setIndicatorImage_inTableColumn( + &self, + image: Option<&NSImage>, + tableColumn: &NSTableColumn, + ); + + #[method_id(@__retain_semantics Other indicatorImageInTableColumn:)] + pub unsafe fn indicatorImageInTableColumn( + &self, + tableColumn: &NSTableColumn, + ) -> Option>; + + #[method_id(@__retain_semantics Other highlightedTableColumn)] + pub unsafe fn highlightedTableColumn(&self) -> Option>; + + #[method(setHighlightedTableColumn:)] + pub unsafe fn setHighlightedTableColumn( + &self, + highlightedTableColumn: Option<&NSTableColumn>, + ); + + #[method(verticalMotionCanBeginDrag)] + pub unsafe fn verticalMotionCanBeginDrag(&self) -> bool; + + #[method(setVerticalMotionCanBeginDrag:)] + pub unsafe fn setVerticalMotionCanBeginDrag(&self, verticalMotionCanBeginDrag: bool); + + #[method(canDragRowsWithIndexes:atPoint:)] + pub unsafe fn canDragRowsWithIndexes_atPoint( + &self, + rowIndexes: &NSIndexSet, + mouseDownPoint: NSPoint, + ) -> bool; + + #[method_id(@__retain_semantics Other dragImageForRowsWithIndexes:tableColumns:event:offset:)] + pub unsafe fn dragImageForRowsWithIndexes_tableColumns_event_offset( + &self, + dragRows: &NSIndexSet, + tableColumns: &NSArray, + dragEvent: &NSEvent, + dragImageOffset: NSPointPointer, + ) -> Id; + + #[method(setDraggingSourceOperationMask:forLocal:)] + pub unsafe fn setDraggingSourceOperationMask_forLocal( + &self, + mask: NSDragOperation, + isLocal: bool, + ); + + #[method(setDropRow:dropOperation:)] + pub unsafe fn setDropRow_dropOperation( + &self, + row: NSInteger, + dropOperation: NSTableViewDropOperation, + ); + + #[method(allowsMultipleSelection)] + pub unsafe fn allowsMultipleSelection(&self) -> bool; + + #[method(setAllowsMultipleSelection:)] + pub unsafe fn setAllowsMultipleSelection(&self, allowsMultipleSelection: bool); + + #[method(allowsEmptySelection)] + pub unsafe fn allowsEmptySelection(&self) -> bool; + + #[method(setAllowsEmptySelection:)] + pub unsafe fn setAllowsEmptySelection(&self, allowsEmptySelection: bool); + + #[method(allowsColumnSelection)] + pub unsafe fn allowsColumnSelection(&self) -> bool; + + #[method(setAllowsColumnSelection:)] + pub unsafe fn setAllowsColumnSelection(&self, allowsColumnSelection: bool); + + #[method(selectAll:)] + pub unsafe fn selectAll(&self, sender: Option<&Object>); + + #[method(deselectAll:)] + pub unsafe fn deselectAll(&self, sender: Option<&Object>); + + #[method(selectColumnIndexes:byExtendingSelection:)] + pub unsafe fn selectColumnIndexes_byExtendingSelection( + &self, + indexes: &NSIndexSet, + extend: bool, + ); + + #[method(selectRowIndexes:byExtendingSelection:)] + pub unsafe fn selectRowIndexes_byExtendingSelection( + &self, + indexes: &NSIndexSet, + extend: bool, + ); + + #[method_id(@__retain_semantics Other selectedColumnIndexes)] + pub unsafe fn selectedColumnIndexes(&self) -> Id; + + #[method_id(@__retain_semantics Other selectedRowIndexes)] + pub unsafe fn selectedRowIndexes(&self) -> Id; + + #[method(deselectColumn:)] + pub unsafe fn deselectColumn(&self, column: NSInteger); + + #[method(deselectRow:)] + pub unsafe fn deselectRow(&self, row: NSInteger); + + #[method(selectedColumn)] + pub unsafe fn selectedColumn(&self) -> NSInteger; + + #[method(selectedRow)] + pub unsafe fn selectedRow(&self) -> NSInteger; + + #[method(isColumnSelected:)] + pub unsafe fn isColumnSelected(&self, column: NSInteger) -> bool; + + #[method(isRowSelected:)] + pub unsafe fn isRowSelected(&self, row: NSInteger) -> bool; + + #[method(numberOfSelectedColumns)] + pub unsafe fn numberOfSelectedColumns(&self) -> NSInteger; + + #[method(numberOfSelectedRows)] + pub unsafe fn numberOfSelectedRows(&self) -> NSInteger; + + #[method(allowsTypeSelect)] + pub unsafe fn allowsTypeSelect(&self) -> bool; + + #[method(setAllowsTypeSelect:)] + pub unsafe fn setAllowsTypeSelect(&self, allowsTypeSelect: bool); + + #[method(style)] + pub unsafe fn style(&self) -> NSTableViewStyle; + + #[method(setStyle:)] + pub unsafe fn setStyle(&self, style: NSTableViewStyle); + + #[method(effectiveStyle)] + pub unsafe fn effectiveStyle(&self) -> NSTableViewStyle; + + #[method(selectionHighlightStyle)] + pub unsafe fn selectionHighlightStyle(&self) -> NSTableViewSelectionHighlightStyle; + + #[method(setSelectionHighlightStyle:)] + pub unsafe fn setSelectionHighlightStyle( + &self, + selectionHighlightStyle: NSTableViewSelectionHighlightStyle, + ); + + #[method(draggingDestinationFeedbackStyle)] + pub unsafe fn draggingDestinationFeedbackStyle( + &self, + ) -> NSTableViewDraggingDestinationFeedbackStyle; + + #[method(setDraggingDestinationFeedbackStyle:)] + pub unsafe fn setDraggingDestinationFeedbackStyle( + &self, + draggingDestinationFeedbackStyle: NSTableViewDraggingDestinationFeedbackStyle, + ); + + #[method(rectOfColumn:)] + pub unsafe fn rectOfColumn(&self, column: NSInteger) -> NSRect; + + #[method(rectOfRow:)] + pub unsafe fn rectOfRow(&self, row: NSInteger) -> NSRect; + + #[method_id(@__retain_semantics Other columnIndexesInRect:)] + pub unsafe fn columnIndexesInRect(&self, rect: NSRect) -> Id; + + #[method(rowsInRect:)] + pub unsafe fn rowsInRect(&self, rect: NSRect) -> NSRange; + + #[method(columnAtPoint:)] + pub unsafe fn columnAtPoint(&self, point: NSPoint) -> NSInteger; + + #[method(rowAtPoint:)] + pub unsafe fn rowAtPoint(&self, point: NSPoint) -> NSInteger; + + #[method(frameOfCellAtColumn:row:)] + pub unsafe fn frameOfCellAtColumn_row(&self, column: NSInteger, row: NSInteger) -> NSRect; + + #[method_id(@__retain_semantics Other autosaveName)] + pub unsafe fn autosaveName(&self) -> Option>; + + #[method(setAutosaveName:)] + pub unsafe fn setAutosaveName(&self, autosaveName: Option<&NSTableViewAutosaveName>); + + #[method(autosaveTableColumns)] + pub unsafe fn autosaveTableColumns(&self) -> bool; + + #[method(setAutosaveTableColumns:)] + pub unsafe fn setAutosaveTableColumns(&self, autosaveTableColumns: bool); + + #[method(editColumn:row:withEvent:select:)] + pub unsafe fn editColumn_row_withEvent_select( + &self, + column: NSInteger, + row: NSInteger, + event: Option<&NSEvent>, + select: bool, + ); + + #[method(drawRow:clipRect:)] + pub unsafe fn drawRow_clipRect(&self, row: NSInteger, clipRect: NSRect); + + #[method(highlightSelectionInClipRect:)] + pub unsafe fn highlightSelectionInClipRect(&self, clipRect: NSRect); + + #[method(drawGridInClipRect:)] + pub unsafe fn drawGridInClipRect(&self, clipRect: NSRect); + + #[method(drawBackgroundInClipRect:)] + pub unsafe fn drawBackgroundInClipRect(&self, clipRect: NSRect); + + #[method_id(@__retain_semantics Other viewAtColumn:row:makeIfNecessary:)] + pub unsafe fn viewAtColumn_row_makeIfNecessary( + &self, + column: NSInteger, + row: NSInteger, + makeIfNecessary: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other rowViewAtRow:makeIfNecessary:)] + pub unsafe fn rowViewAtRow_makeIfNecessary( + &self, + row: NSInteger, + makeIfNecessary: bool, + ) -> Option>; + + #[method(rowForView:)] + pub unsafe fn rowForView(&self, view: &NSView) -> NSInteger; + + #[method(columnForView:)] + pub unsafe fn columnForView(&self, view: &NSView) -> NSInteger; + + #[method_id(@__retain_semantics Other makeViewWithIdentifier:owner:)] + pub unsafe fn makeViewWithIdentifier_owner( + &self, + identifier: &NSUserInterfaceItemIdentifier, + owner: Option<&Object>, + ) -> Option>; + + #[method(enumerateAvailableRowViewsUsingBlock:)] + pub unsafe fn enumerateAvailableRowViewsUsingBlock( + &self, + handler: &Block<(NonNull, NSInteger), ()>, + ); + + #[method(floatsGroupRows)] + pub unsafe fn floatsGroupRows(&self) -> bool; + + #[method(setFloatsGroupRows:)] + pub unsafe fn setFloatsGroupRows(&self, floatsGroupRows: bool); + + #[method(rowActionsVisible)] + pub unsafe fn rowActionsVisible(&self) -> bool; + + #[method(setRowActionsVisible:)] + pub unsafe fn setRowActionsVisible(&self, rowActionsVisible: bool); + + #[method(beginUpdates)] + pub unsafe fn beginUpdates(&self); + + #[method(endUpdates)] + pub unsafe fn endUpdates(&self); + + #[method(insertRowsAtIndexes:withAnimation:)] + pub unsafe fn insertRowsAtIndexes_withAnimation( + &self, + indexes: &NSIndexSet, + animationOptions: NSTableViewAnimationOptions, + ); + + #[method(removeRowsAtIndexes:withAnimation:)] + pub unsafe fn removeRowsAtIndexes_withAnimation( + &self, + indexes: &NSIndexSet, + animationOptions: NSTableViewAnimationOptions, + ); + + #[method(moveRowAtIndex:toIndex:)] + pub unsafe fn moveRowAtIndex_toIndex(&self, oldIndex: NSInteger, newIndex: NSInteger); + + #[method(hideRowsAtIndexes:withAnimation:)] + pub unsafe fn hideRowsAtIndexes_withAnimation( + &self, + indexes: &NSIndexSet, + rowAnimation: NSTableViewAnimationOptions, + ); + + #[method(unhideRowsAtIndexes:withAnimation:)] + pub unsafe fn unhideRowsAtIndexes_withAnimation( + &self, + indexes: &NSIndexSet, + rowAnimation: NSTableViewAnimationOptions, + ); + + #[method_id(@__retain_semantics Other hiddenRowIndexes)] + pub unsafe fn hiddenRowIndexes(&self) -> Id; + + #[method(registerNib:forIdentifier:)] + pub unsafe fn registerNib_forIdentifier( + &self, + nib: Option<&NSNib>, + identifier: &NSUserInterfaceItemIdentifier, + ); + + #[method_id(@__retain_semantics Other registeredNibsByIdentifier)] + pub unsafe fn registeredNibsByIdentifier( + &self, + ) -> Option, Shared>>; + + #[method(didAddRowView:forRow:)] + pub unsafe fn didAddRowView_forRow(&self, rowView: &NSTableRowView, row: NSInteger); + + #[method(didRemoveRowView:forRow:)] + pub unsafe fn didRemoveRowView_forRow(&self, rowView: &NSTableRowView, row: NSInteger); + + #[method(usesStaticContents)] + pub unsafe fn usesStaticContents(&self) -> bool; + + #[method(setUsesStaticContents:)] + pub unsafe fn setUsesStaticContents(&self, usesStaticContents: bool); + + #[method(userInterfaceLayoutDirection)] + pub unsafe fn userInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection; + + #[method(setUserInterfaceLayoutDirection:)] + pub unsafe fn setUserInterfaceLayoutDirection( + &self, + userInterfaceLayoutDirection: NSUserInterfaceLayoutDirection, + ); + + #[method(usesAutomaticRowHeights)] + pub unsafe fn usesAutomaticRowHeights(&self) -> bool; + + #[method(setUsesAutomaticRowHeights:)] + pub unsafe fn setUsesAutomaticRowHeights(&self, usesAutomaticRowHeights: bool); + } +); + +extern_protocol!( + pub struct NSTableViewDelegate; + + unsafe impl NSTableViewDelegate { + #[optional] + #[method_id(@__retain_semantics Other tableView:viewForTableColumn:row:)] + pub unsafe fn tableView_viewForTableColumn_row( + &self, + tableView: &NSTableView, + tableColumn: Option<&NSTableColumn>, + row: NSInteger, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other tableView:rowViewForRow:)] + pub unsafe fn tableView_rowViewForRow( + &self, + tableView: &NSTableView, + row: NSInteger, + ) -> Option>; + + #[optional] + #[method(tableView:didAddRowView:forRow:)] + pub unsafe fn tableView_didAddRowView_forRow( + &self, + tableView: &NSTableView, + rowView: &NSTableRowView, + row: NSInteger, + ); + + #[optional] + #[method(tableView:didRemoveRowView:forRow:)] + pub unsafe fn tableView_didRemoveRowView_forRow( + &self, + tableView: &NSTableView, + rowView: &NSTableRowView, + row: NSInteger, + ); + + #[optional] + #[method(tableView:willDisplayCell:forTableColumn:row:)] + pub unsafe fn tableView_willDisplayCell_forTableColumn_row( + &self, + tableView: &NSTableView, + cell: &Object, + tableColumn: Option<&NSTableColumn>, + row: NSInteger, + ); + + #[optional] + #[method(tableView:shouldEditTableColumn:row:)] + pub unsafe fn tableView_shouldEditTableColumn_row( + &self, + tableView: &NSTableView, + tableColumn: Option<&NSTableColumn>, + row: NSInteger, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other tableView:toolTipForCell:rect:tableColumn:row:mouseLocation:)] + pub unsafe fn tableView_toolTipForCell_rect_tableColumn_row_mouseLocation( + &self, + tableView: &NSTableView, + cell: &NSCell, + rect: NSRectPointer, + tableColumn: Option<&NSTableColumn>, + row: NSInteger, + mouseLocation: NSPoint, + ) -> Id; + + #[optional] + #[method(tableView:shouldShowCellExpansionForTableColumn:row:)] + pub unsafe fn tableView_shouldShowCellExpansionForTableColumn_row( + &self, + tableView: &NSTableView, + tableColumn: Option<&NSTableColumn>, + row: NSInteger, + ) -> bool; + + #[optional] + #[method(tableView:shouldTrackCell:forTableColumn:row:)] + pub unsafe fn tableView_shouldTrackCell_forTableColumn_row( + &self, + tableView: &NSTableView, + cell: &NSCell, + tableColumn: Option<&NSTableColumn>, + row: NSInteger, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other tableView:dataCellForTableColumn:row:)] + pub unsafe fn tableView_dataCellForTableColumn_row( + &self, + tableView: &NSTableView, + tableColumn: Option<&NSTableColumn>, + row: NSInteger, + ) -> Option>; + + #[optional] + #[method(selectionShouldChangeInTableView:)] + pub unsafe fn selectionShouldChangeInTableView(&self, tableView: &NSTableView) -> bool; + + #[optional] + #[method(tableView:shouldSelectRow:)] + pub unsafe fn tableView_shouldSelectRow( + &self, + tableView: &NSTableView, + row: NSInteger, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other tableView:selectionIndexesForProposedSelection:)] + pub unsafe fn tableView_selectionIndexesForProposedSelection( + &self, + tableView: &NSTableView, + proposedSelectionIndexes: &NSIndexSet, + ) -> Id; + + #[optional] + #[method(tableView:shouldSelectTableColumn:)] + pub unsafe fn tableView_shouldSelectTableColumn( + &self, + tableView: &NSTableView, + tableColumn: Option<&NSTableColumn>, + ) -> bool; + + #[optional] + #[method(tableView:mouseDownInHeaderOfTableColumn:)] + pub unsafe fn tableView_mouseDownInHeaderOfTableColumn( + &self, + tableView: &NSTableView, + tableColumn: &NSTableColumn, + ); + + #[optional] + #[method(tableView:didClickTableColumn:)] + pub unsafe fn tableView_didClickTableColumn( + &self, + tableView: &NSTableView, + tableColumn: &NSTableColumn, + ); + + #[optional] + #[method(tableView:didDragTableColumn:)] + pub unsafe fn tableView_didDragTableColumn( + &self, + tableView: &NSTableView, + tableColumn: &NSTableColumn, + ); + + #[optional] + #[method(tableView:heightOfRow:)] + pub unsafe fn tableView_heightOfRow( + &self, + tableView: &NSTableView, + row: NSInteger, + ) -> CGFloat; + + #[optional] + #[method_id(@__retain_semantics Other tableView:typeSelectStringForTableColumn:row:)] + pub unsafe fn tableView_typeSelectStringForTableColumn_row( + &self, + tableView: &NSTableView, + tableColumn: Option<&NSTableColumn>, + row: NSInteger, + ) -> Option>; + + #[optional] + #[method(tableView:nextTypeSelectMatchFromRow:toRow:forString:)] + pub unsafe fn tableView_nextTypeSelectMatchFromRow_toRow_forString( + &self, + tableView: &NSTableView, + startRow: NSInteger, + endRow: NSInteger, + searchString: &NSString, + ) -> NSInteger; + + #[optional] + #[method(tableView:shouldTypeSelectForEvent:withCurrentSearchString:)] + pub unsafe fn tableView_shouldTypeSelectForEvent_withCurrentSearchString( + &self, + tableView: &NSTableView, + event: &NSEvent, + searchString: Option<&NSString>, + ) -> bool; + + #[optional] + #[method(tableView:isGroupRow:)] + pub unsafe fn tableView_isGroupRow(&self, tableView: &NSTableView, row: NSInteger) -> bool; + + #[optional] + #[method(tableView:sizeToFitWidthOfColumn:)] + pub unsafe fn tableView_sizeToFitWidthOfColumn( + &self, + tableView: &NSTableView, + column: NSInteger, + ) -> CGFloat; + + #[optional] + #[method(tableView:shouldReorderColumn:toColumn:)] + pub unsafe fn tableView_shouldReorderColumn_toColumn( + &self, + tableView: &NSTableView, + columnIndex: NSInteger, + newColumnIndex: NSInteger, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other tableView:rowActionsForRow:edge:)] + pub unsafe fn tableView_rowActionsForRow_edge( + &self, + tableView: &NSTableView, + row: NSInteger, + edge: NSTableRowActionEdge, + ) -> Id, Shared>; + + #[optional] + #[method(tableViewSelectionDidChange:)] + pub unsafe fn tableViewSelectionDidChange(&self, notification: &NSNotification); + + #[optional] + #[method(tableViewColumnDidMove:)] + pub unsafe fn tableViewColumnDidMove(&self, notification: &NSNotification); + + #[optional] + #[method(tableViewColumnDidResize:)] + pub unsafe fn tableViewColumnDidResize(&self, notification: &NSNotification); + + #[optional] + #[method(tableViewSelectionIsChanging:)] + pub unsafe fn tableViewSelectionIsChanging(&self, notification: &NSNotification); + } +); + +extern_static!(NSTableViewSelectionDidChangeNotification: &'static NSNotificationName); + +extern_static!(NSTableViewColumnDidMoveNotification: &'static NSNotificationName); + +extern_static!(NSTableViewColumnDidResizeNotification: &'static NSNotificationName); + +extern_static!(NSTableViewSelectionIsChangingNotification: &'static NSNotificationName); + +extern_static!(NSTableViewRowViewKey: &'static NSUserInterfaceItemIdentifier); + +extern_protocol!( + pub struct NSTableViewDataSource; + + unsafe impl NSTableViewDataSource { + #[optional] + #[method(numberOfRowsInTableView:)] + pub unsafe fn numberOfRowsInTableView(&self, tableView: &NSTableView) -> NSInteger; + + #[optional] + #[method_id(@__retain_semantics Other tableView:objectValueForTableColumn:row:)] + pub unsafe fn tableView_objectValueForTableColumn_row( + &self, + tableView: &NSTableView, + tableColumn: Option<&NSTableColumn>, + row: NSInteger, + ) -> Option>; + + #[optional] + #[method(tableView:setObjectValue:forTableColumn:row:)] + pub unsafe fn tableView_setObjectValue_forTableColumn_row( + &self, + tableView: &NSTableView, + object: Option<&Object>, + tableColumn: Option<&NSTableColumn>, + row: NSInteger, + ); + + #[optional] + #[method(tableView:sortDescriptorsDidChange:)] + pub unsafe fn tableView_sortDescriptorsDidChange( + &self, + tableView: &NSTableView, + oldDescriptors: &NSArray, + ); + + #[optional] + #[method_id(@__retain_semantics Other tableView:pasteboardWriterForRow:)] + pub unsafe fn tableView_pasteboardWriterForRow( + &self, + tableView: &NSTableView, + row: NSInteger, + ) -> Option>; + + #[optional] + #[method(tableView:draggingSession:willBeginAtPoint:forRowIndexes:)] + pub unsafe fn tableView_draggingSession_willBeginAtPoint_forRowIndexes( + &self, + tableView: &NSTableView, + session: &NSDraggingSession, + screenPoint: NSPoint, + rowIndexes: &NSIndexSet, + ); + + #[optional] + #[method(tableView:draggingSession:endedAtPoint:operation:)] + pub unsafe fn tableView_draggingSession_endedAtPoint_operation( + &self, + tableView: &NSTableView, + session: &NSDraggingSession, + screenPoint: NSPoint, + operation: NSDragOperation, + ); + + #[optional] + #[method(tableView:updateDraggingItemsForDrag:)] + pub unsafe fn tableView_updateDraggingItemsForDrag( + &self, + tableView: &NSTableView, + draggingInfo: &NSDraggingInfo, + ); + + #[optional] + #[method(tableView:writeRowsWithIndexes:toPasteboard:)] + pub unsafe fn tableView_writeRowsWithIndexes_toPasteboard( + &self, + tableView: &NSTableView, + rowIndexes: &NSIndexSet, + pboard: &NSPasteboard, + ) -> bool; + + #[optional] + #[method(tableView:validateDrop:proposedRow:proposedDropOperation:)] + pub unsafe fn tableView_validateDrop_proposedRow_proposedDropOperation( + &self, + tableView: &NSTableView, + info: &NSDraggingInfo, + row: NSInteger, + dropOperation: NSTableViewDropOperation, + ) -> NSDragOperation; + + #[optional] + #[method(tableView:acceptDrop:row:dropOperation:)] + pub unsafe fn tableView_acceptDrop_row_dropOperation( + &self, + tableView: &NSTableView, + info: &NSDraggingInfo, + row: NSInteger, + dropOperation: NSTableViewDropOperation, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:)] + pub unsafe fn tableView_namesOfPromisedFilesDroppedAtDestination_forDraggedRowsWithIndexes( + &self, + tableView: &NSTableView, + dropDestination: &NSURL, + indexSet: &NSIndexSet, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSTableViewDataSourceDeprecated + unsafe impl NSObject { + #[method(tableView:writeRows:toPasteboard:)] + pub unsafe fn tableView_writeRows_toPasteboard( + &self, + tableView: &NSTableView, + rows: &NSArray, + pboard: &NSPasteboard, + ) -> bool; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSTableView { + #[method(setDrawsGrid:)] + pub unsafe fn setDrawsGrid(&self, flag: bool); + + #[method(drawsGrid)] + pub unsafe fn drawsGrid(&self) -> bool; + + #[method(selectColumn:byExtendingSelection:)] + pub unsafe fn selectColumn_byExtendingSelection(&self, column: NSInteger, extend: bool); + + #[method(selectRow:byExtendingSelection:)] + pub unsafe fn selectRow_byExtendingSelection(&self, row: NSInteger, extend: bool); + + #[method_id(@__retain_semantics Other selectedColumnEnumerator)] + pub unsafe fn selectedColumnEnumerator(&self) -> Id; + + #[method_id(@__retain_semantics Other selectedRowEnumerator)] + pub unsafe fn selectedRowEnumerator(&self) -> Id; + + #[method_id(@__retain_semantics Other dragImageForRows:event:dragImageOffset:)] + pub unsafe fn dragImageForRows_event_dragImageOffset( + &self, + dragRows: &NSArray, + dragEvent: &NSEvent, + dragImageOffset: NSPointPointer, + ) -> Option>; + + #[method(setAutoresizesAllColumnsToFit:)] + pub unsafe fn setAutoresizesAllColumnsToFit(&self, flag: bool); + + #[method(autoresizesAllColumnsToFit)] + pub unsafe fn autoresizesAllColumnsToFit(&self) -> bool; + + #[method(columnsInRect:)] + pub unsafe fn columnsInRect(&self, rect: NSRect) -> NSRange; + + #[method_id(@__retain_semantics Other preparedCellAtColumn:row:)] + pub unsafe fn preparedCellAtColumn_row( + &self, + column: NSInteger, + row: NSInteger, + ) -> Option>; + + #[method(textShouldBeginEditing:)] + pub unsafe fn textShouldBeginEditing(&self, textObject: &NSText) -> bool; + + #[method(textShouldEndEditing:)] + pub unsafe fn textShouldEndEditing(&self, textObject: &NSText) -> bool; + + #[method(textDidBeginEditing:)] + pub unsafe fn textDidBeginEditing(&self, notification: &NSNotification); + + #[method(textDidEndEditing:)] + pub unsafe fn textDidEndEditing(&self, notification: &NSNotification); + + #[method(textDidChange:)] + pub unsafe fn textDidChange(&self, notification: &NSNotification); + + #[method(shouldFocusCell:atColumn:row:)] + pub unsafe fn shouldFocusCell_atColumn_row( + &self, + cell: &NSCell, + column: NSInteger, + row: NSInteger, + ) -> bool; + + #[method(focusedColumn)] + pub unsafe fn focusedColumn(&self) -> NSInteger; + + #[method(setFocusedColumn:)] + pub unsafe fn setFocusedColumn(&self, focusedColumn: NSInteger); + + #[method(performClickOnCellAtColumn:row:)] + pub unsafe fn performClickOnCellAtColumn_row(&self, column: NSInteger, row: NSInteger); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTableViewDiffableDataSource.rs b/crates/icrate/src/generated/AppKit/NSTableViewDiffableDataSource.rs new file mode 100644 index 000000000..26302f455 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTableViewDiffableDataSource.rs @@ -0,0 +1,128 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSTableViewDiffableDataSourceCellProvider = *mut Block< + ( + NonNull, + NonNull, + NSInteger, + NonNull, + ), + NonNull, +>; + +pub type NSTableViewDiffableDataSourceRowProvider = + *mut Block<(NonNull, NSInteger, NonNull), NonNull>; + +pub type NSTableViewDiffableDataSourceSectionHeaderViewProvider = + *mut Block<(NonNull, NSInteger, NonNull), NonNull>; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSTableViewDiffableDataSource< + SectionIdentifierType: Message = Object, + ItemIdentifierType: Message = Object, + > { + _inner0: PhantomData<*mut SectionIdentifierType>, + _inner1: PhantomData<*mut ItemIdentifierType>, + } + + unsafe impl ClassType + for NSTableViewDiffableDataSource + { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl + NSTableViewDiffableDataSource + { + #[method_id(@__retain_semantics Init initWithTableView:cellProvider:)] + pub unsafe fn initWithTableView_cellProvider( + this: Option>, + tableView: &NSTableView, + cellProvider: NSTableViewDiffableDataSourceCellProvider, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Other snapshot)] + pub unsafe fn snapshot( + &self, + ) -> Id, Shared>; + + #[method(applySnapshot:animatingDifferences:)] + pub unsafe fn applySnapshot_animatingDifferences( + &self, + snapshot: &NSDiffableDataSourceSnapshot, + animatingDifferences: bool, + ); + + #[method(applySnapshot:animatingDifferences:completion:)] + pub unsafe fn applySnapshot_animatingDifferences_completion( + &self, + snapshot: &NSDiffableDataSourceSnapshot, + animatingDifferences: bool, + completion: Option<&Block<(), ()>>, + ); + + #[method_id(@__retain_semantics Other itemIdentifierForRow:)] + pub unsafe fn itemIdentifierForRow( + &self, + row: NSInteger, + ) -> Option>; + + #[method(rowForItemIdentifier:)] + pub unsafe fn rowForItemIdentifier(&self, identifier: &ItemIdentifierType) -> NSInteger; + + #[method_id(@__retain_semantics Other sectionIdentifierForRow:)] + pub unsafe fn sectionIdentifierForRow( + &self, + row: NSInteger, + ) -> Option>; + + #[method(rowForSectionIdentifier:)] + pub unsafe fn rowForSectionIdentifier( + &self, + identifier: &SectionIdentifierType, + ) -> NSInteger; + + #[method(rowViewProvider)] + pub unsafe fn rowViewProvider(&self) -> NSTableViewDiffableDataSourceRowProvider; + + #[method(setRowViewProvider:)] + pub unsafe fn setRowViewProvider( + &self, + rowViewProvider: NSTableViewDiffableDataSourceRowProvider, + ); + + #[method(sectionHeaderViewProvider)] + pub unsafe fn sectionHeaderViewProvider( + &self, + ) -> NSTableViewDiffableDataSourceSectionHeaderViewProvider; + + #[method(setSectionHeaderViewProvider:)] + pub unsafe fn setSectionHeaderViewProvider( + &self, + sectionHeaderViewProvider: NSTableViewDiffableDataSourceSectionHeaderViewProvider, + ); + + #[method(defaultRowAnimation)] + pub unsafe fn defaultRowAnimation(&self) -> NSTableViewAnimationOptions; + + #[method(setDefaultRowAnimation:)] + pub unsafe fn setDefaultRowAnimation( + &self, + defaultRowAnimation: NSTableViewAnimationOptions, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTableViewRowAction.rs b/crates/icrate/src/generated/AppKit/NSTableViewRowAction.rs new file mode 100644 index 000000000..7359d6b15 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTableViewRowAction.rs @@ -0,0 +1,55 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTableViewRowActionStyle { + NSTableViewRowActionStyleRegular = 0, + NSTableViewRowActionStyleDestructive = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTableViewRowAction; + + unsafe impl ClassType for NSTableViewRowAction { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTableViewRowAction { + #[method_id(@__retain_semantics Other rowActionWithStyle:title:handler:)] + pub unsafe fn rowActionWithStyle_title_handler( + style: NSTableViewRowActionStyle, + title: &NSString, + handler: &Block<(NonNull, NSInteger), ()>, + ) -> Id; + + #[method(style)] + pub unsafe fn style(&self) -> NSTableViewRowActionStyle; + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Id; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: Option<&NSColor>); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSText.rs b/crates/icrate/src/generated/AppKit/NSText.rs new file mode 100644 index 000000000..dd149af47 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSText.rs @@ -0,0 +1,360 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextAlignment { + NSTextAlignmentLeft = 0, + NSTextAlignmentRight = 1, + NSTextAlignmentCenter = 2, + NSTextAlignmentJustified = 3, + NSTextAlignmentNatural = 4, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSWritingDirection { + NSWritingDirectionNatural = -1, + NSWritingDirectionLeftToRight = 0, + NSWritingDirectionRightToLeft = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSText; + + unsafe impl ClassType for NSText { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSText { + #[method_id(@__retain_semantics Init initWithFrame:)] + pub unsafe fn initWithFrame( + this: Option>, + frameRect: NSRect, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other string)] + pub unsafe fn string(&self) -> Id; + + #[method(setString:)] + pub unsafe fn setString(&self, string: &NSString); + + #[method(replaceCharactersInRange:withString:)] + pub unsafe fn replaceCharactersInRange_withString(&self, range: NSRange, string: &NSString); + + #[method(replaceCharactersInRange:withRTF:)] + pub unsafe fn replaceCharactersInRange_withRTF(&self, range: NSRange, rtfData: &NSData); + + #[method(replaceCharactersInRange:withRTFD:)] + pub unsafe fn replaceCharactersInRange_withRTFD(&self, range: NSRange, rtfdData: &NSData); + + #[method_id(@__retain_semantics Other RTFFromRange:)] + pub unsafe fn RTFFromRange(&self, range: NSRange) -> Option>; + + #[method_id(@__retain_semantics Other RTFDFromRange:)] + pub unsafe fn RTFDFromRange(&self, range: NSRange) -> Option>; + + #[method(writeRTFDToFile:atomically:)] + pub unsafe fn writeRTFDToFile_atomically(&self, path: &NSString, flag: bool) -> bool; + + #[method(readRTFDFromFile:)] + pub unsafe fn readRTFDFromFile(&self, path: &NSString) -> bool; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTextDelegate>); + + #[method(isEditable)] + pub unsafe fn isEditable(&self) -> bool; + + #[method(setEditable:)] + pub unsafe fn setEditable(&self, editable: bool); + + #[method(isSelectable)] + pub unsafe fn isSelectable(&self) -> bool; + + #[method(setSelectable:)] + pub unsafe fn setSelectable(&self, selectable: bool); + + #[method(isRichText)] + pub unsafe fn isRichText(&self) -> bool; + + #[method(setRichText:)] + pub unsafe fn setRichText(&self, richText: bool); + + #[method(importsGraphics)] + pub unsafe fn importsGraphics(&self) -> bool; + + #[method(setImportsGraphics:)] + pub unsafe fn setImportsGraphics(&self, importsGraphics: bool); + + #[method(isFieldEditor)] + pub unsafe fn isFieldEditor(&self) -> bool; + + #[method(setFieldEditor:)] + pub unsafe fn setFieldEditor(&self, fieldEditor: bool); + + #[method(usesFontPanel)] + pub unsafe fn usesFontPanel(&self) -> bool; + + #[method(setUsesFontPanel:)] + pub unsafe fn setUsesFontPanel(&self, usesFontPanel: bool); + + #[method(drawsBackground)] + pub unsafe fn drawsBackground(&self) -> bool; + + #[method(setDrawsBackground:)] + pub unsafe fn setDrawsBackground(&self, drawsBackground: bool); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Option>; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: Option<&NSColor>); + + #[method(isRulerVisible)] + pub unsafe fn isRulerVisible(&self) -> bool; + + #[method(selectedRange)] + pub unsafe fn selectedRange(&self) -> NSRange; + + #[method(setSelectedRange:)] + pub unsafe fn setSelectedRange(&self, selectedRange: NSRange); + + #[method(scrollRangeToVisible:)] + pub unsafe fn scrollRangeToVisible(&self, range: NSRange); + + #[method_id(@__retain_semantics Other font)] + pub unsafe fn font(&self) -> Option>; + + #[method(setFont:)] + pub unsafe fn setFont(&self, font: Option<&NSFont>); + + #[method_id(@__retain_semantics Other textColor)] + pub unsafe fn textColor(&self) -> Option>; + + #[method(setTextColor:)] + pub unsafe fn setTextColor(&self, textColor: Option<&NSColor>); + + #[method(alignment)] + pub unsafe fn alignment(&self) -> NSTextAlignment; + + #[method(setAlignment:)] + pub unsafe fn setAlignment(&self, alignment: NSTextAlignment); + + #[method(baseWritingDirection)] + pub unsafe fn baseWritingDirection(&self) -> NSWritingDirection; + + #[method(setBaseWritingDirection:)] + pub unsafe fn setBaseWritingDirection(&self, baseWritingDirection: NSWritingDirection); + + #[method(setTextColor:range:)] + pub unsafe fn setTextColor_range(&self, color: Option<&NSColor>, range: NSRange); + + #[method(setFont:range:)] + pub unsafe fn setFont_range(&self, font: &NSFont, range: NSRange); + + #[method(maxSize)] + pub unsafe fn maxSize(&self) -> NSSize; + + #[method(setMaxSize:)] + pub unsafe fn setMaxSize(&self, maxSize: NSSize); + + #[method(minSize)] + pub unsafe fn minSize(&self) -> NSSize; + + #[method(setMinSize:)] + pub unsafe fn setMinSize(&self, minSize: NSSize); + + #[method(isHorizontallyResizable)] + pub unsafe fn isHorizontallyResizable(&self) -> bool; + + #[method(setHorizontallyResizable:)] + pub unsafe fn setHorizontallyResizable(&self, horizontallyResizable: bool); + + #[method(isVerticallyResizable)] + pub unsafe fn isVerticallyResizable(&self) -> bool; + + #[method(setVerticallyResizable:)] + pub unsafe fn setVerticallyResizable(&self, verticallyResizable: bool); + + #[method(sizeToFit)] + pub unsafe fn sizeToFit(&self); + + #[method(copy:)] + pub unsafe fn copy(&self, sender: Option<&Object>); + + #[method(copyFont:)] + pub unsafe fn copyFont(&self, sender: Option<&Object>); + + #[method(copyRuler:)] + pub unsafe fn copyRuler(&self, sender: Option<&Object>); + + #[method(cut:)] + pub unsafe fn cut(&self, sender: Option<&Object>); + + #[method(delete:)] + pub unsafe fn delete(&self, sender: Option<&Object>); + + #[method(paste:)] + pub unsafe fn paste(&self, sender: Option<&Object>); + + #[method(pasteFont:)] + pub unsafe fn pasteFont(&self, sender: Option<&Object>); + + #[method(pasteRuler:)] + pub unsafe fn pasteRuler(&self, sender: Option<&Object>); + + #[method(selectAll:)] + pub unsafe fn selectAll(&self, sender: Option<&Object>); + + #[method(changeFont:)] + pub unsafe fn changeFont(&self, sender: Option<&Object>); + + #[method(alignLeft:)] + pub unsafe fn alignLeft(&self, sender: Option<&Object>); + + #[method(alignRight:)] + pub unsafe fn alignRight(&self, sender: Option<&Object>); + + #[method(alignCenter:)] + pub unsafe fn alignCenter(&self, sender: Option<&Object>); + + #[method(subscript:)] + pub unsafe fn subscript(&self, sender: Option<&Object>); + + #[method(superscript:)] + pub unsafe fn superscript(&self, sender: Option<&Object>); + + #[method(underline:)] + pub unsafe fn underline(&self, sender: Option<&Object>); + + #[method(unscript:)] + pub unsafe fn unscript(&self, sender: Option<&Object>); + + #[method(showGuessPanel:)] + pub unsafe fn showGuessPanel(&self, sender: Option<&Object>); + + #[method(checkSpelling:)] + pub unsafe fn checkSpelling(&self, sender: Option<&Object>); + + #[method(toggleRuler:)] + pub unsafe fn toggleRuler(&self, sender: Option<&Object>); + } +); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSEnterCharacter = 0x0003, + NSBackspaceCharacter = 0x0008, + NSTabCharacter = 0x0009, + NSNewlineCharacter = 0x000a, + NSFormFeedCharacter = 0x000c, + NSCarriageReturnCharacter = 0x000d, + NSBackTabCharacter = 0x0019, + NSDeleteCharacter = 0x007f, + NSLineSeparatorCharacter = 0x2028, + NSParagraphSeparatorCharacter = 0x2029, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextMovement { + NSTextMovementReturn = 0x10, + NSTextMovementTab = 0x11, + NSTextMovementBacktab = 0x12, + NSTextMovementLeft = 0x13, + NSTextMovementRight = 0x14, + NSTextMovementUp = 0x15, + NSTextMovementDown = 0x16, + NSTextMovementCancel = 0x17, + NSTextMovementOther = 0, + } +); + +extern_static!(NSTextDidBeginEditingNotification: &'static NSNotificationName); + +extern_static!(NSTextDidEndEditingNotification: &'static NSNotificationName); + +extern_static!(NSTextDidChangeNotification: &'static NSNotificationName); + +extern_static!(NSTextMovementUserInfoKey: &'static NSString); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSIllegalTextMovement = 0, + NSReturnTextMovement = 0x10, + NSTabTextMovement = 0x11, + NSBacktabTextMovement = 0x12, + NSLeftTextMovement = 0x13, + NSRightTextMovement = 0x14, + NSUpTextMovement = 0x15, + NSDownTextMovement = 0x16, + NSCancelTextMovement = 0x17, + NSOtherTextMovement = 0, + } +); + +extern_protocol!( + pub struct NSTextDelegate; + + unsafe impl NSTextDelegate { + #[optional] + #[method(textShouldBeginEditing:)] + pub unsafe fn textShouldBeginEditing(&self, textObject: &NSText) -> bool; + + #[optional] + #[method(textShouldEndEditing:)] + pub unsafe fn textShouldEndEditing(&self, textObject: &NSText) -> bool; + + #[optional] + #[method(textDidBeginEditing:)] + pub unsafe fn textDidBeginEditing(&self, notification: &NSNotification); + + #[optional] + #[method(textDidEndEditing:)] + pub unsafe fn textDidEndEditing(&self, notification: &NSNotification); + + #[optional] + #[method(textDidChange:)] + pub unsafe fn textDidChange(&self, notification: &NSNotification); + } +); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSTextWritingDirectionEmbedding = 0<<1, + NSTextWritingDirectionOverride = 1<<1, + } +); + +extern_static!(NSLeftTextAlignment: NSTextAlignment = NSTextAlignmentLeft); + +extern_static!(NSRightTextAlignment: NSTextAlignment = NSTextAlignmentRight); + +extern_static!(NSCenterTextAlignment: NSTextAlignment = NSTextAlignmentCenter); + +extern_static!(NSJustifiedTextAlignment: NSTextAlignment = NSTextAlignmentJustified); + +extern_static!(NSNaturalTextAlignment: NSTextAlignment = NSTextAlignmentNatural); diff --git a/crates/icrate/src/generated/AppKit/NSTextAlternatives.rs b/crates/icrate/src/generated/AppKit/NSTextAlternatives.rs new file mode 100644 index 000000000..6c3a27d45 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextAlternatives.rs @@ -0,0 +1,39 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTextAlternatives; + + unsafe impl ClassType for NSTextAlternatives { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextAlternatives { + #[method_id(@__retain_semantics Init initWithPrimaryString:alternativeStrings:)] + pub unsafe fn initWithPrimaryString_alternativeStrings( + this: Option>, + primaryString: &NSString, + alternativeStrings: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other primaryString)] + pub unsafe fn primaryString(&self) -> Id; + + #[method_id(@__retain_semantics Other alternativeStrings)] + pub unsafe fn alternativeStrings(&self) -> Id, Shared>; + + #[method(noteSelectedAlternativeString:)] + pub unsafe fn noteSelectedAlternativeString(&self, alternativeString: &NSString); + } +); + +extern_static!( + NSTextAlternativesSelectedAlternativeStringNotification: &'static NSNotificationName +); diff --git a/crates/icrate/src/generated/AppKit/NSTextAttachment.rs b/crates/icrate/src/generated/AppKit/NSTextAttachment.rs new file mode 100644 index 000000000..21fdb4122 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextAttachment.rs @@ -0,0 +1,240 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSAttachmentCharacter = 0xFFFC, + } +); + +extern_protocol!( + pub struct NSTextAttachmentContainer; + + unsafe impl NSTextAttachmentContainer { + #[method_id(@__retain_semantics Other imageForBounds:textContainer:characterIndex:)] + pub unsafe fn imageForBounds_textContainer_characterIndex( + &self, + imageBounds: CGRect, + textContainer: Option<&NSTextContainer>, + charIndex: NSUInteger, + ) -> Option>; + + #[method(attachmentBoundsForTextContainer:proposedLineFragment:glyphPosition:characterIndex:)] + pub unsafe fn attachmentBoundsForTextContainer_proposedLineFragment_glyphPosition_characterIndex( + &self, + textContainer: Option<&NSTextContainer>, + lineFrag: CGRect, + position: CGPoint, + charIndex: NSUInteger, + ) -> CGRect; + } +); + +extern_protocol!( + pub struct NSTextAttachmentLayout; + + unsafe impl NSTextAttachmentLayout { + #[method_id(@__retain_semantics Other imageForBounds:attributes:location:textContainer:)] + pub unsafe fn imageForBounds_attributes_location_textContainer( + &self, + bounds: CGRect, + attributes: &NSDictionary, + location: &NSTextLocation, + textContainer: Option<&NSTextContainer>, + ) -> Option>; + + #[method(attachmentBoundsForAttributes:location:textContainer:proposedLineFragment:position:)] + pub unsafe fn attachmentBoundsForAttributes_location_textContainer_proposedLineFragment_position( + &self, + attributes: &NSDictionary, + location: &NSTextLocation, + textContainer: Option<&NSTextContainer>, + proposedLineFragment: CGRect, + position: CGPoint, + ) -> CGRect; + + #[method_id(@__retain_semantics Other viewProviderForParentView:location:textContainer:)] + pub unsafe fn viewProviderForParentView_location_textContainer( + &self, + parentView: Option<&NSView>, + location: &NSTextLocation, + textContainer: Option<&NSTextContainer>, + ) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextAttachment; + + unsafe impl ClassType for NSTextAttachment { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextAttachment { + #[method_id(@__retain_semantics Init initWithData:ofType:)] + pub unsafe fn initWithData_ofType( + this: Option>, + contentData: Option<&NSData>, + uti: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithFileWrapper:)] + pub unsafe fn initWithFileWrapper( + this: Option>, + fileWrapper: Option<&NSFileWrapper>, + ) -> Id; + + #[method_id(@__retain_semantics Other contents)] + pub unsafe fn contents(&self) -> Option>; + + #[method(setContents:)] + pub unsafe fn setContents(&self, contents: Option<&NSData>); + + #[method_id(@__retain_semantics Other fileType)] + pub unsafe fn fileType(&self) -> Option>; + + #[method(setFileType:)] + pub unsafe fn setFileType(&self, fileType: Option<&NSString>); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + + #[method(bounds)] + pub unsafe fn bounds(&self) -> CGRect; + + #[method(setBounds:)] + pub unsafe fn setBounds(&self, bounds: CGRect); + + #[method_id(@__retain_semantics Other fileWrapper)] + pub unsafe fn fileWrapper(&self) -> Option>; + + #[method(setFileWrapper:)] + pub unsafe fn setFileWrapper(&self, fileWrapper: Option<&NSFileWrapper>); + + #[method_id(@__retain_semantics Other attachmentCell)] + pub unsafe fn attachmentCell(&self) -> Option>; + + #[method(setAttachmentCell:)] + pub unsafe fn setAttachmentCell(&self, attachmentCell: Option<&NSTextAttachmentCell>); + + #[method(lineLayoutPadding)] + pub unsafe fn lineLayoutPadding(&self) -> CGFloat; + + #[method(setLineLayoutPadding:)] + pub unsafe fn setLineLayoutPadding(&self, lineLayoutPadding: CGFloat); + + #[method(textAttachmentViewProviderClassForFileType:)] + pub unsafe fn textAttachmentViewProviderClassForFileType( + fileType: &NSString, + ) -> Option<&'static Class>; + + #[method(registerTextAttachmentViewProviderClass:forFileType:)] + pub unsafe fn registerTextAttachmentViewProviderClass_forFileType( + textAttachmentViewProviderClass: &Class, + fileType: &NSString, + ); + + #[method(allowsTextAttachmentView)] + pub unsafe fn allowsTextAttachmentView(&self) -> bool; + + #[method(setAllowsTextAttachmentView:)] + pub unsafe fn setAllowsTextAttachmentView(&self, allowsTextAttachmentView: bool); + + #[method(usesTextAttachmentView)] + pub unsafe fn usesTextAttachmentView(&self) -> bool; + } +); + +extern_methods!( + /// NSAttributedStringAttachmentConveniences + unsafe impl NSAttributedString { + #[method_id(@__retain_semantics Other attributedStringWithAttachment:)] + pub unsafe fn attributedStringWithAttachment( + attachment: &NSTextAttachment, + ) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextAttachmentViewProvider; + + unsafe impl ClassType for NSTextAttachmentViewProvider { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextAttachmentViewProvider { + #[method_id(@__retain_semantics Init initWithTextAttachment:parentView:textLayoutManager:location:)] + pub unsafe fn initWithTextAttachment_parentView_textLayoutManager_location( + this: Option>, + textAttachment: &NSTextAttachment, + parentView: Option<&NSView>, + textLayoutManager: Option<&NSTextLayoutManager>, + location: &NSTextLocation, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Other textAttachment)] + pub unsafe fn textAttachment(&self) -> Option>; + + #[method_id(@__retain_semantics Other textLayoutManager)] + pub unsafe fn textLayoutManager(&self) -> Option>; + + #[method_id(@__retain_semantics Other location)] + pub unsafe fn location(&self) -> Id; + + #[method_id(@__retain_semantics Other view)] + pub unsafe fn view(&self) -> Option>; + + #[method(setView:)] + pub unsafe fn setView(&self, view: Option<&NSView>); + + #[method(loadView)] + pub unsafe fn loadView(&self); + + #[method(tracksTextAttachmentViewBounds)] + pub unsafe fn tracksTextAttachmentViewBounds(&self) -> bool; + + #[method(setTracksTextAttachmentViewBounds:)] + pub unsafe fn setTracksTextAttachmentViewBounds( + &self, + tracksTextAttachmentViewBounds: bool, + ); + + #[method(attachmentBoundsForAttributes:location:textContainer:proposedLineFragment:position:)] + pub unsafe fn attachmentBoundsForAttributes_location_textContainer_proposedLineFragment_position( + &self, + attributes: &NSDictionary, + location: &NSTextLocation, + textContainer: Option<&NSTextContainer>, + proposedLineFragment: CGRect, + position: CGPoint, + ) -> CGRect; + } +); + +extern_methods!( + /// NSMutableAttributedStringAttachmentConveniences + unsafe impl NSMutableAttributedString { + #[method(updateAttachmentsFromPath:)] + pub unsafe fn updateAttachmentsFromPath(&self, path: &NSString); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextAttachmentCell.rs b/crates/icrate/src/generated/AppKit/NSTextAttachmentCell.rs new file mode 100644 index 000000000..5802cb58a --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextAttachmentCell.rs @@ -0,0 +1,19 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTextAttachmentCell; + + unsafe impl ClassType for NSTextAttachmentCell { + type Super = NSCell; + } +); + +extern_methods!( + unsafe impl NSTextAttachmentCell {} +); diff --git a/crates/icrate/src/generated/AppKit/NSTextCheckingClient.rs b/crates/icrate/src/generated/AppKit/NSTextCheckingClient.rs new file mode 100644 index 000000000..91fe063e0 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextCheckingClient.rs @@ -0,0 +1,158 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextInputTraitType { + NSTextInputTraitTypeDefault = 0, + NSTextInputTraitTypeNo = 1, + NSTextInputTraitTypeYes = 2, + } +); + +extern_protocol!( + pub struct NSTextInputTraits; + + unsafe impl NSTextInputTraits { + #[optional] + #[method(autocorrectionType)] + pub unsafe fn autocorrectionType(&self) -> NSTextInputTraitType; + + #[optional] + #[method(setAutocorrectionType:)] + pub unsafe fn setAutocorrectionType(&self, autocorrectionType: NSTextInputTraitType); + + #[optional] + #[method(spellCheckingType)] + pub unsafe fn spellCheckingType(&self) -> NSTextInputTraitType; + + #[optional] + #[method(setSpellCheckingType:)] + pub unsafe fn setSpellCheckingType(&self, spellCheckingType: NSTextInputTraitType); + + #[optional] + #[method(grammarCheckingType)] + pub unsafe fn grammarCheckingType(&self) -> NSTextInputTraitType; + + #[optional] + #[method(setGrammarCheckingType:)] + pub unsafe fn setGrammarCheckingType(&self, grammarCheckingType: NSTextInputTraitType); + + #[optional] + #[method(smartQuotesType)] + pub unsafe fn smartQuotesType(&self) -> NSTextInputTraitType; + + #[optional] + #[method(setSmartQuotesType:)] + pub unsafe fn setSmartQuotesType(&self, smartQuotesType: NSTextInputTraitType); + + #[optional] + #[method(smartDashesType)] + pub unsafe fn smartDashesType(&self) -> NSTextInputTraitType; + + #[optional] + #[method(setSmartDashesType:)] + pub unsafe fn setSmartDashesType(&self, smartDashesType: NSTextInputTraitType); + + #[optional] + #[method(smartInsertDeleteType)] + pub unsafe fn smartInsertDeleteType(&self) -> NSTextInputTraitType; + + #[optional] + #[method(setSmartInsertDeleteType:)] + pub unsafe fn setSmartInsertDeleteType(&self, smartInsertDeleteType: NSTextInputTraitType); + + #[optional] + #[method(textReplacementType)] + pub unsafe fn textReplacementType(&self) -> NSTextInputTraitType; + + #[optional] + #[method(setTextReplacementType:)] + pub unsafe fn setTextReplacementType(&self, textReplacementType: NSTextInputTraitType); + + #[optional] + #[method(dataDetectionType)] + pub unsafe fn dataDetectionType(&self) -> NSTextInputTraitType; + + #[optional] + #[method(setDataDetectionType:)] + pub unsafe fn setDataDetectionType(&self, dataDetectionType: NSTextInputTraitType); + + #[optional] + #[method(linkDetectionType)] + pub unsafe fn linkDetectionType(&self) -> NSTextInputTraitType; + + #[optional] + #[method(setLinkDetectionType:)] + pub unsafe fn setLinkDetectionType(&self, linkDetectionType: NSTextInputTraitType); + + #[optional] + #[method(textCompletionType)] + pub unsafe fn textCompletionType(&self) -> NSTextInputTraitType; + + #[optional] + #[method(setTextCompletionType:)] + pub unsafe fn setTextCompletionType(&self, textCompletionType: NSTextInputTraitType); + } +); + +extern_protocol!( + pub struct NSTextCheckingClient; + + unsafe impl NSTextCheckingClient { + #[method_id(@__retain_semantics Other annotatedSubstringForProposedRange:actualRange:)] + pub unsafe fn annotatedSubstringForProposedRange_actualRange( + &self, + range: NSRange, + actualRange: NSRangePointer, + ) -> Option>; + + #[method(setAnnotations:range:)] + pub unsafe fn setAnnotations_range( + &self, + annotations: &NSDictionary, + range: NSRange, + ); + + #[method(addAnnotations:range:)] + pub unsafe fn addAnnotations_range( + &self, + annotations: &NSDictionary, + range: NSRange, + ); + + #[method(removeAnnotation:range:)] + pub unsafe fn removeAnnotation_range( + &self, + annotationName: &NSAttributedStringKey, + range: NSRange, + ); + + #[method(replaceCharactersInRange:withAnnotatedString:)] + pub unsafe fn replaceCharactersInRange_withAnnotatedString( + &self, + range: NSRange, + annotatedString: &NSAttributedString, + ); + + #[method(selectAndShowRange:)] + pub unsafe fn selectAndShowRange(&self, range: NSRange); + + #[method_id(@__retain_semantics Other viewForRange:firstRect:actualRange:)] + pub unsafe fn viewForRange_firstRect_actualRange( + &self, + range: NSRange, + firstRect: NSRectPointer, + actualRange: NSRangePointer, + ) -> Option>; + + #[method_id(@__retain_semantics Other candidateListTouchBarItem)] + pub unsafe fn candidateListTouchBarItem( + &self, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextCheckingController.rs b/crates/icrate/src/generated/AppKit/NSTextCheckingController.rs new file mode 100644 index 000000000..abdd84ad8 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextCheckingController.rs @@ -0,0 +1,95 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTextCheckingController; + + unsafe impl ClassType for NSTextCheckingController { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextCheckingController { + #[method_id(@__retain_semantics Init initWithClient:)] + pub unsafe fn initWithClient( + this: Option>, + client: &NSTextCheckingClient, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other client)] + pub unsafe fn client(&self) -> Id; + + #[method(invalidate)] + pub unsafe fn invalidate(&self); + + #[method(didChangeTextInRange:)] + pub unsafe fn didChangeTextInRange(&self, range: NSRange); + + #[method(insertedTextInRange:)] + pub unsafe fn insertedTextInRange(&self, range: NSRange); + + #[method(didChangeSelectedRange)] + pub unsafe fn didChangeSelectedRange(&self); + + #[method(considerTextCheckingForRange:)] + pub unsafe fn considerTextCheckingForRange(&self, range: NSRange); + + #[method(checkTextInRange:types:options:)] + pub unsafe fn checkTextInRange_types_options( + &self, + range: NSRange, + checkingTypes: NSTextCheckingTypes, + options: &NSDictionary, + ); + + #[method(checkTextInSelection:)] + pub unsafe fn checkTextInSelection(&self, sender: Option<&Object>); + + #[method(checkTextInDocument:)] + pub unsafe fn checkTextInDocument(&self, sender: Option<&Object>); + + #[method(orderFrontSubstitutionsPanel:)] + pub unsafe fn orderFrontSubstitutionsPanel(&self, sender: Option<&Object>); + + #[method(checkSpelling:)] + pub unsafe fn checkSpelling(&self, sender: Option<&Object>); + + #[method(showGuessPanel:)] + pub unsafe fn showGuessPanel(&self, sender: Option<&Object>); + + #[method(changeSpelling:)] + pub unsafe fn changeSpelling(&self, sender: Option<&Object>); + + #[method(ignoreSpelling:)] + pub unsafe fn ignoreSpelling(&self, sender: Option<&Object>); + + #[method(updateCandidates)] + pub unsafe fn updateCandidates(&self); + + #[method_id(@__retain_semantics Other validAnnotations)] + pub unsafe fn validAnnotations(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other menuAtIndex:clickedOnSelection:effectiveRange:)] + pub unsafe fn menuAtIndex_clickedOnSelection_effectiveRange( + &self, + location: NSUInteger, + clickedOnSelection: bool, + effectiveRange: NSRangePointer, + ) -> Option>; + + #[method(spellCheckerDocumentTag)] + pub unsafe fn spellCheckerDocumentTag(&self) -> NSInteger; + + #[method(setSpellCheckerDocumentTag:)] + pub unsafe fn setSpellCheckerDocumentTag(&self, spellCheckerDocumentTag: NSInteger); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextContainer.rs b/crates/icrate/src/generated/AppKit/NSTextContainer.rs new file mode 100644 index 000000000..c076f6695 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextContainer.rs @@ -0,0 +1,151 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTextContainer; + + unsafe impl ClassType for NSTextContainer { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextContainer { + #[method_id(@__retain_semantics Init initWithSize:)] + pub unsafe fn initWithSize(this: Option>, size: NSSize) + -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Other layoutManager)] + pub unsafe fn layoutManager(&self) -> Option>; + + #[method(setLayoutManager:)] + pub unsafe fn setLayoutManager(&self, layoutManager: Option<&NSLayoutManager>); + + #[method(replaceLayoutManager:)] + pub unsafe fn replaceLayoutManager(&self, newLayoutManager: &NSLayoutManager); + + #[method_id(@__retain_semantics Other textLayoutManager)] + pub unsafe fn textLayoutManager(&self) -> Option>; + + #[method(size)] + pub unsafe fn size(&self) -> NSSize; + + #[method(setSize:)] + pub unsafe fn setSize(&self, size: NSSize); + + #[method_id(@__retain_semantics Other exclusionPaths)] + pub unsafe fn exclusionPaths(&self) -> Id, Shared>; + + #[method(setExclusionPaths:)] + pub unsafe fn setExclusionPaths(&self, exclusionPaths: &NSArray); + + #[method(lineBreakMode)] + pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode; + + #[method(setLineBreakMode:)] + pub unsafe fn setLineBreakMode(&self, lineBreakMode: NSLineBreakMode); + + #[method(lineFragmentPadding)] + pub unsafe fn lineFragmentPadding(&self) -> CGFloat; + + #[method(setLineFragmentPadding:)] + pub unsafe fn setLineFragmentPadding(&self, lineFragmentPadding: CGFloat); + + #[method(maximumNumberOfLines)] + pub unsafe fn maximumNumberOfLines(&self) -> NSUInteger; + + #[method(setMaximumNumberOfLines:)] + pub unsafe fn setMaximumNumberOfLines(&self, maximumNumberOfLines: NSUInteger); + + #[method(lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect:)] + pub unsafe fn lineFragmentRectForProposedRect_atIndex_writingDirection_remainingRect( + &self, + proposedRect: NSRect, + characterIndex: NSUInteger, + baseWritingDirection: NSWritingDirection, + remainingRect: *mut NSRect, + ) -> NSRect; + + #[method(isSimpleRectangularTextContainer)] + pub unsafe fn isSimpleRectangularTextContainer(&self) -> bool; + + #[method(widthTracksTextView)] + pub unsafe fn widthTracksTextView(&self) -> bool; + + #[method(setWidthTracksTextView:)] + pub unsafe fn setWidthTracksTextView(&self, widthTracksTextView: bool); + + #[method(heightTracksTextView)] + pub unsafe fn heightTracksTextView(&self) -> bool; + + #[method(setHeightTracksTextView:)] + pub unsafe fn setHeightTracksTextView(&self, heightTracksTextView: bool); + + #[method_id(@__retain_semantics Other textView)] + pub unsafe fn textView(&self) -> Option>; + + #[method(setTextView:)] + pub unsafe fn setTextView(&self, textView: Option<&NSTextView>); + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSLineSweepDirection { + NSLineSweepLeft = 0, + NSLineSweepRight = 1, + NSLineSweepDown = 2, + NSLineSweepUp = 3, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSLineMovementDirection { + NSLineDoesntMove = 0, + NSLineMovesLeft = 1, + NSLineMovesRight = 2, + NSLineMovesDown = 3, + NSLineMovesUp = 4, + } +); + +extern_methods!( + /// NSTextContainerDeprecated + unsafe impl NSTextContainer { + #[method_id(@__retain_semantics Init initWithContainerSize:)] + pub unsafe fn initWithContainerSize( + this: Option>, + aContainerSize: NSSize, + ) -> Id; + + #[method(containerSize)] + pub unsafe fn containerSize(&self) -> NSSize; + + #[method(setContainerSize:)] + pub unsafe fn setContainerSize(&self, containerSize: NSSize); + + #[method(lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect:)] + pub unsafe fn lineFragmentRectForProposedRect_sweepDirection_movementDirection_remainingRect( + &self, + proposedRect: NSRect, + sweepDirection: NSLineSweepDirection, + movementDirection: NSLineMovementDirection, + remainingRect: NSRectPointer, + ) -> NSRect; + + #[method(containsPoint:)] + pub unsafe fn containsPoint(&self, point: NSPoint) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextContent.rs b/crates/icrate/src/generated/AppKit/NSTextContent.rs new file mode 100644 index 000000000..6bdc4bafa --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextContent.rs @@ -0,0 +1,26 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSTextContentType = NSString; + +extern_static!(NSTextContentTypeUsername: &'static NSTextContentType); + +extern_static!(NSTextContentTypePassword: &'static NSTextContentType); + +extern_static!(NSTextContentTypeOneTimeCode: &'static NSTextContentType); + +extern_protocol!( + pub struct NSTextContent; + + unsafe impl NSTextContent { + #[method_id(@__retain_semantics Other contentType)] + pub unsafe fn contentType(&self) -> Option>; + + #[method(setContentType:)] + pub unsafe fn setContentType(&self, contentType: Option<&NSTextContentType>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextContentManager.rs b/crates/icrate/src/generated/AppKit/NSTextContentManager.rs new file mode 100644 index 000000000..d9c684133 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextContentManager.rs @@ -0,0 +1,256 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTextContentManagerEnumerationOptions { + NSTextContentManagerEnumerationOptionsNone = 0, + NSTextContentManagerEnumerationOptionsReverse = 1 << 0, + } +); + +extern_protocol!( + pub struct NSTextElementProvider; + + unsafe impl NSTextElementProvider { + #[method_id(@__retain_semantics Other documentRange)] + pub unsafe fn documentRange(&self) -> Id; + + #[method_id(@__retain_semantics Other enumerateTextElementsFromLocation:options:usingBlock:)] + pub unsafe fn enumerateTextElementsFromLocation_options_usingBlock( + &self, + textLocation: Option<&NSTextLocation>, + options: NSTextContentManagerEnumerationOptions, + block: &Block<(NonNull,), Bool>, + ) -> Option>; + + #[method(replaceContentsInRange:withTextElements:)] + pub unsafe fn replaceContentsInRange_withTextElements( + &self, + range: &NSTextRange, + textElements: Option<&NSArray>, + ); + + #[method(synchronizeToBackingStore:)] + pub unsafe fn synchronizeToBackingStore( + &self, + completionHandler: Option<&Block<(*mut NSError,), ()>>, + ); + + #[optional] + #[method_id(@__retain_semantics Other locationFromLocation:withOffset:)] + pub unsafe fn locationFromLocation_withOffset( + &self, + location: &NSTextLocation, + offset: NSInteger, + ) -> Option>; + + #[optional] + #[method(offsetFromLocation:toLocation:)] + pub unsafe fn offsetFromLocation_toLocation( + &self, + from: &NSTextLocation, + to: &NSTextLocation, + ) -> NSInteger; + + #[optional] + #[method_id(@__retain_semantics Other adjustedRangeFromRange:forEditingTextSelection:)] + pub unsafe fn adjustedRangeFromRange_forEditingTextSelection( + &self, + textRange: &NSTextRange, + forEditingTextSelection: bool, + ) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextContentManager; + + unsafe impl ClassType for NSTextContentManager { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextContentManager { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTextContentManagerDelegate>); + + #[method_id(@__retain_semantics Other textLayoutManagers)] + pub unsafe fn textLayoutManagers(&self) -> Id, Shared>; + + #[method(addTextLayoutManager:)] + pub unsafe fn addTextLayoutManager(&self, textLayoutManager: &NSTextLayoutManager); + + #[method(removeTextLayoutManager:)] + pub unsafe fn removeTextLayoutManager(&self, textLayoutManager: &NSTextLayoutManager); + + #[method_id(@__retain_semantics Other primaryTextLayoutManager)] + pub unsafe fn primaryTextLayoutManager(&self) -> Option>; + + #[method(setPrimaryTextLayoutManager:)] + pub unsafe fn setPrimaryTextLayoutManager( + &self, + primaryTextLayoutManager: Option<&NSTextLayoutManager>, + ); + + #[method(synchronizeTextLayoutManagers:)] + pub unsafe fn synchronizeTextLayoutManagers( + &self, + completionHandler: Option<&Block<(*mut NSError,), ()>>, + ); + + #[method_id(@__retain_semantics Other textElementsForRange:)] + pub unsafe fn textElementsForRange( + &self, + range: &NSTextRange, + ) -> Id, Shared>; + + #[method(hasEditingTransaction)] + pub unsafe fn hasEditingTransaction(&self) -> bool; + + #[method(performEditingTransactionUsingBlock:)] + pub unsafe fn performEditingTransactionUsingBlock(&self, transaction: &Block<(), ()>); + + #[method(recordEditActionInRange:newTextRange:)] + pub unsafe fn recordEditActionInRange_newTextRange( + &self, + originalTextRange: &NSTextRange, + newTextRange: &NSTextRange, + ); + + #[method(automaticallySynchronizesTextLayoutManagers)] + pub unsafe fn automaticallySynchronizesTextLayoutManagers(&self) -> bool; + + #[method(setAutomaticallySynchronizesTextLayoutManagers:)] + pub unsafe fn setAutomaticallySynchronizesTextLayoutManagers( + &self, + automaticallySynchronizesTextLayoutManagers: bool, + ); + + #[method(automaticallySynchronizesToBackingStore)] + pub unsafe fn automaticallySynchronizesToBackingStore(&self) -> bool; + + #[method(setAutomaticallySynchronizesToBackingStore:)] + pub unsafe fn setAutomaticallySynchronizesToBackingStore( + &self, + automaticallySynchronizesToBackingStore: bool, + ); + } +); + +extern_protocol!( + pub struct NSTextContentManagerDelegate; + + unsafe impl NSTextContentManagerDelegate { + #[optional] + #[method_id(@__retain_semantics Other textContentManager:textElementAtLocation:)] + pub unsafe fn textContentManager_textElementAtLocation( + &self, + textContentManager: &NSTextContentManager, + location: &NSTextLocation, + ) -> Option>; + + #[optional] + #[method(textContentManager:shouldEnumerateTextElement:options:)] + pub unsafe fn textContentManager_shouldEnumerateTextElement_options( + &self, + textContentManager: &NSTextContentManager, + textElement: &NSTextElement, + options: NSTextContentManagerEnumerationOptions, + ) -> bool; + } +); + +extern_protocol!( + pub struct NSTextContentStorageDelegate; + + unsafe impl NSTextContentStorageDelegate { + #[optional] + #[method_id(@__retain_semantics Other textContentStorage:textParagraphWithRange:)] + pub unsafe fn textContentStorage_textParagraphWithRange( + &self, + textContentStorage: &NSTextContentStorage, + range: NSRange, + ) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextContentStorage; + + unsafe impl ClassType for NSTextContentStorage { + type Super = NSTextContentManager; + } +); + +extern_methods!( + unsafe impl NSTextContentStorage { + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTextContentStorageDelegate>); + + #[method_id(@__retain_semantics Other attributedString)] + pub unsafe fn attributedString(&self) -> Option>; + + #[method(setAttributedString:)] + pub unsafe fn setAttributedString(&self, attributedString: Option<&NSAttributedString>); + + #[method_id(@__retain_semantics Other attributedStringForTextElement:)] + pub unsafe fn attributedStringForTextElement( + &self, + textElement: &NSTextElement, + ) -> Option>; + + #[method_id(@__retain_semantics Other textElementForAttributedString:)] + pub unsafe fn textElementForAttributedString( + &self, + attributedString: &NSAttributedString, + ) -> Option>; + + #[method_id(@__retain_semantics Other locationFromLocation:withOffset:)] + pub unsafe fn locationFromLocation_withOffset( + &self, + location: &NSTextLocation, + offset: NSInteger, + ) -> Option>; + + #[method(offsetFromLocation:toLocation:)] + pub unsafe fn offsetFromLocation_toLocation( + &self, + from: &NSTextLocation, + to: &NSTextLocation, + ) -> NSInteger; + + #[method_id(@__retain_semantics Other adjustedRangeFromRange:forEditingTextSelection:)] + pub unsafe fn adjustedRangeFromRange_forEditingTextSelection( + &self, + textRange: &NSTextRange, + forEditingTextSelection: bool, + ) -> Option>; + } +); + +extern_static!( + NSTextContentStorageUnsupportedAttributeAddedNotification: &'static NSNotificationName +); diff --git a/crates/icrate/src/generated/AppKit/NSTextElement.rs b/crates/icrate/src/generated/AppKit/NSTextElement.rs new file mode 100644 index 000000000..ad8882ecc --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextElement.rs @@ -0,0 +1,68 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTextElement; + + unsafe impl ClassType for NSTextElement { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextElement { + #[method_id(@__retain_semantics Init initWithTextContentManager:)] + pub unsafe fn initWithTextContentManager( + this: Option>, + textContentManager: Option<&NSTextContentManager>, + ) -> Id; + + #[method_id(@__retain_semantics Other textContentManager)] + pub unsafe fn textContentManager(&self) -> Option>; + + #[method(setTextContentManager:)] + pub unsafe fn setTextContentManager( + &self, + textContentManager: Option<&NSTextContentManager>, + ); + + #[method_id(@__retain_semantics Other elementRange)] + pub unsafe fn elementRange(&self) -> Option>; + + #[method(setElementRange:)] + pub unsafe fn setElementRange(&self, elementRange: Option<&NSTextRange>); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextParagraph; + + unsafe impl ClassType for NSTextParagraph { + type Super = NSTextElement; + } +); + +extern_methods!( + unsafe impl NSTextParagraph { + #[method_id(@__retain_semantics Init initWithAttributedString:)] + pub unsafe fn initWithAttributedString( + this: Option>, + attributedString: Option<&NSAttributedString>, + ) -> Id; + + #[method_id(@__retain_semantics Other attributedString)] + pub unsafe fn attributedString(&self) -> Id; + + #[method_id(@__retain_semantics Other paragraphContentRange)] + pub unsafe fn paragraphContentRange(&self) -> Option>; + + #[method_id(@__retain_semantics Other paragraphSeparatorRange)] + pub unsafe fn paragraphSeparatorRange(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextField.rs b/crates/icrate/src/generated/AppKit/NSTextField.rs new file mode 100644 index 000000000..2f48f4014 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextField.rs @@ -0,0 +1,237 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTextField; + + unsafe impl ClassType for NSTextField { + type Super = NSControl; + } +); + +extern_methods!( + unsafe impl NSTextField { + #[method_id(@__retain_semantics Other placeholderString)] + pub unsafe fn placeholderString(&self) -> Option>; + + #[method(setPlaceholderString:)] + pub unsafe fn setPlaceholderString(&self, placeholderString: Option<&NSString>); + + #[method_id(@__retain_semantics Other placeholderAttributedString)] + pub unsafe fn placeholderAttributedString(&self) -> Option>; + + #[method(setPlaceholderAttributedString:)] + pub unsafe fn setPlaceholderAttributedString( + &self, + placeholderAttributedString: Option<&NSAttributedString>, + ); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Option>; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: Option<&NSColor>); + + #[method(drawsBackground)] + pub unsafe fn drawsBackground(&self) -> bool; + + #[method(setDrawsBackground:)] + pub unsafe fn setDrawsBackground(&self, drawsBackground: bool); + + #[method_id(@__retain_semantics Other textColor)] + pub unsafe fn textColor(&self) -> Option>; + + #[method(setTextColor:)] + pub unsafe fn setTextColor(&self, textColor: Option<&NSColor>); + + #[method(isBordered)] + pub unsafe fn isBordered(&self) -> bool; + + #[method(setBordered:)] + pub unsafe fn setBordered(&self, bordered: bool); + + #[method(isBezeled)] + pub unsafe fn isBezeled(&self) -> bool; + + #[method(setBezeled:)] + pub unsafe fn setBezeled(&self, bezeled: bool); + + #[method(isEditable)] + pub unsafe fn isEditable(&self) -> bool; + + #[method(setEditable:)] + pub unsafe fn setEditable(&self, editable: bool); + + #[method(isSelectable)] + pub unsafe fn isSelectable(&self) -> bool; + + #[method(setSelectable:)] + pub unsafe fn setSelectable(&self, selectable: bool); + + #[method(selectText:)] + pub unsafe fn selectText(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTextFieldDelegate>); + + #[method(textShouldBeginEditing:)] + pub unsafe fn textShouldBeginEditing(&self, textObject: &NSText) -> bool; + + #[method(textShouldEndEditing:)] + pub unsafe fn textShouldEndEditing(&self, textObject: &NSText) -> bool; + + #[method(textDidBeginEditing:)] + pub unsafe fn textDidBeginEditing(&self, notification: &NSNotification); + + #[method(textDidEndEditing:)] + pub unsafe fn textDidEndEditing(&self, notification: &NSNotification); + + #[method(textDidChange:)] + pub unsafe fn textDidChange(&self, notification: &NSNotification); + + #[method(acceptsFirstResponder)] + pub unsafe fn acceptsFirstResponder(&self) -> bool; + + #[method(bezelStyle)] + pub unsafe fn bezelStyle(&self) -> NSTextFieldBezelStyle; + + #[method(setBezelStyle:)] + pub unsafe fn setBezelStyle(&self, bezelStyle: NSTextFieldBezelStyle); + + #[method(preferredMaxLayoutWidth)] + pub unsafe fn preferredMaxLayoutWidth(&self) -> CGFloat; + + #[method(setPreferredMaxLayoutWidth:)] + pub unsafe fn setPreferredMaxLayoutWidth(&self, preferredMaxLayoutWidth: CGFloat); + + #[method(maximumNumberOfLines)] + pub unsafe fn maximumNumberOfLines(&self) -> NSInteger; + + #[method(setMaximumNumberOfLines:)] + pub unsafe fn setMaximumNumberOfLines(&self, maximumNumberOfLines: NSInteger); + + #[method(allowsDefaultTighteningForTruncation)] + pub unsafe fn allowsDefaultTighteningForTruncation(&self) -> bool; + + #[method(setAllowsDefaultTighteningForTruncation:)] + pub unsafe fn setAllowsDefaultTighteningForTruncation( + &self, + allowsDefaultTighteningForTruncation: bool, + ); + + #[method(lineBreakStrategy)] + pub unsafe fn lineBreakStrategy(&self) -> NSLineBreakStrategy; + + #[method(setLineBreakStrategy:)] + pub unsafe fn setLineBreakStrategy(&self, lineBreakStrategy: NSLineBreakStrategy); + } +); + +extern_methods!( + /// NSTouchBar + unsafe impl NSTextField { + #[method(isAutomaticTextCompletionEnabled)] + pub unsafe fn isAutomaticTextCompletionEnabled(&self) -> bool; + + #[method(setAutomaticTextCompletionEnabled:)] + pub unsafe fn setAutomaticTextCompletionEnabled( + &self, + automaticTextCompletionEnabled: bool, + ); + + #[method(allowsCharacterPickerTouchBarItem)] + pub unsafe fn allowsCharacterPickerTouchBarItem(&self) -> bool; + + #[method(setAllowsCharacterPickerTouchBarItem:)] + pub unsafe fn setAllowsCharacterPickerTouchBarItem( + &self, + allowsCharacterPickerTouchBarItem: bool, + ); + } +); + +extern_methods!( + /// NSTextFieldConvenience + unsafe impl NSTextField { + #[method_id(@__retain_semantics Other labelWithString:)] + pub unsafe fn labelWithString(stringValue: &NSString) -> Id; + + #[method_id(@__retain_semantics Other wrappingLabelWithString:)] + pub unsafe fn wrappingLabelWithString(stringValue: &NSString) -> Id; + + #[method_id(@__retain_semantics Other labelWithAttributedString:)] + pub unsafe fn labelWithAttributedString( + attributedStringValue: &NSAttributedString, + ) -> Id; + + #[method_id(@__retain_semantics Other textFieldWithString:)] + pub unsafe fn textFieldWithString(stringValue: &NSString) -> Id; + } +); + +extern_methods!( + /// NSTextFieldAttributedStringMethods + unsafe impl NSTextField { + #[method(allowsEditingTextAttributes)] + pub unsafe fn allowsEditingTextAttributes(&self) -> bool; + + #[method(setAllowsEditingTextAttributes:)] + pub unsafe fn setAllowsEditingTextAttributes(&self, allowsEditingTextAttributes: bool); + + #[method(importsGraphics)] + pub unsafe fn importsGraphics(&self) -> bool; + + #[method(setImportsGraphics:)] + pub unsafe fn setImportsGraphics(&self, importsGraphics: bool); + } +); + +extern_protocol!( + pub struct NSTextFieldDelegate; + + unsafe impl NSTextFieldDelegate { + #[optional] + #[method_id(@__retain_semantics Other textField:textView:candidatesForSelectedRange:)] + pub unsafe fn textField_textView_candidatesForSelectedRange( + &self, + textField: &NSTextField, + textView: &NSTextView, + selectedRange: NSRange, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other textField:textView:candidates:forSelectedRange:)] + pub unsafe fn textField_textView_candidates_forSelectedRange( + &self, + textField: &NSTextField, + textView: &NSTextView, + candidates: &NSArray, + selectedRange: NSRange, + ) -> Id, Shared>; + + #[optional] + #[method(textField:textView:shouldSelectCandidateAtIndex:)] + pub unsafe fn textField_textView_shouldSelectCandidateAtIndex( + &self, + textField: &NSTextField, + textView: &NSTextView, + index: NSUInteger, + ) -> bool; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSTextField { + #[method(setTitleWithMnemonic:)] + pub unsafe fn setTitleWithMnemonic(&self, stringWithAmpersand: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextFieldCell.rs b/crates/icrate/src/generated/AppKit/NSTextFieldCell.rs new file mode 100644 index 000000000..12303cb9e --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextFieldCell.rs @@ -0,0 +1,99 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTextFieldBezelStyle { + NSTextFieldSquareBezel = 0, + NSTextFieldRoundedBezel = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextFieldCell; + + unsafe impl ClassType for NSTextFieldCell { + type Super = NSActionCell; + } +); + +extern_methods!( + unsafe impl NSTextFieldCell { + #[method_id(@__retain_semantics Init initTextCell:)] + pub unsafe fn initTextCell( + this: Option>, + string: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Init initImageCell:)] + pub unsafe fn initImageCell( + this: Option>, + image: Option<&NSImage>, + ) -> Id; + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Option>; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: Option<&NSColor>); + + #[method(drawsBackground)] + pub unsafe fn drawsBackground(&self) -> bool; + + #[method(setDrawsBackground:)] + pub unsafe fn setDrawsBackground(&self, drawsBackground: bool); + + #[method_id(@__retain_semantics Other textColor)] + pub unsafe fn textColor(&self) -> Option>; + + #[method(setTextColor:)] + pub unsafe fn setTextColor(&self, textColor: Option<&NSColor>); + + #[method_id(@__retain_semantics Other setUpFieldEditorAttributes:)] + pub unsafe fn setUpFieldEditorAttributes(&self, textObj: &NSText) -> Id; + + #[method(bezelStyle)] + pub unsafe fn bezelStyle(&self) -> NSTextFieldBezelStyle; + + #[method(setBezelStyle:)] + pub unsafe fn setBezelStyle(&self, bezelStyle: NSTextFieldBezelStyle); + + #[method_id(@__retain_semantics Other placeholderString)] + pub unsafe fn placeholderString(&self) -> Option>; + + #[method(setPlaceholderString:)] + pub unsafe fn setPlaceholderString(&self, placeholderString: Option<&NSString>); + + #[method_id(@__retain_semantics Other placeholderAttributedString)] + pub unsafe fn placeholderAttributedString(&self) -> Option>; + + #[method(setPlaceholderAttributedString:)] + pub unsafe fn setPlaceholderAttributedString( + &self, + placeholderAttributedString: Option<&NSAttributedString>, + ); + + #[method(setWantsNotificationForMarkedText:)] + pub unsafe fn setWantsNotificationForMarkedText(&self, flag: bool); + + #[method_id(@__retain_semantics Other allowedInputSourceLocales)] + pub unsafe fn allowedInputSourceLocales(&self) -> Option, Shared>>; + + #[method(setAllowedInputSourceLocales:)] + pub unsafe fn setAllowedInputSourceLocales( + &self, + allowedInputSourceLocales: Option<&NSArray>, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextFinder.rs b/crates/icrate/src/generated/AppKit/NSTextFinder.rs new file mode 100644 index 000000000..f9e0b4025 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextFinder.rs @@ -0,0 +1,232 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextFinderAction { + NSTextFinderActionShowFindInterface = 1, + NSTextFinderActionNextMatch = 2, + NSTextFinderActionPreviousMatch = 3, + NSTextFinderActionReplaceAll = 4, + NSTextFinderActionReplace = 5, + NSTextFinderActionReplaceAndFind = 6, + NSTextFinderActionSetSearchString = 7, + NSTextFinderActionReplaceAllInSelection = 8, + NSTextFinderActionSelectAll = 9, + NSTextFinderActionSelectAllInSelection = 10, + NSTextFinderActionHideFindInterface = 11, + NSTextFinderActionShowReplaceInterface = 12, + NSTextFinderActionHideReplaceInterface = 13, + } +); + +pub type NSPasteboardTypeTextFinderOptionKey = NSString; + +extern_static!(NSTextFinderCaseInsensitiveKey: &'static NSPasteboardTypeTextFinderOptionKey); + +extern_static!(NSTextFinderMatchingTypeKey: &'static NSPasteboardTypeTextFinderOptionKey); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextFinderMatchingType { + NSTextFinderMatchingTypeContains = 0, + NSTextFinderMatchingTypeStartsWith = 1, + NSTextFinderMatchingTypeFullWord = 2, + NSTextFinderMatchingTypeEndsWith = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextFinder; + + unsafe impl ClassType for NSTextFinder { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextFinder { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Other client)] + pub unsafe fn client(&self) -> Option>; + + #[method(setClient:)] + pub unsafe fn setClient(&self, client: Option<&NSTextFinderClient>); + + #[method(performAction:)] + pub unsafe fn performAction(&self, op: NSTextFinderAction); + + #[method(validateAction:)] + pub unsafe fn validateAction(&self, op: NSTextFinderAction) -> bool; + + #[method_id(@__retain_semantics Other findBarContainer)] + pub unsafe fn findBarContainer(&self) -> Option>; + + #[method(setFindBarContainer:)] + pub unsafe fn setFindBarContainer( + &self, + findBarContainer: Option<&NSTextFinderBarContainer>, + ); + + #[method(cancelFindIndicator)] + pub unsafe fn cancelFindIndicator(&self); + + #[method(findIndicatorNeedsUpdate)] + pub unsafe fn findIndicatorNeedsUpdate(&self) -> bool; + + #[method(setFindIndicatorNeedsUpdate:)] + pub unsafe fn setFindIndicatorNeedsUpdate(&self, findIndicatorNeedsUpdate: bool); + + #[method(isIncrementalSearchingEnabled)] + pub unsafe fn isIncrementalSearchingEnabled(&self) -> bool; + + #[method(setIncrementalSearchingEnabled:)] + pub unsafe fn setIncrementalSearchingEnabled(&self, incrementalSearchingEnabled: bool); + + #[method(incrementalSearchingShouldDimContentView)] + pub unsafe fn incrementalSearchingShouldDimContentView(&self) -> bool; + + #[method(setIncrementalSearchingShouldDimContentView:)] + pub unsafe fn setIncrementalSearchingShouldDimContentView( + &self, + incrementalSearchingShouldDimContentView: bool, + ); + + #[method_id(@__retain_semantics Other incrementalMatchRanges)] + pub unsafe fn incrementalMatchRanges(&self) -> Id, Shared>; + + #[method(drawIncrementalMatchHighlightInRect:)] + pub unsafe fn drawIncrementalMatchHighlightInRect(rect: NSRect); + + #[method(noteClientStringWillChange)] + pub unsafe fn noteClientStringWillChange(&self); + } +); + +extern_protocol!( + pub struct NSTextFinderClient; + + unsafe impl NSTextFinderClient { + #[optional] + #[method(isSelectable)] + pub unsafe fn isSelectable(&self) -> bool; + + #[optional] + #[method(allowsMultipleSelection)] + pub unsafe fn allowsMultipleSelection(&self) -> bool; + + #[optional] + #[method(isEditable)] + pub unsafe fn isEditable(&self) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other string)] + pub unsafe fn string(&self) -> Id; + + #[optional] + #[method_id(@__retain_semantics Other stringAtIndex:effectiveRange:endsWithSearchBoundary:)] + pub unsafe fn stringAtIndex_effectiveRange_endsWithSearchBoundary( + &self, + characterIndex: NSUInteger, + outRange: NSRangePointer, + outFlag: NonNull, + ) -> Id; + + #[optional] + #[method(stringLength)] + pub unsafe fn stringLength(&self) -> NSUInteger; + + #[optional] + #[method(firstSelectedRange)] + pub unsafe fn firstSelectedRange(&self) -> NSRange; + + #[optional] + #[method_id(@__retain_semantics Other selectedRanges)] + pub unsafe fn selectedRanges(&self) -> Id, Shared>; + + #[optional] + #[method(setSelectedRanges:)] + pub unsafe fn setSelectedRanges(&self, selectedRanges: &NSArray); + + #[optional] + #[method(scrollRangeToVisible:)] + pub unsafe fn scrollRangeToVisible(&self, range: NSRange); + + #[optional] + #[method(shouldReplaceCharactersInRanges:withStrings:)] + pub unsafe fn shouldReplaceCharactersInRanges_withStrings( + &self, + ranges: &NSArray, + strings: &NSArray, + ) -> bool; + + #[optional] + #[method(replaceCharactersInRange:withString:)] + pub unsafe fn replaceCharactersInRange_withString(&self, range: NSRange, string: &NSString); + + #[optional] + #[method(didReplaceCharacters)] + pub unsafe fn didReplaceCharacters(&self); + + #[optional] + #[method_id(@__retain_semantics Other contentViewAtIndex:effectiveCharacterRange:)] + pub unsafe fn contentViewAtIndex_effectiveCharacterRange( + &self, + index: NSUInteger, + outRange: NSRangePointer, + ) -> Id; + + #[optional] + #[method_id(@__retain_semantics Other rectsForCharacterRange:)] + pub unsafe fn rectsForCharacterRange( + &self, + range: NSRange, + ) -> Option, Shared>>; + + #[optional] + #[method_id(@__retain_semantics Other visibleCharacterRanges)] + pub unsafe fn visibleCharacterRanges(&self) -> Id, Shared>; + + #[optional] + #[method(drawCharactersInRange:forContentView:)] + pub unsafe fn drawCharactersInRange_forContentView(&self, range: NSRange, view: &NSView); + } +); + +extern_protocol!( + pub struct NSTextFinderBarContainer; + + unsafe impl NSTextFinderBarContainer { + #[method_id(@__retain_semantics Other findBarView)] + pub unsafe fn findBarView(&self) -> Option>; + + #[method(setFindBarView:)] + pub unsafe fn setFindBarView(&self, findBarView: Option<&NSView>); + + #[method(isFindBarVisible)] + pub unsafe fn isFindBarVisible(&self) -> bool; + + #[method(setFindBarVisible:)] + pub unsafe fn setFindBarVisible(&self, findBarVisible: bool); + + #[method(findBarViewDidChangeHeight)] + pub unsafe fn findBarViewDidChangeHeight(&self); + + #[optional] + #[method_id(@__retain_semantics Other contentView)] + pub unsafe fn contentView(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextInputClient.rs b/crates/icrate/src/generated/AppKit/NSTextInputClient.rs new file mode 100644 index 000000000..491bf31a8 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextInputClient.rs @@ -0,0 +1,84 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSTextInputClient; + + unsafe impl NSTextInputClient { + #[method(insertText:replacementRange:)] + pub unsafe fn insertText_replacementRange( + &self, + string: &Object, + replacementRange: NSRange, + ); + + #[method(doCommandBySelector:)] + pub unsafe fn doCommandBySelector(&self, selector: Sel); + + #[method(setMarkedText:selectedRange:replacementRange:)] + pub unsafe fn setMarkedText_selectedRange_replacementRange( + &self, + string: &Object, + selectedRange: NSRange, + replacementRange: NSRange, + ); + + #[method(unmarkText)] + pub unsafe fn unmarkText(&self); + + #[method(selectedRange)] + pub unsafe fn selectedRange(&self) -> NSRange; + + #[method(markedRange)] + pub unsafe fn markedRange(&self) -> NSRange; + + #[method(hasMarkedText)] + pub unsafe fn hasMarkedText(&self) -> bool; + + #[method_id(@__retain_semantics Other attributedSubstringForProposedRange:actualRange:)] + pub unsafe fn attributedSubstringForProposedRange_actualRange( + &self, + range: NSRange, + actualRange: NSRangePointer, + ) -> Option>; + + #[method_id(@__retain_semantics Other validAttributesForMarkedText)] + pub unsafe fn validAttributesForMarkedText( + &self, + ) -> Id, Shared>; + + #[method(firstRectForCharacterRange:actualRange:)] + pub unsafe fn firstRectForCharacterRange_actualRange( + &self, + range: NSRange, + actualRange: NSRangePointer, + ) -> NSRect; + + #[method(characterIndexForPoint:)] + pub unsafe fn characterIndexForPoint(&self, point: NSPoint) -> NSUInteger; + + #[optional] + #[method_id(@__retain_semantics Other attributedString)] + pub unsafe fn attributedString(&self) -> Id; + + #[optional] + #[method(fractionOfDistanceThroughGlyphForPoint:)] + pub unsafe fn fractionOfDistanceThroughGlyphForPoint(&self, point: NSPoint) -> CGFloat; + + #[optional] + #[method(baselineDeltaForCharacterAtIndex:)] + pub unsafe fn baselineDeltaForCharacterAtIndex(&self, anIndex: NSUInteger) -> CGFloat; + + #[optional] + #[method(windowLevel)] + pub unsafe fn windowLevel(&self) -> NSInteger; + + #[optional] + #[method(drawsVerticallyForCharacterAtIndex:)] + pub unsafe fn drawsVerticallyForCharacterAtIndex(&self, charIndex: NSUInteger) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextInputContext.rs b/crates/icrate/src/generated/AppKit/NSTextInputContext.rs new file mode 100644 index 000000000..21c35a2a1 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextInputContext.rs @@ -0,0 +1,91 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSTextInputSourceIdentifier = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSTextInputContext; + + unsafe impl ClassType for NSTextInputContext { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextInputContext { + #[method_id(@__retain_semantics Other currentInputContext)] + pub unsafe fn currentInputContext() -> Option>; + + #[method_id(@__retain_semantics Init initWithClient:)] + pub unsafe fn initWithClient( + this: Option>, + client: &NSTextInputClient, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other client)] + pub unsafe fn client(&self) -> Id; + + #[method(acceptsGlyphInfo)] + pub unsafe fn acceptsGlyphInfo(&self) -> bool; + + #[method(setAcceptsGlyphInfo:)] + pub unsafe fn setAcceptsGlyphInfo(&self, acceptsGlyphInfo: bool); + + #[method_id(@__retain_semantics Other allowedInputSourceLocales)] + pub unsafe fn allowedInputSourceLocales(&self) -> Option, Shared>>; + + #[method(setAllowedInputSourceLocales:)] + pub unsafe fn setAllowedInputSourceLocales( + &self, + allowedInputSourceLocales: Option<&NSArray>, + ); + + #[method(activate)] + pub unsafe fn activate(&self); + + #[method(deactivate)] + pub unsafe fn deactivate(&self); + + #[method(handleEvent:)] + pub unsafe fn handleEvent(&self, event: &NSEvent) -> bool; + + #[method(discardMarkedText)] + pub unsafe fn discardMarkedText(&self); + + #[method(invalidateCharacterCoordinates)] + pub unsafe fn invalidateCharacterCoordinates(&self); + + #[method_id(@__retain_semantics Other keyboardInputSources)] + pub unsafe fn keyboardInputSources( + &self, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other selectedKeyboardInputSource)] + pub unsafe fn selectedKeyboardInputSource( + &self, + ) -> Option>; + + #[method(setSelectedKeyboardInputSource:)] + pub unsafe fn setSelectedKeyboardInputSource( + &self, + selectedKeyboardInputSource: Option<&NSTextInputSourceIdentifier>, + ); + + #[method_id(@__retain_semantics Other localizedNameForInputSource:)] + pub unsafe fn localizedNameForInputSource( + inputSourceIdentifier: &NSTextInputSourceIdentifier, + ) -> Option>; + } +); + +extern_static!( + NSTextInputContextKeyboardSelectionDidChangeNotification: &'static NSNotificationName +); diff --git a/crates/icrate/src/generated/AppKit/NSTextLayoutFragment.rs b/crates/icrate/src/generated/AppKit/NSTextLayoutFragment.rs new file mode 100644 index 000000000..a91bb3b0e --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextLayoutFragment.rs @@ -0,0 +1,106 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTextLayoutFragmentEnumerationOptions { + NSTextLayoutFragmentEnumerationOptionsNone = 0, + NSTextLayoutFragmentEnumerationOptionsReverse = 1 << 0, + NSTextLayoutFragmentEnumerationOptionsEstimatesSize = 1 << 1, + NSTextLayoutFragmentEnumerationOptionsEnsuresLayout = 1 << 2, + NSTextLayoutFragmentEnumerationOptionsEnsuresExtraLineFragment = 1 << 3, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTextLayoutFragmentState { + NSTextLayoutFragmentStateNone = 0, + NSTextLayoutFragmentStateEstimatedUsageBounds = 1, + NSTextLayoutFragmentStateCalculatedUsageBounds = 2, + NSTextLayoutFragmentStateLayoutAvailable = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextLayoutFragment; + + unsafe impl ClassType for NSTextLayoutFragment { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextLayoutFragment { + #[method_id(@__retain_semantics Init initWithTextElement:range:)] + pub unsafe fn initWithTextElement_range( + this: Option>, + textElement: &NSTextElement, + rangeInElement: Option<&NSTextRange>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other textLayoutManager)] + pub unsafe fn textLayoutManager(&self) -> Option>; + + #[method_id(@__retain_semantics Other textElement)] + pub unsafe fn textElement(&self) -> Option>; + + #[method_id(@__retain_semantics Other rangeInElement)] + pub unsafe fn rangeInElement(&self) -> Id; + + #[method_id(@__retain_semantics Other textLineFragments)] + pub unsafe fn textLineFragments(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other layoutQueue)] + pub unsafe fn layoutQueue(&self) -> Option>; + + #[method(setLayoutQueue:)] + pub unsafe fn setLayoutQueue(&self, layoutQueue: Option<&NSOperationQueue>); + + #[method(state)] + pub unsafe fn state(&self) -> NSTextLayoutFragmentState; + + #[method(invalidateLayout)] + pub unsafe fn invalidateLayout(&self); + + #[method(layoutFragmentFrame)] + pub unsafe fn layoutFragmentFrame(&self) -> CGRect; + + #[method(renderingSurfaceBounds)] + pub unsafe fn renderingSurfaceBounds(&self) -> CGRect; + + #[method(leadingPadding)] + pub unsafe fn leadingPadding(&self) -> CGFloat; + + #[method(trailingPadding)] + pub unsafe fn trailingPadding(&self) -> CGFloat; + + #[method(topMargin)] + pub unsafe fn topMargin(&self) -> CGFloat; + + #[method(bottomMargin)] + pub unsafe fn bottomMargin(&self) -> CGFloat; + + #[method_id(@__retain_semantics Other textAttachmentViewProviders)] + pub unsafe fn textAttachmentViewProviders( + &self, + ) -> Id, Shared>; + + #[method(frameForTextAttachmentAtLocation:)] + pub unsafe fn frameForTextAttachmentAtLocation(&self, location: &NSTextLocation) -> CGRect; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextLayoutManager.rs b/crates/icrate/src/generated/AppKit/NSTextLayoutManager.rs new file mode 100644 index 000000000..e950f50a2 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextLayoutManager.rs @@ -0,0 +1,267 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextLayoutManagerSegmentType { + NSTextLayoutManagerSegmentTypeStandard = 0, + NSTextLayoutManagerSegmentTypeSelection = 1, + NSTextLayoutManagerSegmentTypeHighlight = 2, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTextLayoutManagerSegmentOptions { + NSTextLayoutManagerSegmentOptionsNone = 0, + NSTextLayoutManagerSegmentOptionsRangeNotRequired = 1 << 0, + NSTextLayoutManagerSegmentOptionsMiddleFragmentsExcluded = 1 << 1, + NSTextLayoutManagerSegmentOptionsHeadSegmentExtended = 1 << 2, + NSTextLayoutManagerSegmentOptionsTailSegmentExtended = 1 << 3, + NSTextLayoutManagerSegmentOptionsUpstreamAffinity = 1 << 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextLayoutManager; + + unsafe impl ClassType for NSTextLayoutManager { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextLayoutManager { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTextLayoutManagerDelegate>); + + #[method(usesFontLeading)] + pub unsafe fn usesFontLeading(&self) -> bool; + + #[method(setUsesFontLeading:)] + pub unsafe fn setUsesFontLeading(&self, usesFontLeading: bool); + + #[method(limitsLayoutForSuspiciousContents)] + pub unsafe fn limitsLayoutForSuspiciousContents(&self) -> bool; + + #[method(setLimitsLayoutForSuspiciousContents:)] + pub unsafe fn setLimitsLayoutForSuspiciousContents( + &self, + limitsLayoutForSuspiciousContents: bool, + ); + + #[method(usesHyphenation)] + pub unsafe fn usesHyphenation(&self) -> bool; + + #[method(setUsesHyphenation:)] + pub unsafe fn setUsesHyphenation(&self, usesHyphenation: bool); + + #[method_id(@__retain_semantics Other textContentManager)] + pub unsafe fn textContentManager(&self) -> Option>; + + #[method(replaceTextContentManager:)] + pub unsafe fn replaceTextContentManager(&self, textContentManager: &NSTextContentManager); + + #[method_id(@__retain_semantics Other textContainer)] + pub unsafe fn textContainer(&self) -> Option>; + + #[method(setTextContainer:)] + pub unsafe fn setTextContainer(&self, textContainer: Option<&NSTextContainer>); + + #[method(usageBoundsForTextContainer)] + pub unsafe fn usageBoundsForTextContainer(&self) -> CGRect; + + #[method_id(@__retain_semantics Other textViewportLayoutController)] + pub unsafe fn textViewportLayoutController( + &self, + ) -> Id; + + #[method_id(@__retain_semantics Other layoutQueue)] + pub unsafe fn layoutQueue(&self) -> Option>; + + #[method(setLayoutQueue:)] + pub unsafe fn setLayoutQueue(&self, layoutQueue: Option<&NSOperationQueue>); + + #[method(ensureLayoutForRange:)] + pub unsafe fn ensureLayoutForRange(&self, range: &NSTextRange); + + #[method(ensureLayoutForBounds:)] + pub unsafe fn ensureLayoutForBounds(&self, bounds: CGRect); + + #[method(invalidateLayoutForRange:)] + pub unsafe fn invalidateLayoutForRange(&self, range: &NSTextRange); + + #[method_id(@__retain_semantics Other textLayoutFragmentForPosition:)] + pub unsafe fn textLayoutFragmentForPosition( + &self, + position: CGPoint, + ) -> Option>; + + #[method_id(@__retain_semantics Other textLayoutFragmentForLocation:)] + pub unsafe fn textLayoutFragmentForLocation( + &self, + location: &NSTextLocation, + ) -> Option>; + + #[method_id(@__retain_semantics Other enumerateTextLayoutFragmentsFromLocation:options:usingBlock:)] + pub unsafe fn enumerateTextLayoutFragmentsFromLocation_options_usingBlock( + &self, + location: Option<&NSTextLocation>, + options: NSTextLayoutFragmentEnumerationOptions, + block: &Block<(NonNull,), Bool>, + ) -> Option>; + + #[method_id(@__retain_semantics Other textSelections)] + pub unsafe fn textSelections(&self) -> Id, Shared>; + + #[method(setTextSelections:)] + pub unsafe fn setTextSelections(&self, textSelections: &NSArray); + + #[method_id(@__retain_semantics Other textSelectionNavigation)] + pub unsafe fn textSelectionNavigation(&self) -> Id; + + #[method(setTextSelectionNavigation:)] + pub unsafe fn setTextSelectionNavigation( + &self, + textSelectionNavigation: &NSTextSelectionNavigation, + ); + + #[method(enumerateRenderingAttributesFromLocation:reverse:usingBlock:)] + pub unsafe fn enumerateRenderingAttributesFromLocation_reverse_usingBlock( + &self, + location: &NSTextLocation, + reverse: bool, + block: &Block< + ( + NonNull, + NonNull>, + NonNull, + ), + Bool, + >, + ); + + #[method(setRenderingAttributes:forTextRange:)] + pub unsafe fn setRenderingAttributes_forTextRange( + &self, + renderingAttributes: &NSDictionary, + textRange: &NSTextRange, + ); + + #[method(addRenderingAttribute:value:forTextRange:)] + pub unsafe fn addRenderingAttribute_value_forTextRange( + &self, + renderingAttribute: &NSAttributedStringKey, + value: Option<&Object>, + textRange: &NSTextRange, + ); + + #[method(removeRenderingAttribute:forTextRange:)] + pub unsafe fn removeRenderingAttribute_forTextRange( + &self, + renderingAttribute: &NSAttributedStringKey, + textRange: &NSTextRange, + ); + + #[method(invalidateRenderingAttributesForTextRange:)] + pub unsafe fn invalidateRenderingAttributesForTextRange(&self, textRange: &NSTextRange); + + #[method(renderingAttributesValidator)] + pub unsafe fn renderingAttributesValidator( + &self, + ) -> *mut Block<(NonNull, NonNull), ()>; + + #[method(setRenderingAttributesValidator:)] + pub unsafe fn setRenderingAttributesValidator( + &self, + renderingAttributesValidator: Option< + &Block<(NonNull, NonNull), ()>, + >, + ); + + #[method_id(@__retain_semantics Other linkRenderingAttributes)] + pub unsafe fn linkRenderingAttributes( + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other renderingAttributesForLink:atLocation:)] + pub unsafe fn renderingAttributesForLink_atLocation( + &self, + link: &Object, + location: &NSTextLocation, + ) -> Id, Shared>; + + #[method(enumerateTextSegmentsInRange:type:options:usingBlock:)] + pub unsafe fn enumerateTextSegmentsInRange_type_options_usingBlock( + &self, + textRange: &NSTextRange, + type_: NSTextLayoutManagerSegmentType, + options: NSTextLayoutManagerSegmentOptions, + block: &Block<(*mut NSTextRange, CGRect, CGFloat, NonNull), Bool>, + ); + + #[method(replaceContentsInRange:withTextElements:)] + pub unsafe fn replaceContentsInRange_withTextElements( + &self, + range: &NSTextRange, + textElements: &NSArray, + ); + + #[method(replaceContentsInRange:withAttributedString:)] + pub unsafe fn replaceContentsInRange_withAttributedString( + &self, + range: &NSTextRange, + attributedString: &NSAttributedString, + ); + } +); + +extern_protocol!( + pub struct NSTextLayoutManagerDelegate; + + unsafe impl NSTextLayoutManagerDelegate { + #[optional] + #[method_id(@__retain_semantics Other textLayoutManager:textLayoutFragmentForLocation:inTextElement:)] + pub unsafe fn textLayoutManager_textLayoutFragmentForLocation_inTextElement( + &self, + textLayoutManager: &NSTextLayoutManager, + location: &NSTextLocation, + textElement: &NSTextElement, + ) -> Id; + + #[optional] + #[method(textLayoutManager:shouldBreakLineBeforeLocation:hyphenating:)] + pub unsafe fn textLayoutManager_shouldBreakLineBeforeLocation_hyphenating( + &self, + textLayoutManager: &NSTextLayoutManager, + location: &NSTextLocation, + hyphenating: bool, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other textLayoutManager:renderingAttributesForLink:atLocation:defaultAttributes:)] + pub unsafe fn textLayoutManager_renderingAttributesForLink_atLocation_defaultAttributes( + &self, + textLayoutManager: &NSTextLayoutManager, + link: &Object, + location: &NSTextLocation, + renderingAttributes: &NSDictionary, + ) -> Option, Shared>>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextLineFragment.rs b/crates/icrate/src/generated/AppKit/NSTextLineFragment.rs new file mode 100644 index 000000000..206db640a --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextLineFragment.rs @@ -0,0 +1,64 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTextLineFragment; + + unsafe impl ClassType for NSTextLineFragment { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextLineFragment { + #[method_id(@__retain_semantics Init initWithAttributedString:range:)] + pub unsafe fn initWithAttributedString_range( + this: Option>, + attributedString: &NSAttributedString, + range: NSRange, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + aDecoder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithString:attributes:range:)] + pub unsafe fn initWithString_attributes_range( + this: Option>, + string: &NSString, + attributes: &NSDictionary, + range: NSRange, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other attributedString)] + pub unsafe fn attributedString(&self) -> Id; + + #[method(characterRange)] + pub unsafe fn characterRange(&self) -> NSRange; + + #[method(typographicBounds)] + pub unsafe fn typographicBounds(&self) -> CGRect; + + #[method(glyphOrigin)] + pub unsafe fn glyphOrigin(&self) -> CGPoint; + + #[method(locationForCharacterAtIndex:)] + pub unsafe fn locationForCharacterAtIndex(&self, index: NSInteger) -> CGPoint; + + #[method(characterIndexForPoint:)] + pub unsafe fn characterIndexForPoint(&self, point: CGPoint) -> NSInteger; + + #[method(fractionOfDistanceThroughGlyphForPoint:)] + pub unsafe fn fractionOfDistanceThroughGlyphForPoint(&self, point: CGPoint) -> CGFloat; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextList.rs b/crates/icrate/src/generated/AppKit/NSTextList.rs new file mode 100644 index 000000000..0c1207cc4 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextList.rs @@ -0,0 +1,84 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSTextListMarkerFormat = NSString; + +extern_static!(NSTextListMarkerBox: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerCheck: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerCircle: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerDiamond: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerDisc: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerHyphen: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerSquare: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerLowercaseHexadecimal: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerUppercaseHexadecimal: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerOctal: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerLowercaseAlpha: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerUppercaseAlpha: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerLowercaseLatin: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerUppercaseLatin: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerLowercaseRoman: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerUppercaseRoman: &'static NSTextListMarkerFormat); + +extern_static!(NSTextListMarkerDecimal: &'static NSTextListMarkerFormat); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTextListOptions { + NSTextListPrependEnclosingMarker = 1 << 0, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextList; + + unsafe impl ClassType for NSTextList { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextList { + #[method_id(@__retain_semantics Init initWithMarkerFormat:options:)] + pub unsafe fn initWithMarkerFormat_options( + this: Option>, + format: &NSTextListMarkerFormat, + mask: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other markerFormat)] + pub unsafe fn markerFormat(&self) -> Id; + + #[method(listOptions)] + pub unsafe fn listOptions(&self) -> NSTextListOptions; + + #[method_id(@__retain_semantics Other markerForItemNumber:)] + pub unsafe fn markerForItemNumber(&self, itemNum: NSInteger) -> Id; + + #[method(startingItemNumber)] + pub unsafe fn startingItemNumber(&self) -> NSInteger; + + #[method(setStartingItemNumber:)] + pub unsafe fn setStartingItemNumber(&self, startingItemNumber: NSInteger); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextRange.rs b/crates/icrate/src/generated/AppKit/NSTextRange.rs new file mode 100644 index 000000000..f01615ef7 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextRange.rs @@ -0,0 +1,80 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSTextLocation; + + unsafe impl NSTextLocation { + #[method(compare:)] + pub unsafe fn compare(&self, location: &NSTextLocation) -> NSComparisonResult; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextRange; + + unsafe impl ClassType for NSTextRange { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextRange { + #[method_id(@__retain_semantics Init initWithLocation:endLocation:)] + pub unsafe fn initWithLocation_endLocation( + this: Option>, + location: &NSTextLocation, + endLocation: Option<&NSTextLocation>, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithLocation:)] + pub unsafe fn initWithLocation( + this: Option>, + location: &NSTextLocation, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method(isEmpty)] + pub unsafe fn isEmpty(&self) -> bool; + + #[method_id(@__retain_semantics Other location)] + pub unsafe fn location(&self) -> Id; + + #[method_id(@__retain_semantics Other endLocation)] + pub unsafe fn endLocation(&self) -> Id; + + #[method(isEqualToTextRange:)] + pub unsafe fn isEqualToTextRange(&self, textRange: &NSTextRange) -> bool; + + #[method(containsLocation:)] + pub unsafe fn containsLocation(&self, location: &NSTextLocation) -> bool; + + #[method(containsRange:)] + pub unsafe fn containsRange(&self, textRange: &NSTextRange) -> bool; + + #[method(intersectsWithTextRange:)] + pub unsafe fn intersectsWithTextRange(&self, textRange: &NSTextRange) -> bool; + + #[method_id(@__retain_semantics Other textRangeByIntersectingWithTextRange:)] + pub unsafe fn textRangeByIntersectingWithTextRange( + &self, + textRange: &NSTextRange, + ) -> Option>; + + #[method_id(@__retain_semantics Other textRangeByFormingUnionWithTextRange:)] + pub unsafe fn textRangeByFormingUnionWithTextRange( + &self, + textRange: &NSTextRange, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextSelection.rs b/crates/icrate/src/generated/AppKit/NSTextSelection.rs new file mode 100644 index 000000000..f9e9e90f0 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextSelection.rs @@ -0,0 +1,120 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextSelectionGranularity { + NSTextSelectionGranularityCharacter = 0, + NSTextSelectionGranularityWord = 1, + NSTextSelectionGranularityParagraph = 2, + NSTextSelectionGranularityLine = 3, + NSTextSelectionGranularitySentence = 4, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextSelectionAffinity { + NSTextSelectionAffinityUpstream = 0, + NSTextSelectionAffinityDownstream = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextSelection; + + unsafe impl ClassType for NSTextSelection { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextSelection { + #[method_id(@__retain_semantics Init initWithRanges:affinity:granularity:)] + pub unsafe fn initWithRanges_affinity_granularity( + this: Option>, + textRanges: &NSArray, + affinity: NSTextSelectionAffinity, + granularity: NSTextSelectionGranularity, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithRange:affinity:granularity:)] + pub unsafe fn initWithRange_affinity_granularity( + this: Option>, + range: &NSTextRange, + affinity: NSTextSelectionAffinity, + granularity: NSTextSelectionGranularity, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithLocation:affinity:)] + pub unsafe fn initWithLocation_affinity( + this: Option>, + location: &NSTextLocation, + affinity: NSTextSelectionAffinity, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other textRanges)] + pub unsafe fn textRanges(&self) -> Id, Shared>; + + #[method(granularity)] + pub unsafe fn granularity(&self) -> NSTextSelectionGranularity; + + #[method(affinity)] + pub unsafe fn affinity(&self) -> NSTextSelectionAffinity; + + #[method(isTransient)] + pub unsafe fn isTransient(&self) -> bool; + + #[method(anchorPositionOffset)] + pub unsafe fn anchorPositionOffset(&self) -> CGFloat; + + #[method(setAnchorPositionOffset:)] + pub unsafe fn setAnchorPositionOffset(&self, anchorPositionOffset: CGFloat); + + #[method(isLogical)] + pub unsafe fn isLogical(&self) -> bool; + + #[method(setLogical:)] + pub unsafe fn setLogical(&self, logical: bool); + + #[method_id(@__retain_semantics Other secondarySelectionLocation)] + pub unsafe fn secondarySelectionLocation(&self) -> Option>; + + #[method(setSecondarySelectionLocation:)] + pub unsafe fn setSecondarySelectionLocation( + &self, + secondarySelectionLocation: Option<&NSTextLocation>, + ); + + #[method_id(@__retain_semantics Other typingAttributes)] + pub unsafe fn typingAttributes( + &self, + ) -> Id, Shared>; + + #[method(setTypingAttributes:)] + pub unsafe fn setTypingAttributes( + &self, + typingAttributes: &NSDictionary, + ); + + #[method_id(@__retain_semantics Other textSelectionWithTextRanges:)] + pub unsafe fn textSelectionWithTextRanges( + &self, + textRanges: &NSArray, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextSelectionNavigation.rs b/crates/icrate/src/generated/AppKit/NSTextSelectionNavigation.rs new file mode 100644 index 000000000..aa0934004 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextSelectionNavigation.rs @@ -0,0 +1,238 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextSelectionNavigationDirection { + NSTextSelectionNavigationDirectionForward = 0, + NSTextSelectionNavigationDirectionBackward = 1, + NSTextSelectionNavigationDirectionRight = 2, + NSTextSelectionNavigationDirectionLeft = 3, + NSTextSelectionNavigationDirectionUp = 4, + NSTextSelectionNavigationDirectionDown = 5, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextSelectionNavigationDestination { + NSTextSelectionNavigationDestinationCharacter = 0, + NSTextSelectionNavigationDestinationWord = 1, + NSTextSelectionNavigationDestinationLine = 2, + NSTextSelectionNavigationDestinationSentence = 3, + NSTextSelectionNavigationDestinationParagraph = 4, + NSTextSelectionNavigationDestinationContainer = 5, + NSTextSelectionNavigationDestinationDocument = 6, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTextSelectionNavigationModifier { + NSTextSelectionNavigationModifierExtend = 1 << 0, + NSTextSelectionNavigationModifierVisual = 1 << 1, + NSTextSelectionNavigationModifierMultiple = 1 << 2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextSelectionNavigationWritingDirection { + NSTextSelectionNavigationWritingDirectionLeftToRight = 0, + NSTextSelectionNavigationWritingDirectionRightToLeft = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextSelectionNavigationLayoutOrientation { + NSTextSelectionNavigationLayoutOrientationHorizontal = 0, + NSTextSelectionNavigationLayoutOrientationVertical = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextSelectionNavigation; + + unsafe impl ClassType for NSTextSelectionNavigation { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextSelectionNavigation { + #[method_id(@__retain_semantics Init initWithDataSource:)] + pub unsafe fn initWithDataSource( + this: Option>, + dataSource: &NSTextSelectionDataSource, + ) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other textSelectionDataSource)] + pub unsafe fn textSelectionDataSource( + &self, + ) -> Option>; + + #[method(allowsNonContiguousRanges)] + pub unsafe fn allowsNonContiguousRanges(&self) -> bool; + + #[method(setAllowsNonContiguousRanges:)] + pub unsafe fn setAllowsNonContiguousRanges(&self, allowsNonContiguousRanges: bool); + + #[method(rotatesCoordinateSystemForLayoutOrientation)] + pub unsafe fn rotatesCoordinateSystemForLayoutOrientation(&self) -> bool; + + #[method(setRotatesCoordinateSystemForLayoutOrientation:)] + pub unsafe fn setRotatesCoordinateSystemForLayoutOrientation( + &self, + rotatesCoordinateSystemForLayoutOrientation: bool, + ); + + #[method(flushLayoutCache)] + pub unsafe fn flushLayoutCache(&self); + + #[method_id(@__retain_semantics Other destinationSelectionForTextSelection:direction:destination:extending:confined:)] + pub unsafe fn destinationSelectionForTextSelection_direction_destination_extending_confined( + &self, + textSelection: &NSTextSelection, + direction: NSTextSelectionNavigationDirection, + destination: NSTextSelectionNavigationDestination, + extending: bool, + confined: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other textSelectionsInteractingAtPoint:inContainerAtLocation:anchors:modifiers:selecting:bounds:)] + pub unsafe fn textSelectionsInteractingAtPoint_inContainerAtLocation_anchors_modifiers_selecting_bounds( + &self, + point: CGPoint, + containerLocation: &NSTextLocation, + anchors: &NSArray, + modifiers: NSTextSelectionNavigationModifier, + selecting: bool, + bounds: CGRect, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other textSelectionForSelectionGranularity:enclosingTextSelection:)] + pub unsafe fn textSelectionForSelectionGranularity_enclosingTextSelection( + &self, + selectionGranularity: NSTextSelectionGranularity, + textSelection: &NSTextSelection, + ) -> Id; + + #[method_id(@__retain_semantics Other textSelectionForSelectionGranularity:enclosingPoint:inContainerAtLocation:)] + pub unsafe fn textSelectionForSelectionGranularity_enclosingPoint_inContainerAtLocation( + &self, + selectionGranularity: NSTextSelectionGranularity, + point: CGPoint, + location: &NSTextLocation, + ) -> Option>; + + #[method_id(@__retain_semantics Other resolvedInsertionLocationForTextSelection:writingDirection:)] + pub unsafe fn resolvedInsertionLocationForTextSelection_writingDirection( + &self, + textSelection: &NSTextSelection, + writingDirection: NSTextSelectionNavigationWritingDirection, + ) -> Option>; + + #[method_id(@__retain_semantics Other deletionRangesForTextSelection:direction:destination:allowsDecomposition:)] + pub unsafe fn deletionRangesForTextSelection_direction_destination_allowsDecomposition( + &self, + textSelection: &NSTextSelection, + direction: NSTextSelectionNavigationDirection, + destination: NSTextSelectionNavigationDestination, + allowsDecomposition: bool, + ) -> Id, Shared>; + } +); + +extern_protocol!( + pub struct NSTextSelectionDataSource; + + unsafe impl NSTextSelectionDataSource { + #[method_id(@__retain_semantics Other documentRange)] + pub unsafe fn documentRange(&self) -> Id; + + #[method(enumerateSubstringsFromLocation:options:usingBlock:)] + pub unsafe fn enumerateSubstringsFromLocation_options_usingBlock( + &self, + location: &NSTextLocation, + options: NSStringEnumerationOptions, + block: &Block< + ( + *mut NSString, + NonNull, + *mut NSTextRange, + NonNull, + ), + (), + >, + ); + + #[method_id(@__retain_semantics Other textRangeForSelectionGranularity:enclosingLocation:)] + pub unsafe fn textRangeForSelectionGranularity_enclosingLocation( + &self, + selectionGranularity: NSTextSelectionGranularity, + location: &NSTextLocation, + ) -> Option>; + + #[method_id(@__retain_semantics Other locationFromLocation:withOffset:)] + pub unsafe fn locationFromLocation_withOffset( + &self, + location: &NSTextLocation, + offset: NSInteger, + ) -> Option>; + + #[method(offsetFromLocation:toLocation:)] + pub unsafe fn offsetFromLocation_toLocation( + &self, + from: &NSTextLocation, + to: &NSTextLocation, + ) -> NSInteger; + + #[method(baseWritingDirectionAtLocation:)] + pub unsafe fn baseWritingDirectionAtLocation( + &self, + location: &NSTextLocation, + ) -> NSTextSelectionNavigationWritingDirection; + + #[method(enumerateCaretOffsetsInLineFragmentAtLocation:usingBlock:)] + pub unsafe fn enumerateCaretOffsetsInLineFragmentAtLocation_usingBlock( + &self, + location: &NSTextLocation, + block: &Block<(CGFloat, NonNull, Bool, NonNull), ()>, + ); + + #[method_id(@__retain_semantics Other lineFragmentRangeForPoint:inContainerAtLocation:)] + pub unsafe fn lineFragmentRangeForPoint_inContainerAtLocation( + &self, + point: CGPoint, + location: &NSTextLocation, + ) -> Option>; + + #[optional] + #[method(enumerateContainerBoundariesFromLocation:reverse:usingBlock:)] + pub unsafe fn enumerateContainerBoundariesFromLocation_reverse_usingBlock( + &self, + location: &NSTextLocation, + reverse: bool, + block: &Block<(NonNull, NonNull), ()>, + ); + + #[optional] + #[method(textLayoutOrientationAtLocation:)] + pub unsafe fn textLayoutOrientationAtLocation( + &self, + location: &NSTextLocation, + ) -> NSTextSelectionNavigationLayoutOrientation; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextStorage.rs b/crates/icrate/src/generated/AppKit/NSTextStorage.rs new file mode 100644 index 000000000..b7f65ebee --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextStorage.rs @@ -0,0 +1,152 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTextStorageEditActions { + NSTextStorageEditedAttributes = 1 << 0, + NSTextStorageEditedCharacters = 1 << 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextStorage; + + unsafe impl ClassType for NSTextStorage { + type Super = NSMutableAttributedString; + } +); + +extern_methods!( + unsafe impl NSTextStorage { + #[method_id(@__retain_semantics Other layoutManagers)] + pub unsafe fn layoutManagers(&self) -> Id, Shared>; + + #[method(addLayoutManager:)] + pub unsafe fn addLayoutManager(&self, aLayoutManager: &NSLayoutManager); + + #[method(removeLayoutManager:)] + pub unsafe fn removeLayoutManager(&self, aLayoutManager: &NSLayoutManager); + + #[method(editedMask)] + pub unsafe fn editedMask(&self) -> NSTextStorageEditActions; + + #[method(editedRange)] + pub unsafe fn editedRange(&self) -> NSRange; + + #[method(changeInLength)] + pub unsafe fn changeInLength(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTextStorageDelegate>); + + #[method(edited:range:changeInLength:)] + pub unsafe fn edited_range_changeInLength( + &self, + editedMask: NSTextStorageEditActions, + editedRange: NSRange, + delta: NSInteger, + ); + + #[method(processEditing)] + pub unsafe fn processEditing(&self); + + #[method(fixesAttributesLazily)] + pub unsafe fn fixesAttributesLazily(&self) -> bool; + + #[method(invalidateAttributesInRange:)] + pub unsafe fn invalidateAttributesInRange(&self, range: NSRange); + + #[method(ensureAttributesAreFixedInRange:)] + pub unsafe fn ensureAttributesAreFixedInRange(&self, range: NSRange); + + #[method_id(@__retain_semantics Other textStorageObserver)] + pub unsafe fn textStorageObserver(&self) -> Option>; + + #[method(setTextStorageObserver:)] + pub unsafe fn setTextStorageObserver( + &self, + textStorageObserver: Option<&NSTextStorageObserving>, + ); + } +); + +extern_protocol!( + pub struct NSTextStorageDelegate; + + unsafe impl NSTextStorageDelegate { + #[optional] + #[method(textStorage:willProcessEditing:range:changeInLength:)] + pub unsafe fn textStorage_willProcessEditing_range_changeInLength( + &self, + textStorage: &NSTextStorage, + editedMask: NSTextStorageEditActions, + editedRange: NSRange, + delta: NSInteger, + ); + + #[optional] + #[method(textStorage:didProcessEditing:range:changeInLength:)] + pub unsafe fn textStorage_didProcessEditing_range_changeInLength( + &self, + textStorage: &NSTextStorage, + editedMask: NSTextStorageEditActions, + editedRange: NSRange, + delta: NSInteger, + ); + } +); + +extern_static!(NSTextStorageWillProcessEditingNotification: &'static NSNotificationName); + +extern_static!(NSTextStorageDidProcessEditingNotification: &'static NSNotificationName); + +extern_protocol!( + pub struct NSTextStorageObserving; + + unsafe impl NSTextStorageObserving { + #[method_id(@__retain_semantics Other textStorage)] + pub unsafe fn textStorage(&self) -> Option>; + + #[method(setTextStorage:)] + pub unsafe fn setTextStorage(&self, textStorage: Option<&NSTextStorage>); + + #[method(processEditingForTextStorage:edited:range:changeInLength:invalidatedRange:)] + pub unsafe fn processEditingForTextStorage_edited_range_changeInLength_invalidatedRange( + &self, + textStorage: &NSTextStorage, + editMask: NSTextStorageEditActions, + newCharRange: NSRange, + delta: NSInteger, + invalidatedCharRange: NSRange, + ); + + #[method(performEditingTransactionForTextStorage:usingBlock:)] + pub unsafe fn performEditingTransactionForTextStorage_usingBlock( + &self, + textStorage: &NSTextStorage, + transaction: &Block<(), ()>, + ); + } +); + +pub type NSTextStorageEditedOptions = NSUInteger; + +extern_methods!( + /// NSDeprecatedTextStorageDelegateInterface + unsafe impl NSObject { + #[method(textStorageWillProcessEditing:)] + pub unsafe fn textStorageWillProcessEditing(&self, notification: &NSNotification); + + #[method(textStorageDidProcessEditing:)] + pub unsafe fn textStorageDidProcessEditing(&self, notification: &NSNotification); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextStorageScripting.rs b/crates/icrate/src/generated/AppKit/NSTextStorageScripting.rs new file mode 100644 index 000000000..4ae0ad6cb --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextStorageScripting.rs @@ -0,0 +1,47 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_methods!( + /// Scripting + unsafe impl NSTextStorage { + #[method_id(@__retain_semantics Other attributeRuns)] + pub unsafe fn attributeRuns(&self) -> Id, Shared>; + + #[method(setAttributeRuns:)] + pub unsafe fn setAttributeRuns(&self, attributeRuns: &NSArray); + + #[method_id(@__retain_semantics Other paragraphs)] + pub unsafe fn paragraphs(&self) -> Id, Shared>; + + #[method(setParagraphs:)] + pub unsafe fn setParagraphs(&self, paragraphs: &NSArray); + + #[method_id(@__retain_semantics Other words)] + pub unsafe fn words(&self) -> Id, Shared>; + + #[method(setWords:)] + pub unsafe fn setWords(&self, words: &NSArray); + + #[method_id(@__retain_semantics Other characters)] + pub unsafe fn characters(&self) -> Id, Shared>; + + #[method(setCharacters:)] + pub unsafe fn setCharacters(&self, characters: &NSArray); + + #[method_id(@__retain_semantics Other font)] + pub unsafe fn font(&self) -> Option>; + + #[method(setFont:)] + pub unsafe fn setFont(&self, font: Option<&NSFont>); + + #[method_id(@__retain_semantics Other foregroundColor)] + pub unsafe fn foregroundColor(&self) -> Option>; + + #[method(setForegroundColor:)] + pub unsafe fn setForegroundColor(&self, foregroundColor: Option<&NSColor>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextTable.rs b/crates/icrate/src/generated/AppKit/NSTextTable.rs new file mode 100644 index 000000000..560fed7af --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextTable.rs @@ -0,0 +1,279 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTextBlockValueType { + NSTextBlockAbsoluteValueType = 0, + NSTextBlockPercentageValueType = 1, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTextBlockDimension { + NSTextBlockWidth = 0, + NSTextBlockMinimumWidth = 1, + NSTextBlockMaximumWidth = 2, + NSTextBlockHeight = 4, + NSTextBlockMinimumHeight = 5, + NSTextBlockMaximumHeight = 6, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTextBlockLayer { + NSTextBlockPadding = -1, + NSTextBlockBorder = 0, + NSTextBlockMargin = 1, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTextBlockVerticalAlignment { + NSTextBlockTopAlignment = 0, + NSTextBlockMiddleAlignment = 1, + NSTextBlockBottomAlignment = 2, + NSTextBlockBaselineAlignment = 3, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTextTableLayoutAlgorithm { + NSTextTableAutomaticLayoutAlgorithm = 0, + NSTextTableFixedLayoutAlgorithm = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextBlock; + + unsafe impl ClassType for NSTextBlock { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextBlock { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(setValue:type:forDimension:)] + pub unsafe fn setValue_type_forDimension( + &self, + val: CGFloat, + type_: NSTextBlockValueType, + dimension: NSTextBlockDimension, + ); + + #[method(valueForDimension:)] + pub unsafe fn valueForDimension(&self, dimension: NSTextBlockDimension) -> CGFloat; + + #[method(valueTypeForDimension:)] + pub unsafe fn valueTypeForDimension( + &self, + dimension: NSTextBlockDimension, + ) -> NSTextBlockValueType; + + #[method(setContentWidth:type:)] + pub unsafe fn setContentWidth_type(&self, val: CGFloat, type_: NSTextBlockValueType); + + #[method(contentWidth)] + pub unsafe fn contentWidth(&self) -> CGFloat; + + #[method(contentWidthValueType)] + pub unsafe fn contentWidthValueType(&self) -> NSTextBlockValueType; + + #[method(setWidth:type:forLayer:edge:)] + pub unsafe fn setWidth_type_forLayer_edge( + &self, + val: CGFloat, + type_: NSTextBlockValueType, + layer: NSTextBlockLayer, + edge: NSRectEdge, + ); + + #[method(setWidth:type:forLayer:)] + pub unsafe fn setWidth_type_forLayer( + &self, + val: CGFloat, + type_: NSTextBlockValueType, + layer: NSTextBlockLayer, + ); + + #[method(widthForLayer:edge:)] + pub unsafe fn widthForLayer_edge( + &self, + layer: NSTextBlockLayer, + edge: NSRectEdge, + ) -> CGFloat; + + #[method(widthValueTypeForLayer:edge:)] + pub unsafe fn widthValueTypeForLayer_edge( + &self, + layer: NSTextBlockLayer, + edge: NSRectEdge, + ) -> NSTextBlockValueType; + + #[method(verticalAlignment)] + pub unsafe fn verticalAlignment(&self) -> NSTextBlockVerticalAlignment; + + #[method(setVerticalAlignment:)] + pub unsafe fn setVerticalAlignment(&self, verticalAlignment: NSTextBlockVerticalAlignment); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Option>; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: Option<&NSColor>); + + #[method(setBorderColor:forEdge:)] + pub unsafe fn setBorderColor_forEdge(&self, color: Option<&NSColor>, edge: NSRectEdge); + + #[method(setBorderColor:)] + pub unsafe fn setBorderColor(&self, color: Option<&NSColor>); + + #[method_id(@__retain_semantics Other borderColorForEdge:)] + pub unsafe fn borderColorForEdge(&self, edge: NSRectEdge) -> Option>; + + #[method(rectForLayoutAtPoint:inRect:textContainer:characterRange:)] + pub unsafe fn rectForLayoutAtPoint_inRect_textContainer_characterRange( + &self, + startingPoint: NSPoint, + rect: NSRect, + textContainer: &NSTextContainer, + charRange: NSRange, + ) -> NSRect; + + #[method(boundsRectForContentRect:inRect:textContainer:characterRange:)] + pub unsafe fn boundsRectForContentRect_inRect_textContainer_characterRange( + &self, + contentRect: NSRect, + rect: NSRect, + textContainer: &NSTextContainer, + charRange: NSRange, + ) -> NSRect; + + #[method(drawBackgroundWithFrame:inView:characterRange:layoutManager:)] + pub unsafe fn drawBackgroundWithFrame_inView_characterRange_layoutManager( + &self, + frameRect: NSRect, + controlView: &NSView, + charRange: NSRange, + layoutManager: &NSLayoutManager, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextTableBlock; + + unsafe impl ClassType for NSTextTableBlock { + type Super = NSTextBlock; + } +); + +extern_methods!( + unsafe impl NSTextTableBlock { + #[method_id(@__retain_semantics Init initWithTable:startingRow:rowSpan:startingColumn:columnSpan:)] + pub unsafe fn initWithTable_startingRow_rowSpan_startingColumn_columnSpan( + this: Option>, + table: &NSTextTable, + row: NSInteger, + rowSpan: NSInteger, + col: NSInteger, + colSpan: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other table)] + pub unsafe fn table(&self) -> Id; + + #[method(startingRow)] + pub unsafe fn startingRow(&self) -> NSInteger; + + #[method(rowSpan)] + pub unsafe fn rowSpan(&self) -> NSInteger; + + #[method(startingColumn)] + pub unsafe fn startingColumn(&self) -> NSInteger; + + #[method(columnSpan)] + pub unsafe fn columnSpan(&self) -> NSInteger; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextTable; + + unsafe impl ClassType for NSTextTable { + type Super = NSTextBlock; + } +); + +extern_methods!( + unsafe impl NSTextTable { + #[method(numberOfColumns)] + pub unsafe fn numberOfColumns(&self) -> NSUInteger; + + #[method(setNumberOfColumns:)] + pub unsafe fn setNumberOfColumns(&self, numberOfColumns: NSUInteger); + + #[method(layoutAlgorithm)] + pub unsafe fn layoutAlgorithm(&self) -> NSTextTableLayoutAlgorithm; + + #[method(setLayoutAlgorithm:)] + pub unsafe fn setLayoutAlgorithm(&self, layoutAlgorithm: NSTextTableLayoutAlgorithm); + + #[method(collapsesBorders)] + pub unsafe fn collapsesBorders(&self) -> bool; + + #[method(setCollapsesBorders:)] + pub unsafe fn setCollapsesBorders(&self, collapsesBorders: bool); + + #[method(hidesEmptyCells)] + pub unsafe fn hidesEmptyCells(&self) -> bool; + + #[method(setHidesEmptyCells:)] + pub unsafe fn setHidesEmptyCells(&self, hidesEmptyCells: bool); + + #[method(rectForBlock:layoutAtPoint:inRect:textContainer:characterRange:)] + pub unsafe fn rectForBlock_layoutAtPoint_inRect_textContainer_characterRange( + &self, + block: &NSTextTableBlock, + startingPoint: NSPoint, + rect: NSRect, + textContainer: &NSTextContainer, + charRange: NSRange, + ) -> NSRect; + + #[method(boundsRectForBlock:contentRect:inRect:textContainer:characterRange:)] + pub unsafe fn boundsRectForBlock_contentRect_inRect_textContainer_characterRange( + &self, + block: &NSTextTableBlock, + contentRect: NSRect, + rect: NSRect, + textContainer: &NSTextContainer, + charRange: NSRange, + ) -> NSRect; + + #[method(drawBackgroundForBlock:withFrame:inView:characterRange:layoutManager:)] + pub unsafe fn drawBackgroundForBlock_withFrame_inView_characterRange_layoutManager( + &self, + block: &NSTextTableBlock, + frameRect: NSRect, + controlView: &NSView, + charRange: NSRange, + layoutManager: &NSLayoutManager, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextView.rs b/crates/icrate/src/generated/AppKit/NSTextView.rs new file mode 100644 index 000000000..b043fe6a5 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextView.rs @@ -0,0 +1,1288 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSSelectionGranularity { + NSSelectByCharacter = 0, + NSSelectByWord = 1, + NSSelectByParagraph = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSSelectionAffinity { + NSSelectionAffinityUpstream = 0, + NSSelectionAffinityDownstream = 1, + } +); + +extern_static!(NSAllRomanInputSourcesLocaleIdentifier: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSTextView; + + unsafe impl ClassType for NSTextView { + type Super = NSText; + } +); + +extern_methods!( + unsafe impl NSTextView { + #[method_id(@__retain_semantics Init initWithFrame:textContainer:)] + pub unsafe fn initWithFrame_textContainer( + this: Option>, + frameRect: NSRect, + container: Option<&NSTextContainer>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithFrame:)] + pub unsafe fn initWithFrame( + this: Option>, + frameRect: NSRect, + ) -> Id; + + #[method_id(@__retain_semantics Other textContainer)] + pub unsafe fn textContainer(&self) -> Option>; + + #[method(setTextContainer:)] + pub unsafe fn setTextContainer(&self, textContainer: Option<&NSTextContainer>); + + #[method(replaceTextContainer:)] + pub unsafe fn replaceTextContainer(&self, newContainer: &NSTextContainer); + + #[method(textContainerInset)] + pub unsafe fn textContainerInset(&self) -> NSSize; + + #[method(setTextContainerInset:)] + pub unsafe fn setTextContainerInset(&self, textContainerInset: NSSize); + + #[method(textContainerOrigin)] + pub unsafe fn textContainerOrigin(&self) -> NSPoint; + + #[method(invalidateTextContainerOrigin)] + pub unsafe fn invalidateTextContainerOrigin(&self); + + #[method_id(@__retain_semantics Other layoutManager)] + pub unsafe fn layoutManager(&self) -> Option>; + + #[method_id(@__retain_semantics Other textStorage)] + pub unsafe fn textStorage(&self) -> Option>; + + #[method_id(@__retain_semantics Other textLayoutManager)] + pub unsafe fn textLayoutManager(&self) -> Option>; + + #[method_id(@__retain_semantics Other textContentStorage)] + pub unsafe fn textContentStorage(&self) -> Option>; + + #[method(insertText:)] + pub unsafe fn insertText(&self, insertString: &Object); + + #[method(setConstrainedFrameSize:)] + pub unsafe fn setConstrainedFrameSize(&self, desiredSize: NSSize); + + #[method(setAlignment:range:)] + pub unsafe fn setAlignment_range(&self, alignment: NSTextAlignment, range: NSRange); + + #[method(setBaseWritingDirection:range:)] + pub unsafe fn setBaseWritingDirection_range( + &self, + writingDirection: NSWritingDirection, + range: NSRange, + ); + + #[method(turnOffKerning:)] + pub unsafe fn turnOffKerning(&self, sender: Option<&Object>); + + #[method(tightenKerning:)] + pub unsafe fn tightenKerning(&self, sender: Option<&Object>); + + #[method(loosenKerning:)] + pub unsafe fn loosenKerning(&self, sender: Option<&Object>); + + #[method(useStandardKerning:)] + pub unsafe fn useStandardKerning(&self, sender: Option<&Object>); + + #[method(turnOffLigatures:)] + pub unsafe fn turnOffLigatures(&self, sender: Option<&Object>); + + #[method(useStandardLigatures:)] + pub unsafe fn useStandardLigatures(&self, sender: Option<&Object>); + + #[method(useAllLigatures:)] + pub unsafe fn useAllLigatures(&self, sender: Option<&Object>); + + #[method(raiseBaseline:)] + pub unsafe fn raiseBaseline(&self, sender: Option<&Object>); + + #[method(lowerBaseline:)] + pub unsafe fn lowerBaseline(&self, sender: Option<&Object>); + + #[method(toggleTraditionalCharacterShape:)] + pub unsafe fn toggleTraditionalCharacterShape(&self, sender: Option<&Object>); + + #[method(outline:)] + pub unsafe fn outline(&self, sender: Option<&Object>); + + #[method(performFindPanelAction:)] + pub unsafe fn performFindPanelAction(&self, sender: Option<&Object>); + + #[method(alignJustified:)] + pub unsafe fn alignJustified(&self, sender: Option<&Object>); + + #[method(changeColor:)] + pub unsafe fn changeColor(&self, sender: Option<&Object>); + + #[method(changeAttributes:)] + pub unsafe fn changeAttributes(&self, sender: Option<&Object>); + + #[method(changeDocumentBackgroundColor:)] + pub unsafe fn changeDocumentBackgroundColor(&self, sender: Option<&Object>); + + #[method(orderFrontSpacingPanel:)] + pub unsafe fn orderFrontSpacingPanel(&self, sender: Option<&Object>); + + #[method(orderFrontLinkPanel:)] + pub unsafe fn orderFrontLinkPanel(&self, sender: Option<&Object>); + + #[method(orderFrontListPanel:)] + pub unsafe fn orderFrontListPanel(&self, sender: Option<&Object>); + + #[method(orderFrontTablePanel:)] + pub unsafe fn orderFrontTablePanel(&self, sender: Option<&Object>); + + #[method(rulerView:didMoveMarker:)] + pub unsafe fn rulerView_didMoveMarker(&self, ruler: &NSRulerView, marker: &NSRulerMarker); + + #[method(rulerView:didRemoveMarker:)] + pub unsafe fn rulerView_didRemoveMarker(&self, ruler: &NSRulerView, marker: &NSRulerMarker); + + #[method(rulerView:didAddMarker:)] + pub unsafe fn rulerView_didAddMarker(&self, ruler: &NSRulerView, marker: &NSRulerMarker); + + #[method(rulerView:shouldMoveMarker:)] + pub unsafe fn rulerView_shouldMoveMarker( + &self, + ruler: &NSRulerView, + marker: &NSRulerMarker, + ) -> bool; + + #[method(rulerView:shouldAddMarker:)] + pub unsafe fn rulerView_shouldAddMarker( + &self, + ruler: &NSRulerView, + marker: &NSRulerMarker, + ) -> bool; + + #[method(rulerView:willMoveMarker:toLocation:)] + pub unsafe fn rulerView_willMoveMarker_toLocation( + &self, + ruler: &NSRulerView, + marker: &NSRulerMarker, + location: CGFloat, + ) -> CGFloat; + + #[method(rulerView:shouldRemoveMarker:)] + pub unsafe fn rulerView_shouldRemoveMarker( + &self, + ruler: &NSRulerView, + marker: &NSRulerMarker, + ) -> bool; + + #[method(rulerView:willAddMarker:atLocation:)] + pub unsafe fn rulerView_willAddMarker_atLocation( + &self, + ruler: &NSRulerView, + marker: &NSRulerMarker, + location: CGFloat, + ) -> CGFloat; + + #[method(rulerView:handleMouseDown:)] + pub unsafe fn rulerView_handleMouseDown(&self, ruler: &NSRulerView, event: &NSEvent); + + #[method(setNeedsDisplayInRect:avoidAdditionalLayout:)] + pub unsafe fn setNeedsDisplayInRect_avoidAdditionalLayout(&self, rect: NSRect, flag: bool); + + #[method(shouldDrawInsertionPoint)] + pub unsafe fn shouldDrawInsertionPoint(&self) -> bool; + + #[method(drawInsertionPointInRect:color:turnedOn:)] + pub unsafe fn drawInsertionPointInRect_color_turnedOn( + &self, + rect: NSRect, + color: &NSColor, + flag: bool, + ); + + #[method(drawViewBackgroundInRect:)] + pub unsafe fn drawViewBackgroundInRect(&self, rect: NSRect); + + #[method(updateRuler)] + pub unsafe fn updateRuler(&self); + + #[method(updateFontPanel)] + pub unsafe fn updateFontPanel(&self); + + #[method(updateDragTypeRegistration)] + pub unsafe fn updateDragTypeRegistration(&self); + + #[method(selectionRangeForProposedRange:granularity:)] + pub unsafe fn selectionRangeForProposedRange_granularity( + &self, + proposedCharRange: NSRange, + granularity: NSSelectionGranularity, + ) -> NSRange; + + #[method(clickedOnLink:atIndex:)] + pub unsafe fn clickedOnLink_atIndex(&self, link: &Object, charIndex: NSUInteger); + + #[method(startSpeaking:)] + pub unsafe fn startSpeaking(&self, sender: Option<&Object>); + + #[method(stopSpeaking:)] + pub unsafe fn stopSpeaking(&self, sender: Option<&Object>); + + #[method(setLayoutOrientation:)] + pub unsafe fn setLayoutOrientation(&self, orientation: NSTextLayoutOrientation); + + #[method(changeLayoutOrientation:)] + pub unsafe fn changeLayoutOrientation(&self, sender: Option<&Object>); + + #[method(characterIndexForInsertionAtPoint:)] + pub unsafe fn characterIndexForInsertionAtPoint(&self, point: NSPoint) -> NSUInteger; + + #[method(stronglyReferencesTextStorage)] + pub unsafe fn stronglyReferencesTextStorage() -> bool; + + #[method(performValidatedReplacementInRange:withAttributedString:)] + pub unsafe fn performValidatedReplacementInRange_withAttributedString( + &self, + range: NSRange, + attributedString: &NSAttributedString, + ) -> bool; + + #[method(usesAdaptiveColorMappingForDarkAppearance)] + pub unsafe fn usesAdaptiveColorMappingForDarkAppearance(&self) -> bool; + + #[method(setUsesAdaptiveColorMappingForDarkAppearance:)] + pub unsafe fn setUsesAdaptiveColorMappingForDarkAppearance( + &self, + usesAdaptiveColorMappingForDarkAppearance: bool, + ); + } +); + +extern_methods!( + /// NSCompletion + unsafe impl NSTextView { + #[method(complete:)] + pub unsafe fn complete(&self, sender: Option<&Object>); + + #[method(rangeForUserCompletion)] + pub unsafe fn rangeForUserCompletion(&self) -> NSRange; + + #[method_id(@__retain_semantics Other completionsForPartialWordRange:indexOfSelectedItem:)] + pub unsafe fn completionsForPartialWordRange_indexOfSelectedItem( + &self, + charRange: NSRange, + index: NonNull, + ) -> Option, Shared>>; + + #[method(insertCompletion:forPartialWordRange:movement:isFinal:)] + pub unsafe fn insertCompletion_forPartialWordRange_movement_isFinal( + &self, + word: &NSString, + charRange: NSRange, + movement: NSInteger, + flag: bool, + ); + } +); + +extern_methods!( + /// NSPasteboard + unsafe impl NSTextView { + #[method_id(@__retain_semantics Other writablePasteboardTypes)] + pub unsafe fn writablePasteboardTypes(&self) -> Id, Shared>; + + #[method(writeSelectionToPasteboard:type:)] + pub unsafe fn writeSelectionToPasteboard_type( + &self, + pboard: &NSPasteboard, + type_: &NSPasteboardType, + ) -> bool; + + #[method(writeSelectionToPasteboard:types:)] + pub unsafe fn writeSelectionToPasteboard_types( + &self, + pboard: &NSPasteboard, + types: &NSArray, + ) -> bool; + + #[method_id(@__retain_semantics Other readablePasteboardTypes)] + pub unsafe fn readablePasteboardTypes(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other preferredPasteboardTypeFromArray:restrictedToTypesFromArray:)] + pub unsafe fn preferredPasteboardTypeFromArray_restrictedToTypesFromArray( + &self, + availableTypes: &NSArray, + allowedTypes: Option<&NSArray>, + ) -> Option>; + + #[method(readSelectionFromPasteboard:type:)] + pub unsafe fn readSelectionFromPasteboard_type( + &self, + pboard: &NSPasteboard, + type_: &NSPasteboardType, + ) -> bool; + + #[method(readSelectionFromPasteboard:)] + pub unsafe fn readSelectionFromPasteboard(&self, pboard: &NSPasteboard) -> bool; + + #[method(registerForServices)] + pub unsafe fn registerForServices(); + + #[method_id(@__retain_semantics Other validRequestorForSendType:returnType:)] + pub unsafe fn validRequestorForSendType_returnType( + &self, + sendType: Option<&NSPasteboardType>, + returnType: Option<&NSPasteboardType>, + ) -> Option>; + + #[method(pasteAsPlainText:)] + pub unsafe fn pasteAsPlainText(&self, sender: Option<&Object>); + + #[method(pasteAsRichText:)] + pub unsafe fn pasteAsRichText(&self, sender: Option<&Object>); + } +); + +extern_methods!( + /// NSDragging + unsafe impl NSTextView { + #[method(dragSelectionWithEvent:offset:slideBack:)] + pub unsafe fn dragSelectionWithEvent_offset_slideBack( + &self, + event: &NSEvent, + mouseOffset: NSSize, + slideBack: bool, + ) -> bool; + + #[method_id(@__retain_semantics Other dragImageForSelectionWithEvent:origin:)] + pub unsafe fn dragImageForSelectionWithEvent_origin( + &self, + event: &NSEvent, + origin: NSPointPointer, + ) -> Option>; + + #[method_id(@__retain_semantics Other acceptableDragTypes)] + pub unsafe fn acceptableDragTypes(&self) -> Id, Shared>; + + #[method(dragOperationForDraggingInfo:type:)] + pub unsafe fn dragOperationForDraggingInfo_type( + &self, + dragInfo: &NSDraggingInfo, + type_: &NSPasteboardType, + ) -> NSDragOperation; + + #[method(cleanUpAfterDragOperation)] + pub unsafe fn cleanUpAfterDragOperation(&self); + } +); + +extern_methods!( + /// NSSharing + unsafe impl NSTextView { + #[method_id(@__retain_semantics Other selectedRanges)] + pub unsafe fn selectedRanges(&self) -> Id, Shared>; + + #[method(setSelectedRanges:)] + pub unsafe fn setSelectedRanges(&self, selectedRanges: &NSArray); + + #[method(setSelectedRanges:affinity:stillSelecting:)] + pub unsafe fn setSelectedRanges_affinity_stillSelecting( + &self, + ranges: &NSArray, + affinity: NSSelectionAffinity, + stillSelectingFlag: bool, + ); + + #[method(setSelectedRange:affinity:stillSelecting:)] + pub unsafe fn setSelectedRange_affinity_stillSelecting( + &self, + charRange: NSRange, + affinity: NSSelectionAffinity, + stillSelectingFlag: bool, + ); + + #[method(selectionAffinity)] + pub unsafe fn selectionAffinity(&self) -> NSSelectionAffinity; + + #[method(selectionGranularity)] + pub unsafe fn selectionGranularity(&self) -> NSSelectionGranularity; + + #[method(setSelectionGranularity:)] + pub unsafe fn setSelectionGranularity(&self, selectionGranularity: NSSelectionGranularity); + + #[method_id(@__retain_semantics Other selectedTextAttributes)] + pub unsafe fn selectedTextAttributes( + &self, + ) -> Id, Shared>; + + #[method(setSelectedTextAttributes:)] + pub unsafe fn setSelectedTextAttributes( + &self, + selectedTextAttributes: &NSDictionary, + ); + + #[method_id(@__retain_semantics Other insertionPointColor)] + pub unsafe fn insertionPointColor(&self) -> Id; + + #[method(setInsertionPointColor:)] + pub unsafe fn setInsertionPointColor(&self, insertionPointColor: &NSColor); + + #[method(updateInsertionPointStateAndRestartTimer:)] + pub unsafe fn updateInsertionPointStateAndRestartTimer(&self, restartFlag: bool); + + #[method_id(@__retain_semantics Other markedTextAttributes)] + pub unsafe fn markedTextAttributes( + &self, + ) -> Option, Shared>>; + + #[method(setMarkedTextAttributes:)] + pub unsafe fn setMarkedTextAttributes( + &self, + markedTextAttributes: Option<&NSDictionary>, + ); + + #[method_id(@__retain_semantics Other linkTextAttributes)] + pub unsafe fn linkTextAttributes( + &self, + ) -> Option, Shared>>; + + #[method(setLinkTextAttributes:)] + pub unsafe fn setLinkTextAttributes( + &self, + linkTextAttributes: Option<&NSDictionary>, + ); + + #[method(displaysLinkToolTips)] + pub unsafe fn displaysLinkToolTips(&self) -> bool; + + #[method(setDisplaysLinkToolTips:)] + pub unsafe fn setDisplaysLinkToolTips(&self, displaysLinkToolTips: bool); + + #[method(acceptsGlyphInfo)] + pub unsafe fn acceptsGlyphInfo(&self) -> bool; + + #[method(setAcceptsGlyphInfo:)] + pub unsafe fn setAcceptsGlyphInfo(&self, acceptsGlyphInfo: bool); + + #[method(usesRuler)] + pub unsafe fn usesRuler(&self) -> bool; + + #[method(setUsesRuler:)] + pub unsafe fn setUsesRuler(&self, usesRuler: bool); + + #[method(usesInspectorBar)] + pub unsafe fn usesInspectorBar(&self) -> bool; + + #[method(setUsesInspectorBar:)] + pub unsafe fn setUsesInspectorBar(&self, usesInspectorBar: bool); + + #[method(isContinuousSpellCheckingEnabled)] + pub unsafe fn isContinuousSpellCheckingEnabled(&self) -> bool; + + #[method(setContinuousSpellCheckingEnabled:)] + pub unsafe fn setContinuousSpellCheckingEnabled( + &self, + continuousSpellCheckingEnabled: bool, + ); + + #[method(toggleContinuousSpellChecking:)] + pub unsafe fn toggleContinuousSpellChecking(&self, sender: Option<&Object>); + + #[method(spellCheckerDocumentTag)] + pub unsafe fn spellCheckerDocumentTag(&self) -> NSInteger; + + #[method(isGrammarCheckingEnabled)] + pub unsafe fn isGrammarCheckingEnabled(&self) -> bool; + + #[method(setGrammarCheckingEnabled:)] + pub unsafe fn setGrammarCheckingEnabled(&self, grammarCheckingEnabled: bool); + + #[method(toggleGrammarChecking:)] + pub unsafe fn toggleGrammarChecking(&self, sender: Option<&Object>); + + #[method(setSpellingState:range:)] + pub unsafe fn setSpellingState_range(&self, value: NSInteger, charRange: NSRange); + + #[method_id(@__retain_semantics Other typingAttributes)] + pub unsafe fn typingAttributes( + &self, + ) -> Id, Shared>; + + #[method(setTypingAttributes:)] + pub unsafe fn setTypingAttributes( + &self, + typingAttributes: &NSDictionary, + ); + + #[method(shouldChangeTextInRanges:replacementStrings:)] + pub unsafe fn shouldChangeTextInRanges_replacementStrings( + &self, + affectedRanges: &NSArray, + replacementStrings: Option<&NSArray>, + ) -> bool; + + #[method_id(@__retain_semantics Other rangesForUserTextChange)] + pub unsafe fn rangesForUserTextChange(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other rangesForUserCharacterAttributeChange)] + pub unsafe fn rangesForUserCharacterAttributeChange( + &self, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other rangesForUserParagraphAttributeChange)] + pub unsafe fn rangesForUserParagraphAttributeChange( + &self, + ) -> Option, Shared>>; + + #[method(shouldChangeTextInRange:replacementString:)] + pub unsafe fn shouldChangeTextInRange_replacementString( + &self, + affectedCharRange: NSRange, + replacementString: Option<&NSString>, + ) -> bool; + + #[method(didChangeText)] + pub unsafe fn didChangeText(&self); + + #[method(rangeForUserTextChange)] + pub unsafe fn rangeForUserTextChange(&self) -> NSRange; + + #[method(rangeForUserCharacterAttributeChange)] + pub unsafe fn rangeForUserCharacterAttributeChange(&self) -> NSRange; + + #[method(rangeForUserParagraphAttributeChange)] + pub unsafe fn rangeForUserParagraphAttributeChange(&self) -> NSRange; + + #[method(allowsDocumentBackgroundColorChange)] + pub unsafe fn allowsDocumentBackgroundColorChange(&self) -> bool; + + #[method(setAllowsDocumentBackgroundColorChange:)] + pub unsafe fn setAllowsDocumentBackgroundColorChange( + &self, + allowsDocumentBackgroundColorChange: bool, + ); + + #[method_id(@__retain_semantics Other defaultParagraphStyle)] + pub unsafe fn defaultParagraphStyle(&self) -> Option>; + + #[method(setDefaultParagraphStyle:)] + pub unsafe fn setDefaultParagraphStyle( + &self, + defaultParagraphStyle: Option<&NSParagraphStyle>, + ); + + #[method(allowsUndo)] + pub unsafe fn allowsUndo(&self) -> bool; + + #[method(setAllowsUndo:)] + pub unsafe fn setAllowsUndo(&self, allowsUndo: bool); + + #[method(breakUndoCoalescing)] + pub unsafe fn breakUndoCoalescing(&self); + + #[method(isCoalescingUndo)] + pub unsafe fn isCoalescingUndo(&self) -> bool; + + #[method(allowsImageEditing)] + pub unsafe fn allowsImageEditing(&self) -> bool; + + #[method(setAllowsImageEditing:)] + pub unsafe fn setAllowsImageEditing(&self, allowsImageEditing: bool); + + #[method(showFindIndicatorForRange:)] + pub unsafe fn showFindIndicatorForRange(&self, charRange: NSRange); + + #[method(usesRolloverButtonForSelection)] + pub unsafe fn usesRolloverButtonForSelection(&self) -> bool; + + #[method(setUsesRolloverButtonForSelection:)] + pub unsafe fn setUsesRolloverButtonForSelection( + &self, + usesRolloverButtonForSelection: bool, + ); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTextViewDelegate>); + + #[method(isEditable)] + pub unsafe fn isEditable(&self) -> bool; + + #[method(setEditable:)] + pub unsafe fn setEditable(&self, editable: bool); + + #[method(isSelectable)] + pub unsafe fn isSelectable(&self) -> bool; + + #[method(setSelectable:)] + pub unsafe fn setSelectable(&self, selectable: bool); + + #[method(isRichText)] + pub unsafe fn isRichText(&self) -> bool; + + #[method(setRichText:)] + pub unsafe fn setRichText(&self, richText: bool); + + #[method(importsGraphics)] + pub unsafe fn importsGraphics(&self) -> bool; + + #[method(setImportsGraphics:)] + pub unsafe fn setImportsGraphics(&self, importsGraphics: bool); + + #[method(drawsBackground)] + pub unsafe fn drawsBackground(&self) -> bool; + + #[method(setDrawsBackground:)] + pub unsafe fn setDrawsBackground(&self, drawsBackground: bool); + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Id; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: &NSColor); + + #[method(isFieldEditor)] + pub unsafe fn isFieldEditor(&self) -> bool; + + #[method(setFieldEditor:)] + pub unsafe fn setFieldEditor(&self, fieldEditor: bool); + + #[method(usesFontPanel)] + pub unsafe fn usesFontPanel(&self) -> bool; + + #[method(setUsesFontPanel:)] + pub unsafe fn setUsesFontPanel(&self, usesFontPanel: bool); + + #[method(isRulerVisible)] + pub unsafe fn isRulerVisible(&self) -> bool; + + #[method(setRulerVisible:)] + pub unsafe fn setRulerVisible(&self, rulerVisible: bool); + + #[method(setSelectedRange:)] + pub unsafe fn setSelectedRange(&self, charRange: NSRange); + + #[method_id(@__retain_semantics Other allowedInputSourceLocales)] + pub unsafe fn allowedInputSourceLocales(&self) -> Option, Shared>>; + + #[method(setAllowedInputSourceLocales:)] + pub unsafe fn setAllowedInputSourceLocales( + &self, + allowedInputSourceLocales: Option<&NSArray>, + ); + } +); + +extern_methods!( + /// NSTextChecking + unsafe impl NSTextView { + #[method(smartInsertDeleteEnabled)] + pub unsafe fn smartInsertDeleteEnabled(&self) -> bool; + + #[method(setSmartInsertDeleteEnabled:)] + pub unsafe fn setSmartInsertDeleteEnabled(&self, smartInsertDeleteEnabled: bool); + + #[method(smartDeleteRangeForProposedRange:)] + pub unsafe fn smartDeleteRangeForProposedRange( + &self, + proposedCharRange: NSRange, + ) -> NSRange; + + #[method(toggleSmartInsertDelete:)] + pub unsafe fn toggleSmartInsertDelete(&self, sender: Option<&Object>); + + #[method(smartInsertForString:replacingRange:beforeString:afterString:)] + pub unsafe fn smartInsertForString_replacingRange_beforeString_afterString( + &self, + pasteString: &NSString, + charRangeToReplace: NSRange, + beforeString: *mut *mut NSString, + afterString: *mut *mut NSString, + ); + + #[method_id(@__retain_semantics Other smartInsertBeforeStringForString:replacingRange:)] + pub unsafe fn smartInsertBeforeStringForString_replacingRange( + &self, + pasteString: &NSString, + charRangeToReplace: NSRange, + ) -> Option>; + + #[method_id(@__retain_semantics Other smartInsertAfterStringForString:replacingRange:)] + pub unsafe fn smartInsertAfterStringForString_replacingRange( + &self, + pasteString: &NSString, + charRangeToReplace: NSRange, + ) -> Option>; + + #[method(isAutomaticQuoteSubstitutionEnabled)] + pub unsafe fn isAutomaticQuoteSubstitutionEnabled(&self) -> bool; + + #[method(setAutomaticQuoteSubstitutionEnabled:)] + pub unsafe fn setAutomaticQuoteSubstitutionEnabled( + &self, + automaticQuoteSubstitutionEnabled: bool, + ); + + #[method(toggleAutomaticQuoteSubstitution:)] + pub unsafe fn toggleAutomaticQuoteSubstitution(&self, sender: Option<&Object>); + + #[method(isAutomaticLinkDetectionEnabled)] + pub unsafe fn isAutomaticLinkDetectionEnabled(&self) -> bool; + + #[method(setAutomaticLinkDetectionEnabled:)] + pub unsafe fn setAutomaticLinkDetectionEnabled(&self, automaticLinkDetectionEnabled: bool); + + #[method(toggleAutomaticLinkDetection:)] + pub unsafe fn toggleAutomaticLinkDetection(&self, sender: Option<&Object>); + + #[method(isAutomaticDataDetectionEnabled)] + pub unsafe fn isAutomaticDataDetectionEnabled(&self) -> bool; + + #[method(setAutomaticDataDetectionEnabled:)] + pub unsafe fn setAutomaticDataDetectionEnabled(&self, automaticDataDetectionEnabled: bool); + + #[method(toggleAutomaticDataDetection:)] + pub unsafe fn toggleAutomaticDataDetection(&self, sender: Option<&Object>); + + #[method(isAutomaticDashSubstitutionEnabled)] + pub unsafe fn isAutomaticDashSubstitutionEnabled(&self) -> bool; + + #[method(setAutomaticDashSubstitutionEnabled:)] + pub unsafe fn setAutomaticDashSubstitutionEnabled( + &self, + automaticDashSubstitutionEnabled: bool, + ); + + #[method(toggleAutomaticDashSubstitution:)] + pub unsafe fn toggleAutomaticDashSubstitution(&self, sender: Option<&Object>); + + #[method(isAutomaticTextReplacementEnabled)] + pub unsafe fn isAutomaticTextReplacementEnabled(&self) -> bool; + + #[method(setAutomaticTextReplacementEnabled:)] + pub unsafe fn setAutomaticTextReplacementEnabled( + &self, + automaticTextReplacementEnabled: bool, + ); + + #[method(toggleAutomaticTextReplacement:)] + pub unsafe fn toggleAutomaticTextReplacement(&self, sender: Option<&Object>); + + #[method(isAutomaticSpellingCorrectionEnabled)] + pub unsafe fn isAutomaticSpellingCorrectionEnabled(&self) -> bool; + + #[method(setAutomaticSpellingCorrectionEnabled:)] + pub unsafe fn setAutomaticSpellingCorrectionEnabled( + &self, + automaticSpellingCorrectionEnabled: bool, + ); + + #[method(toggleAutomaticSpellingCorrection:)] + pub unsafe fn toggleAutomaticSpellingCorrection(&self, sender: Option<&Object>); + + #[method(enabledTextCheckingTypes)] + pub unsafe fn enabledTextCheckingTypes(&self) -> NSTextCheckingTypes; + + #[method(setEnabledTextCheckingTypes:)] + pub unsafe fn setEnabledTextCheckingTypes( + &self, + enabledTextCheckingTypes: NSTextCheckingTypes, + ); + + #[method(checkTextInRange:types:options:)] + pub unsafe fn checkTextInRange_types_options( + &self, + range: NSRange, + checkingTypes: NSTextCheckingTypes, + options: &NSDictionary, + ); + + #[method(handleTextCheckingResults:forRange:types:options:orthography:wordCount:)] + pub unsafe fn handleTextCheckingResults_forRange_types_options_orthography_wordCount( + &self, + results: &NSArray, + range: NSRange, + checkingTypes: NSTextCheckingTypes, + options: &NSDictionary, + orthography: &NSOrthography, + wordCount: NSInteger, + ); + + #[method(orderFrontSubstitutionsPanel:)] + pub unsafe fn orderFrontSubstitutionsPanel(&self, sender: Option<&Object>); + + #[method(checkTextInSelection:)] + pub unsafe fn checkTextInSelection(&self, sender: Option<&Object>); + + #[method(checkTextInDocument:)] + pub unsafe fn checkTextInDocument(&self, sender: Option<&Object>); + + #[method(usesFindPanel)] + pub unsafe fn usesFindPanel(&self) -> bool; + + #[method(setUsesFindPanel:)] + pub unsafe fn setUsesFindPanel(&self, usesFindPanel: bool); + + #[method(usesFindBar)] + pub unsafe fn usesFindBar(&self) -> bool; + + #[method(setUsesFindBar:)] + pub unsafe fn setUsesFindBar(&self, usesFindBar: bool); + + #[method(isIncrementalSearchingEnabled)] + pub unsafe fn isIncrementalSearchingEnabled(&self) -> bool; + + #[method(setIncrementalSearchingEnabled:)] + pub unsafe fn setIncrementalSearchingEnabled(&self, incrementalSearchingEnabled: bool); + } +); + +extern_methods!( + /// NSQuickLookPreview + unsafe impl NSTextView { + #[method(toggleQuickLookPreviewPanel:)] + pub unsafe fn toggleQuickLookPreviewPanel(&self, sender: Option<&Object>); + + #[method(updateQuickLookPreviewPanel)] + pub unsafe fn updateQuickLookPreviewPanel(&self); + } +); + +extern_methods!( + /// NSTextView_SharingService + unsafe impl NSTextView { + #[method(orderFrontSharingServicePicker:)] + pub unsafe fn orderFrontSharingServicePicker(&self, sender: Option<&Object>); + } +); + +extern_methods!( + /// NSTextView_TouchBar + unsafe impl NSTextView { + #[method(isAutomaticTextCompletionEnabled)] + pub unsafe fn isAutomaticTextCompletionEnabled(&self) -> bool; + + #[method(setAutomaticTextCompletionEnabled:)] + pub unsafe fn setAutomaticTextCompletionEnabled( + &self, + automaticTextCompletionEnabled: bool, + ); + + #[method(toggleAutomaticTextCompletion:)] + pub unsafe fn toggleAutomaticTextCompletion(&self, sender: Option<&Object>); + + #[method(allowsCharacterPickerTouchBarItem)] + pub unsafe fn allowsCharacterPickerTouchBarItem(&self) -> bool; + + #[method(setAllowsCharacterPickerTouchBarItem:)] + pub unsafe fn setAllowsCharacterPickerTouchBarItem( + &self, + allowsCharacterPickerTouchBarItem: bool, + ); + + #[method(updateTouchBarItemIdentifiers)] + pub unsafe fn updateTouchBarItemIdentifiers(&self); + + #[method(updateTextTouchBarItems)] + pub unsafe fn updateTextTouchBarItems(&self); + + #[method(updateCandidates)] + pub unsafe fn updateCandidates(&self); + + #[method_id(@__retain_semantics Other candidateListTouchBarItem)] + pub unsafe fn candidateListTouchBarItem( + &self, + ) -> Option>; + } +); + +extern_methods!( + /// NSTextView_Factory + unsafe impl NSTextView { + #[method_id(@__retain_semantics Other scrollableTextView)] + pub unsafe fn scrollableTextView() -> Id; + + #[method_id(@__retain_semantics Other fieldEditor)] + pub unsafe fn fieldEditor() -> Id; + + #[method_id(@__retain_semantics Other scrollableDocumentContentTextView)] + pub unsafe fn scrollableDocumentContentTextView() -> Id; + + #[method_id(@__retain_semantics Other scrollablePlainDocumentContentTextView)] + pub unsafe fn scrollablePlainDocumentContentTextView() -> Id; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSTextView { + #[method(toggleBaseWritingDirection:)] + pub unsafe fn toggleBaseWritingDirection(&self, sender: Option<&Object>); + } +); + +extern_protocol!( + pub struct NSTextViewDelegate; + + unsafe impl NSTextViewDelegate { + #[optional] + #[method(textView:clickedOnLink:atIndex:)] + pub unsafe fn textView_clickedOnLink_atIndex( + &self, + textView: &NSTextView, + link: &Object, + charIndex: NSUInteger, + ) -> bool; + + #[optional] + #[method(textView:clickedOnCell:inRect:atIndex:)] + pub unsafe fn textView_clickedOnCell_inRect_atIndex( + &self, + textView: &NSTextView, + cell: &NSTextAttachmentCell, + cellFrame: NSRect, + charIndex: NSUInteger, + ); + + #[optional] + #[method(textView:doubleClickedOnCell:inRect:atIndex:)] + pub unsafe fn textView_doubleClickedOnCell_inRect_atIndex( + &self, + textView: &NSTextView, + cell: &NSTextAttachmentCell, + cellFrame: NSRect, + charIndex: NSUInteger, + ); + + #[optional] + #[method(textView:draggedCell:inRect:event:atIndex:)] + pub unsafe fn textView_draggedCell_inRect_event_atIndex( + &self, + view: &NSTextView, + cell: &NSTextAttachmentCell, + rect: NSRect, + event: &NSEvent, + charIndex: NSUInteger, + ); + + #[optional] + #[method_id(@__retain_semantics Other textView:writablePasteboardTypesForCell:atIndex:)] + pub unsafe fn textView_writablePasteboardTypesForCell_atIndex( + &self, + view: &NSTextView, + cell: &NSTextAttachmentCell, + charIndex: NSUInteger, + ) -> Id, Shared>; + + #[optional] + #[method(textView:writeCell:atIndex:toPasteboard:type:)] + pub unsafe fn textView_writeCell_atIndex_toPasteboard_type( + &self, + view: &NSTextView, + cell: &NSTextAttachmentCell, + charIndex: NSUInteger, + pboard: &NSPasteboard, + type_: &NSPasteboardType, + ) -> bool; + + #[optional] + #[method(textView:willChangeSelectionFromCharacterRange:toCharacterRange:)] + pub unsafe fn textView_willChangeSelectionFromCharacterRange_toCharacterRange( + &self, + textView: &NSTextView, + oldSelectedCharRange: NSRange, + newSelectedCharRange: NSRange, + ) -> NSRange; + + #[optional] + #[method_id(@__retain_semantics Other textView:willChangeSelectionFromCharacterRanges:toCharacterRanges:)] + pub unsafe fn textView_willChangeSelectionFromCharacterRanges_toCharacterRanges( + &self, + textView: &NSTextView, + oldSelectedCharRanges: &NSArray, + newSelectedCharRanges: &NSArray, + ) -> Id, Shared>; + + #[optional] + #[method(textView:shouldChangeTextInRanges:replacementStrings:)] + pub unsafe fn textView_shouldChangeTextInRanges_replacementStrings( + &self, + textView: &NSTextView, + affectedRanges: &NSArray, + replacementStrings: Option<&NSArray>, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other textView:shouldChangeTypingAttributes:toAttributes:)] + pub unsafe fn textView_shouldChangeTypingAttributes_toAttributes( + &self, + textView: &NSTextView, + oldTypingAttributes: &NSDictionary, + newTypingAttributes: &NSDictionary, + ) -> Id, Shared>; + + #[optional] + #[method(textViewDidChangeSelection:)] + pub unsafe fn textViewDidChangeSelection(&self, notification: &NSNotification); + + #[optional] + #[method(textViewDidChangeTypingAttributes:)] + pub unsafe fn textViewDidChangeTypingAttributes(&self, notification: &NSNotification); + + #[optional] + #[method_id(@__retain_semantics Other textView:willDisplayToolTip:forCharacterAtIndex:)] + pub unsafe fn textView_willDisplayToolTip_forCharacterAtIndex( + &self, + textView: &NSTextView, + tooltip: &NSString, + characterIndex: NSUInteger, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other textView:completions:forPartialWordRange:indexOfSelectedItem:)] + pub unsafe fn textView_completions_forPartialWordRange_indexOfSelectedItem( + &self, + textView: &NSTextView, + words: &NSArray, + charRange: NSRange, + index: *mut NSInteger, + ) -> Id, Shared>; + + #[optional] + #[method(textView:shouldChangeTextInRange:replacementString:)] + pub unsafe fn textView_shouldChangeTextInRange_replacementString( + &self, + textView: &NSTextView, + affectedCharRange: NSRange, + replacementString: Option<&NSString>, + ) -> bool; + + #[optional] + #[method(textView:doCommandBySelector:)] + pub unsafe fn textView_doCommandBySelector( + &self, + textView: &NSTextView, + commandSelector: Sel, + ) -> bool; + + #[optional] + #[method(textView:shouldSetSpellingState:range:)] + pub unsafe fn textView_shouldSetSpellingState_range( + &self, + textView: &NSTextView, + value: NSInteger, + affectedCharRange: NSRange, + ) -> NSInteger; + + #[optional] + #[method_id(@__retain_semantics Other textView:menu:forEvent:atIndex:)] + pub unsafe fn textView_menu_forEvent_atIndex( + &self, + view: &NSTextView, + menu: &NSMenu, + event: &NSEvent, + charIndex: NSUInteger, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other textView:willCheckTextInRange:options:types:)] + pub unsafe fn textView_willCheckTextInRange_options_types( + &self, + view: &NSTextView, + range: NSRange, + options: &NSDictionary, + checkingTypes: NonNull, + ) -> Id, Shared>; + + #[optional] + #[method_id(@__retain_semantics Other textView:didCheckTextInRange:types:options:results:orthography:wordCount:)] + pub unsafe fn textView_didCheckTextInRange_types_options_results_orthography_wordCount( + &self, + view: &NSTextView, + range: NSRange, + checkingTypes: NSTextCheckingTypes, + options: &NSDictionary, + results: &NSArray, + orthography: &NSOrthography, + wordCount: NSInteger, + ) -> Id, Shared>; + + #[optional] + #[method_id(@__retain_semantics Other textView:URLForContentsOfTextAttachment:atIndex:)] + pub unsafe fn textView_URLForContentsOfTextAttachment_atIndex( + &self, + textView: &NSTextView, + textAttachment: &NSTextAttachment, + charIndex: NSUInteger, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other textView:willShowSharingServicePicker:forItems:)] + pub unsafe fn textView_willShowSharingServicePicker_forItems( + &self, + textView: &NSTextView, + servicePicker: &NSSharingServicePicker, + items: &NSArray, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other undoManagerForTextView:)] + pub unsafe fn undoManagerForTextView( + &self, + view: &NSTextView, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other textView:shouldUpdateTouchBarItemIdentifiers:)] + pub unsafe fn textView_shouldUpdateTouchBarItemIdentifiers( + &self, + textView: &NSTextView, + identifiers: &NSArray, + ) -> Id, Shared>; + + #[optional] + #[method_id(@__retain_semantics Other textView:candidatesForSelectedRange:)] + pub unsafe fn textView_candidatesForSelectedRange( + &self, + textView: &NSTextView, + selectedRange: NSRange, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other textView:candidates:forSelectedRange:)] + pub unsafe fn textView_candidates_forSelectedRange( + &self, + textView: &NSTextView, + candidates: &NSArray, + selectedRange: NSRange, + ) -> Id, Shared>; + + #[optional] + #[method(textView:shouldSelectCandidateAtIndex:)] + pub unsafe fn textView_shouldSelectCandidateAtIndex( + &self, + textView: &NSTextView, + index: NSUInteger, + ) -> bool; + + #[optional] + #[method(textView:clickedOnLink:)] + pub unsafe fn textView_clickedOnLink( + &self, + textView: &NSTextView, + link: Option<&Object>, + ) -> bool; + + #[optional] + #[method(textView:clickedOnCell:inRect:)] + pub unsafe fn textView_clickedOnCell_inRect( + &self, + textView: &NSTextView, + cell: Option<&NSTextAttachmentCell>, + cellFrame: NSRect, + ); + + #[optional] + #[method(textView:doubleClickedOnCell:inRect:)] + pub unsafe fn textView_doubleClickedOnCell_inRect( + &self, + textView: &NSTextView, + cell: Option<&NSTextAttachmentCell>, + cellFrame: NSRect, + ); + + #[optional] + #[method(textView:draggedCell:inRect:event:)] + pub unsafe fn textView_draggedCell_inRect_event( + &self, + view: &NSTextView, + cell: Option<&NSTextAttachmentCell>, + rect: NSRect, + event: Option<&NSEvent>, + ); + } +); + +extern_static!(NSTouchBarItemIdentifierCharacterPicker: &'static NSTouchBarItemIdentifier); + +extern_static!(NSTouchBarItemIdentifierTextColorPicker: &'static NSTouchBarItemIdentifier); + +extern_static!(NSTouchBarItemIdentifierTextStyle: &'static NSTouchBarItemIdentifier); + +extern_static!(NSTouchBarItemIdentifierTextAlignment: &'static NSTouchBarItemIdentifier); + +extern_static!(NSTouchBarItemIdentifierTextList: &'static NSTouchBarItemIdentifier); + +extern_static!(NSTouchBarItemIdentifierTextFormat: &'static NSTouchBarItemIdentifier); + +extern_static!(NSTextViewWillChangeNotifyingTextViewNotification: &'static NSNotificationName); + +extern_static!(NSTextViewDidChangeSelectionNotification: &'static NSNotificationName); + +extern_static!(NSTextViewDidChangeTypingAttributesNotification: &'static NSNotificationName); + +extern_static!(NSTextViewWillSwitchToNSLayoutManagerNotification: &'static NSNotificationName); + +extern_static!(NSTextViewDidSwitchToNSLayoutManagerNotification: &'static NSNotificationName); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSFindPanelAction { + NSFindPanelActionShowFindPanel = 1, + NSFindPanelActionNext = 2, + NSFindPanelActionPrevious = 3, + NSFindPanelActionReplaceAll = 4, + NSFindPanelActionReplace = 5, + NSFindPanelActionReplaceAndFind = 6, + NSFindPanelActionSetFindString = 7, + NSFindPanelActionReplaceAllInSelection = 8, + NSFindPanelActionSelectAll = 9, + NSFindPanelActionSelectAllInSelection = 10, + } +); + +extern_static!(NSFindPanelSearchOptionsPboardType: &'static NSPasteboardType); + +pub type NSPasteboardTypeFindPanelSearchOptionKey = NSString; + +extern_static!(NSFindPanelCaseInsensitiveSearch: &'static NSPasteboardTypeFindPanelSearchOptionKey); + +extern_static!(NSFindPanelSubstringMatch: &'static NSPasteboardTypeFindPanelSearchOptionKey); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSFindPanelSubstringMatchType { + NSFindPanelSubstringMatchTypeContains = 0, + NSFindPanelSubstringMatchTypeStartsWith = 1, + NSFindPanelSubstringMatchTypeFullWord = 2, + NSFindPanelSubstringMatchTypeEndsWith = 3, + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTextViewportLayoutController.rs b/crates/icrate/src/generated/AppKit/NSTextViewportLayoutController.rs new file mode 100644 index 000000000..2b057889e --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTextViewportLayoutController.rs @@ -0,0 +1,92 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSTextViewportLayoutControllerDelegate; + + unsafe impl NSTextViewportLayoutControllerDelegate { + #[method(viewportBoundsForTextViewportLayoutController:)] + pub unsafe fn viewportBoundsForTextViewportLayoutController( + &self, + textViewportLayoutController: &NSTextViewportLayoutController, + ) -> CGRect; + + #[method(textViewportLayoutController:configureRenderingSurfaceForTextLayoutFragment:)] + pub unsafe fn textViewportLayoutController_configureRenderingSurfaceForTextLayoutFragment( + &self, + textViewportLayoutController: &NSTextViewportLayoutController, + textLayoutFragment: &NSTextLayoutFragment, + ); + + #[optional] + #[method(textViewportLayoutControllerWillLayout:)] + pub unsafe fn textViewportLayoutControllerWillLayout( + &self, + textViewportLayoutController: &NSTextViewportLayoutController, + ); + + #[optional] + #[method(textViewportLayoutControllerDidLayout:)] + pub unsafe fn textViewportLayoutControllerDidLayout( + &self, + textViewportLayoutController: &NSTextViewportLayoutController, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTextViewportLayoutController; + + unsafe impl ClassType for NSTextViewportLayoutController { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextViewportLayoutController { + #[method_id(@__retain_semantics Init initWithTextLayoutManager:)] + pub unsafe fn initWithTextLayoutManager( + this: Option>, + textLayoutManager: &NSTextLayoutManager, + ) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) + -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTextViewportLayoutControllerDelegate>); + + #[method_id(@__retain_semantics Other textLayoutManager)] + pub unsafe fn textLayoutManager(&self) -> Option>; + + #[method(viewportBounds)] + pub unsafe fn viewportBounds(&self) -> CGRect; + + #[method_id(@__retain_semantics Other viewportRange)] + pub unsafe fn viewportRange(&self) -> Option>; + + #[method(layoutViewport)] + pub unsafe fn layoutViewport(&self); + + #[method(relocateViewportToTextLocation:)] + pub unsafe fn relocateViewportToTextLocation( + &self, + textLocation: &NSTextLocation, + ) -> CGFloat; + + #[method(adjustViewportByVerticalOffset:)] + pub unsafe fn adjustViewportByVerticalOffset(&self, verticalOffset: CGFloat); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTintConfiguration.rs b/crates/icrate/src/generated/AppKit/NSTintConfiguration.rs new file mode 100644 index 000000000..535e5e0d2 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTintConfiguration.rs @@ -0,0 +1,40 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTintConfiguration; + + unsafe impl ClassType for NSTintConfiguration { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTintConfiguration { + #[method_id(@__retain_semantics Other defaultTintConfiguration)] + pub unsafe fn defaultTintConfiguration() -> Id; + + #[method_id(@__retain_semantics Other monochromeTintConfiguration)] + pub unsafe fn monochromeTintConfiguration() -> Id; + + #[method_id(@__retain_semantics Other tintConfigurationWithPreferredColor:)] + pub unsafe fn tintConfigurationWithPreferredColor(color: &NSColor) -> Id; + + #[method_id(@__retain_semantics Other tintConfigurationWithFixedColor:)] + pub unsafe fn tintConfigurationWithFixedColor(color: &NSColor) -> Id; + + #[method_id(@__retain_semantics Other baseTintColor)] + pub unsafe fn baseTintColor(&self) -> Option>; + + #[method_id(@__retain_semantics Other equivalentContentTintColor)] + pub unsafe fn equivalentContentTintColor(&self) -> Option>; + + #[method(adaptsToUserAccentColor)] + pub unsafe fn adaptsToUserAccentColor(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTitlebarAccessoryViewController.rs b/crates/icrate/src/generated/AppKit/NSTitlebarAccessoryViewController.rs new file mode 100644 index 000000000..6d430cc9e --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTitlebarAccessoryViewController.rs @@ -0,0 +1,52 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTitlebarAccessoryViewController; + + unsafe impl ClassType for NSTitlebarAccessoryViewController { + type Super = NSViewController; + } +); + +extern_methods!( + unsafe impl NSTitlebarAccessoryViewController { + #[method(layoutAttribute)] + pub unsafe fn layoutAttribute(&self) -> NSLayoutAttribute; + + #[method(setLayoutAttribute:)] + pub unsafe fn setLayoutAttribute(&self, layoutAttribute: NSLayoutAttribute); + + #[method(fullScreenMinHeight)] + pub unsafe fn fullScreenMinHeight(&self) -> CGFloat; + + #[method(setFullScreenMinHeight:)] + pub unsafe fn setFullScreenMinHeight(&self, fullScreenMinHeight: CGFloat); + + #[method(isHidden)] + pub unsafe fn isHidden(&self) -> bool; + + #[method(setHidden:)] + pub unsafe fn setHidden(&self, hidden: bool); + + #[method(automaticallyAdjustsSize)] + pub unsafe fn automaticallyAdjustsSize(&self) -> bool; + + #[method(setAutomaticallyAdjustsSize:)] + pub unsafe fn setAutomaticallyAdjustsSize(&self, automaticallyAdjustsSize: bool); + + #[method(viewWillAppear)] + pub unsafe fn viewWillAppear(&self); + + #[method(viewDidAppear)] + pub unsafe fn viewDidAppear(&self); + + #[method(viewDidDisappear)] + pub unsafe fn viewDidDisappear(&self); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTokenField.rs b/crates/icrate/src/generated/AppKit/NSTokenField.rs new file mode 100644 index 000000000..b28ffd71e --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTokenField.rs @@ -0,0 +1,142 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSTokenFieldDelegate; + + unsafe impl NSTokenFieldDelegate { + #[optional] + #[method_id(@__retain_semantics Other tokenField:completionsForSubstring:indexOfToken:indexOfSelectedItem:)] + pub unsafe fn tokenField_completionsForSubstring_indexOfToken_indexOfSelectedItem( + &self, + tokenField: &NSTokenField, + substring: &NSString, + tokenIndex: NSInteger, + selectedIndex: *mut NSInteger, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other tokenField:shouldAddObjects:atIndex:)] + pub unsafe fn tokenField_shouldAddObjects_atIndex( + &self, + tokenField: &NSTokenField, + tokens: &NSArray, + index: NSUInteger, + ) -> Id; + + #[optional] + #[method_id(@__retain_semantics Other tokenField:displayStringForRepresentedObject:)] + pub unsafe fn tokenField_displayStringForRepresentedObject( + &self, + tokenField: &NSTokenField, + representedObject: &Object, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other tokenField:editingStringForRepresentedObject:)] + pub unsafe fn tokenField_editingStringForRepresentedObject( + &self, + tokenField: &NSTokenField, + representedObject: &Object, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other tokenField:representedObjectForEditingString:)] + pub unsafe fn tokenField_representedObjectForEditingString( + &self, + tokenField: &NSTokenField, + editingString: &NSString, + ) -> Option>; + + #[optional] + #[method(tokenField:writeRepresentedObjects:toPasteboard:)] + pub unsafe fn tokenField_writeRepresentedObjects_toPasteboard( + &self, + tokenField: &NSTokenField, + objects: &NSArray, + pboard: &NSPasteboard, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other tokenField:readFromPasteboard:)] + pub unsafe fn tokenField_readFromPasteboard( + &self, + tokenField: &NSTokenField, + pboard: &NSPasteboard, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other tokenField:menuForRepresentedObject:)] + pub unsafe fn tokenField_menuForRepresentedObject( + &self, + tokenField: &NSTokenField, + representedObject: &Object, + ) -> Option>; + + #[optional] + #[method(tokenField:hasMenuForRepresentedObject:)] + pub unsafe fn tokenField_hasMenuForRepresentedObject( + &self, + tokenField: &NSTokenField, + representedObject: &Object, + ) -> bool; + + #[optional] + #[method(tokenField:styleForRepresentedObject:)] + pub unsafe fn tokenField_styleForRepresentedObject( + &self, + tokenField: &NSTokenField, + representedObject: &Object, + ) -> NSTokenStyle; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTokenField; + + unsafe impl ClassType for NSTokenField { + type Super = NSTextField; + } +); + +extern_methods!( + unsafe impl NSTokenField { + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTokenFieldDelegate>); + + #[method(tokenStyle)] + pub unsafe fn tokenStyle(&self) -> NSTokenStyle; + + #[method(setTokenStyle:)] + pub unsafe fn setTokenStyle(&self, tokenStyle: NSTokenStyle); + + #[method(completionDelay)] + pub unsafe fn completionDelay(&self) -> NSTimeInterval; + + #[method(setCompletionDelay:)] + pub unsafe fn setCompletionDelay(&self, completionDelay: NSTimeInterval); + + #[method(defaultCompletionDelay)] + pub unsafe fn defaultCompletionDelay() -> NSTimeInterval; + + #[method_id(@__retain_semantics Other tokenizingCharacterSet)] + pub unsafe fn tokenizingCharacterSet(&self) -> Id; + + #[method(setTokenizingCharacterSet:)] + pub unsafe fn setTokenizingCharacterSet( + &self, + tokenizingCharacterSet: Option<&NSCharacterSet>, + ); + + #[method_id(@__retain_semantics Other defaultTokenizingCharacterSet)] + pub unsafe fn defaultTokenizingCharacterSet() -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTokenFieldCell.rs b/crates/icrate/src/generated/AppKit/NSTokenFieldCell.rs new file mode 100644 index 000000000..e8735e916 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTokenFieldCell.rs @@ -0,0 +1,159 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTokenStyle { + NSTokenStyleDefault = 0, + NSTokenStyleNone = 1, + NSTokenStyleRounded = 2, + NSTokenStyleSquared = 3, + NSTokenStylePlainSquared = 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTokenFieldCell; + + unsafe impl ClassType for NSTokenFieldCell { + type Super = NSTextFieldCell; + } +); + +extern_methods!( + unsafe impl NSTokenFieldCell { + #[method(tokenStyle)] + pub unsafe fn tokenStyle(&self) -> NSTokenStyle; + + #[method(setTokenStyle:)] + pub unsafe fn setTokenStyle(&self, tokenStyle: NSTokenStyle); + + #[method(completionDelay)] + pub unsafe fn completionDelay(&self) -> NSTimeInterval; + + #[method(setCompletionDelay:)] + pub unsafe fn setCompletionDelay(&self, completionDelay: NSTimeInterval); + + #[method(defaultCompletionDelay)] + pub unsafe fn defaultCompletionDelay() -> NSTimeInterval; + + #[method_id(@__retain_semantics Other tokenizingCharacterSet)] + pub unsafe fn tokenizingCharacterSet(&self) -> Id; + + #[method(setTokenizingCharacterSet:)] + pub unsafe fn setTokenizingCharacterSet( + &self, + tokenizingCharacterSet: Option<&NSCharacterSet>, + ); + + #[method_id(@__retain_semantics Other defaultTokenizingCharacterSet)] + pub unsafe fn defaultTokenizingCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTokenFieldCellDelegate>); + } +); + +extern_protocol!( + pub struct NSTokenFieldCellDelegate; + + unsafe impl NSTokenFieldCellDelegate { + #[optional] + #[method_id(@__retain_semantics Other tokenFieldCell:completionsForSubstring:indexOfToken:indexOfSelectedItem:)] + pub unsafe fn tokenFieldCell_completionsForSubstring_indexOfToken_indexOfSelectedItem( + &self, + tokenFieldCell: &NSTokenFieldCell, + substring: &NSString, + tokenIndex: NSInteger, + selectedIndex: NonNull, + ) -> Id; + + #[optional] + #[method_id(@__retain_semantics Other tokenFieldCell:shouldAddObjects:atIndex:)] + pub unsafe fn tokenFieldCell_shouldAddObjects_atIndex( + &self, + tokenFieldCell: &NSTokenFieldCell, + tokens: &NSArray, + index: NSUInteger, + ) -> Id; + + #[optional] + #[method_id(@__retain_semantics Other tokenFieldCell:displayStringForRepresentedObject:)] + pub unsafe fn tokenFieldCell_displayStringForRepresentedObject( + &self, + tokenFieldCell: &NSTokenFieldCell, + representedObject: &Object, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other tokenFieldCell:editingStringForRepresentedObject:)] + pub unsafe fn tokenFieldCell_editingStringForRepresentedObject( + &self, + tokenFieldCell: &NSTokenFieldCell, + representedObject: &Object, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other tokenFieldCell:representedObjectForEditingString:)] + pub unsafe fn tokenFieldCell_representedObjectForEditingString( + &self, + tokenFieldCell: &NSTokenFieldCell, + editingString: &NSString, + ) -> Option>; + + #[optional] + #[method(tokenFieldCell:writeRepresentedObjects:toPasteboard:)] + pub unsafe fn tokenFieldCell_writeRepresentedObjects_toPasteboard( + &self, + tokenFieldCell: &NSTokenFieldCell, + objects: &NSArray, + pboard: &NSPasteboard, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other tokenFieldCell:readFromPasteboard:)] + pub unsafe fn tokenFieldCell_readFromPasteboard( + &self, + tokenFieldCell: &NSTokenFieldCell, + pboard: &NSPasteboard, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other tokenFieldCell:menuForRepresentedObject:)] + pub unsafe fn tokenFieldCell_menuForRepresentedObject( + &self, + tokenFieldCell: &NSTokenFieldCell, + representedObject: &Object, + ) -> Option>; + + #[optional] + #[method(tokenFieldCell:hasMenuForRepresentedObject:)] + pub unsafe fn tokenFieldCell_hasMenuForRepresentedObject( + &self, + tokenFieldCell: &NSTokenFieldCell, + representedObject: &Object, + ) -> bool; + + #[optional] + #[method(tokenFieldCell:styleForRepresentedObject:)] + pub unsafe fn tokenFieldCell_styleForRepresentedObject( + &self, + tokenFieldCell: &NSTokenFieldCell, + representedObject: &Object, + ) -> NSTokenStyle; + } +); + +extern_static!(NSDefaultTokenStyle: NSTokenStyle = NSTokenStyleDefault); + +extern_static!(NSPlainTextTokenStyle: NSTokenStyle = NSTokenStyleNone); + +extern_static!(NSRoundedTokenStyle: NSTokenStyle = NSTokenStyleRounded); diff --git a/crates/icrate/src/generated/AppKit/NSToolbar.rs b/crates/icrate/src/generated/AppKit/NSToolbar.rs new file mode 100644 index 000000000..85d60d04e --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSToolbar.rs @@ -0,0 +1,231 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSToolbarIdentifier = NSString; + +pub type NSToolbarItemIdentifier = NSString; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSToolbarDisplayMode { + NSToolbarDisplayModeDefault = 0, + NSToolbarDisplayModeIconAndLabel = 1, + NSToolbarDisplayModeIconOnly = 2, + NSToolbarDisplayModeLabelOnly = 3, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSToolbarSizeMode { + NSToolbarSizeModeDefault = 0, + NSToolbarSizeModeRegular = 1, + NSToolbarSizeModeSmall = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSToolbar; + + unsafe impl ClassType for NSToolbar { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSToolbar { + #[method_id(@__retain_semantics Init initWithIdentifier:)] + pub unsafe fn initWithIdentifier( + this: Option>, + identifier: &NSToolbarIdentifier, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(insertItemWithItemIdentifier:atIndex:)] + pub unsafe fn insertItemWithItemIdentifier_atIndex( + &self, + itemIdentifier: &NSToolbarItemIdentifier, + index: NSInteger, + ); + + #[method(removeItemAtIndex:)] + pub unsafe fn removeItemAtIndex(&self, index: NSInteger); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSToolbarDelegate>); + + #[method(isVisible)] + pub unsafe fn isVisible(&self) -> bool; + + #[method(setVisible:)] + pub unsafe fn setVisible(&self, visible: bool); + + #[method(runCustomizationPalette:)] + pub unsafe fn runCustomizationPalette(&self, sender: Option<&Object>); + + #[method(customizationPaletteIsRunning)] + pub unsafe fn customizationPaletteIsRunning(&self) -> bool; + + #[method(displayMode)] + pub unsafe fn displayMode(&self) -> NSToolbarDisplayMode; + + #[method(setDisplayMode:)] + pub unsafe fn setDisplayMode(&self, displayMode: NSToolbarDisplayMode); + + #[method_id(@__retain_semantics Other selectedItemIdentifier)] + pub unsafe fn selectedItemIdentifier(&self) -> Option>; + + #[method(setSelectedItemIdentifier:)] + pub unsafe fn setSelectedItemIdentifier( + &self, + selectedItemIdentifier: Option<&NSToolbarItemIdentifier>, + ); + + #[method(sizeMode)] + pub unsafe fn sizeMode(&self) -> NSToolbarSizeMode; + + #[method(setSizeMode:)] + pub unsafe fn setSizeMode(&self, sizeMode: NSToolbarSizeMode); + + #[method(showsBaselineSeparator)] + pub unsafe fn showsBaselineSeparator(&self) -> bool; + + #[method(setShowsBaselineSeparator:)] + pub unsafe fn setShowsBaselineSeparator(&self, showsBaselineSeparator: bool); + + #[method(allowsUserCustomization)] + pub unsafe fn allowsUserCustomization(&self) -> bool; + + #[method(setAllowsUserCustomization:)] + pub unsafe fn setAllowsUserCustomization(&self, allowsUserCustomization: bool); + + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Id; + + #[method_id(@__retain_semantics Other items)] + pub unsafe fn items(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other visibleItems)] + pub unsafe fn visibleItems(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other centeredItemIdentifier)] + pub unsafe fn centeredItemIdentifier(&self) -> Option>; + + #[method(setCenteredItemIdentifier:)] + pub unsafe fn setCenteredItemIdentifier( + &self, + centeredItemIdentifier: Option<&NSToolbarItemIdentifier>, + ); + + #[method(autosavesConfiguration)] + pub unsafe fn autosavesConfiguration(&self) -> bool; + + #[method(setAutosavesConfiguration:)] + pub unsafe fn setAutosavesConfiguration(&self, autosavesConfiguration: bool); + + #[method(setConfigurationFromDictionary:)] + pub unsafe fn setConfigurationFromDictionary( + &self, + configDict: &NSDictionary, + ); + + #[method_id(@__retain_semantics Other configurationDictionary)] + pub unsafe fn configurationDictionary(&self) -> Id, Shared>; + + #[method(validateVisibleItems)] + pub unsafe fn validateVisibleItems(&self); + + #[method(allowsExtensionItems)] + pub unsafe fn allowsExtensionItems(&self) -> bool; + + #[method(setAllowsExtensionItems:)] + pub unsafe fn setAllowsExtensionItems(&self, allowsExtensionItems: bool); + } +); + +extern_protocol!( + pub struct NSToolbarDelegate; + + unsafe impl NSToolbarDelegate { + #[optional] + #[method_id(@__retain_semantics Other toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:)] + pub unsafe fn toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar( + &self, + toolbar: &NSToolbar, + itemIdentifier: &NSToolbarItemIdentifier, + flag: bool, + ) -> Option>; + + #[optional] + #[method_id(@__retain_semantics Other toolbarDefaultItemIdentifiers:)] + pub unsafe fn toolbarDefaultItemIdentifiers( + &self, + toolbar: &NSToolbar, + ) -> Id, Shared>; + + #[optional] + #[method_id(@__retain_semantics Other toolbarAllowedItemIdentifiers:)] + pub unsafe fn toolbarAllowedItemIdentifiers( + &self, + toolbar: &NSToolbar, + ) -> Id, Shared>; + + #[optional] + #[method_id(@__retain_semantics Other toolbarSelectableItemIdentifiers:)] + pub unsafe fn toolbarSelectableItemIdentifiers( + &self, + toolbar: &NSToolbar, + ) -> Id, Shared>; + + #[optional] + #[method(toolbarWillAddItem:)] + pub unsafe fn toolbarWillAddItem(&self, notification: &NSNotification); + + #[optional] + #[method(toolbarDidRemoveItem:)] + pub unsafe fn toolbarDidRemoveItem(&self, notification: &NSNotification); + } +); + +extern_static!(NSToolbarWillAddItemNotification: &'static NSNotificationName); + +extern_static!(NSToolbarDidRemoveItemNotification: &'static NSNotificationName); + +extern_methods!( + /// NSDeprecated + unsafe impl NSToolbar { + #[method_id(@__retain_semantics Other fullScreenAccessoryView)] + pub unsafe fn fullScreenAccessoryView(&self) -> Option>; + + #[method(setFullScreenAccessoryView:)] + pub unsafe fn setFullScreenAccessoryView(&self, fullScreenAccessoryView: Option<&NSView>); + + #[method(fullScreenAccessoryViewMinHeight)] + pub unsafe fn fullScreenAccessoryViewMinHeight(&self) -> CGFloat; + + #[method(setFullScreenAccessoryViewMinHeight:)] + pub unsafe fn setFullScreenAccessoryViewMinHeight( + &self, + fullScreenAccessoryViewMinHeight: CGFloat, + ); + + #[method(fullScreenAccessoryViewMaxHeight)] + pub unsafe fn fullScreenAccessoryViewMaxHeight(&self) -> CGFloat; + + #[method(setFullScreenAccessoryViewMaxHeight:)] + pub unsafe fn setFullScreenAccessoryViewMaxHeight( + &self, + fullScreenAccessoryViewMaxHeight: CGFloat, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSToolbarItem.rs b/crates/icrate/src/generated/AppKit/NSToolbarItem.rs new file mode 100644 index 000000000..bc67d0287 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSToolbarItem.rs @@ -0,0 +1,205 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSToolbarItemVisibilityPriority = NSInteger; + +extern_static!(NSToolbarItemVisibilityPriorityStandard: NSToolbarItemVisibilityPriority = 0); + +extern_static!(NSToolbarItemVisibilityPriorityLow: NSToolbarItemVisibilityPriority = -1000); + +extern_static!(NSToolbarItemVisibilityPriorityHigh: NSToolbarItemVisibilityPriority = 1000); + +extern_static!(NSToolbarItemVisibilityPriorityUser: NSToolbarItemVisibilityPriority = 2000); + +extern_class!( + #[derive(Debug)] + pub struct NSToolbarItem; + + unsafe impl ClassType for NSToolbarItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSToolbarItem { + #[method_id(@__retain_semantics Init initWithItemIdentifier:)] + pub unsafe fn initWithItemIdentifier( + this: Option>, + itemIdentifier: &NSToolbarItemIdentifier, + ) -> Id; + + #[method_id(@__retain_semantics Other itemIdentifier)] + pub unsafe fn itemIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Other toolbar)] + pub unsafe fn toolbar(&self) -> Option>; + + #[method_id(@__retain_semantics Other label)] + pub unsafe fn label(&self) -> Id; + + #[method(setLabel:)] + pub unsafe fn setLabel(&self, label: &NSString); + + #[method_id(@__retain_semantics Other paletteLabel)] + pub unsafe fn paletteLabel(&self) -> Id; + + #[method(setPaletteLabel:)] + pub unsafe fn setPaletteLabel(&self, paletteLabel: &NSString); + + #[method_id(@__retain_semantics Other toolTip)] + pub unsafe fn toolTip(&self) -> Option>; + + #[method(setToolTip:)] + pub unsafe fn setToolTip(&self, toolTip: Option<&NSString>); + + #[method_id(@__retain_semantics Other menuFormRepresentation)] + pub unsafe fn menuFormRepresentation(&self) -> Option>; + + #[method(setMenuFormRepresentation:)] + pub unsafe fn setMenuFormRepresentation(&self, menuFormRepresentation: Option<&NSMenuItem>); + + #[method(tag)] + pub unsafe fn tag(&self) -> NSInteger; + + #[method(setTag:)] + pub unsafe fn setTag(&self, tag: NSInteger); + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(setAction:)] + pub unsafe fn setAction(&self, action: OptionSel); + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(setEnabled:)] + pub unsafe fn setEnabled(&self, enabled: bool); + + #[method_id(@__retain_semantics Other image)] + pub unsafe fn image(&self) -> Option>; + + #[method(setImage:)] + pub unsafe fn setImage(&self, image: Option<&NSImage>); + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + + #[method(isBordered)] + pub unsafe fn isBordered(&self) -> bool; + + #[method(setBordered:)] + pub unsafe fn setBordered(&self, bordered: bool); + + #[method(isNavigational)] + pub unsafe fn isNavigational(&self) -> bool; + + #[method(setNavigational:)] + pub unsafe fn setNavigational(&self, navigational: bool); + + #[method_id(@__retain_semantics Other view)] + pub unsafe fn view(&self) -> Option>; + + #[method(setView:)] + pub unsafe fn setView(&self, view: Option<&NSView>); + + #[method(minSize)] + pub unsafe fn minSize(&self) -> NSSize; + + #[method(setMinSize:)] + pub unsafe fn setMinSize(&self, minSize: NSSize); + + #[method(maxSize)] + pub unsafe fn maxSize(&self) -> NSSize; + + #[method(setMaxSize:)] + pub unsafe fn setMaxSize(&self, maxSize: NSSize); + + #[method(visibilityPriority)] + pub unsafe fn visibilityPriority(&self) -> NSToolbarItemVisibilityPriority; + + #[method(setVisibilityPriority:)] + pub unsafe fn setVisibilityPriority( + &self, + visibilityPriority: NSToolbarItemVisibilityPriority, + ); + + #[method(validate)] + pub unsafe fn validate(&self); + + #[method(autovalidates)] + pub unsafe fn autovalidates(&self) -> bool; + + #[method(setAutovalidates:)] + pub unsafe fn setAutovalidates(&self, autovalidates: bool); + + #[method(allowsDuplicatesInToolbar)] + pub unsafe fn allowsDuplicatesInToolbar(&self) -> bool; + } +); + +extern_methods!( + unsafe impl NSToolbarItem {} +); + +extern_protocol!( + pub struct NSToolbarItemValidation; + + unsafe impl NSToolbarItemValidation { + #[method(validateToolbarItem:)] + pub unsafe fn validateToolbarItem(&self, item: &NSToolbarItem) -> bool; + } +); + +extern_methods!( + /// NSToolbarItemValidation + unsafe impl NSObject { + #[method(validateToolbarItem:)] + pub unsafe fn validateToolbarItem(&self, item: &NSToolbarItem) -> bool; + } +); + +extern_protocol!( + pub struct NSCloudSharingValidation; + + unsafe impl NSCloudSharingValidation { + #[method_id(@__retain_semantics Other cloudShareForUserInterfaceItem:)] + pub unsafe fn cloudShareForUserInterfaceItem( + &self, + item: &NSValidatedUserInterfaceItem, + ) -> Option>; + } +); + +extern_static!(NSToolbarSeparatorItemIdentifier: &'static NSToolbarItemIdentifier); + +extern_static!(NSToolbarSpaceItemIdentifier: &'static NSToolbarItemIdentifier); + +extern_static!(NSToolbarFlexibleSpaceItemIdentifier: &'static NSToolbarItemIdentifier); + +extern_static!(NSToolbarShowColorsItemIdentifier: &'static NSToolbarItemIdentifier); + +extern_static!(NSToolbarShowFontsItemIdentifier: &'static NSToolbarItemIdentifier); + +extern_static!(NSToolbarCustomizeToolbarItemIdentifier: &'static NSToolbarItemIdentifier); + +extern_static!(NSToolbarPrintItemIdentifier: &'static NSToolbarItemIdentifier); + +extern_static!(NSToolbarToggleSidebarItemIdentifier: &'static NSToolbarItemIdentifier); + +extern_static!(NSToolbarCloudSharingItemIdentifier: &'static NSToolbarItemIdentifier); + +extern_static!(NSToolbarSidebarTrackingSeparatorItemIdentifier: &'static NSToolbarItemIdentifier); diff --git a/crates/icrate/src/generated/AppKit/NSToolbarItemGroup.rs b/crates/icrate/src/generated/AppKit/NSToolbarItemGroup.rs new file mode 100644 index 000000000..e4882a8ba --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSToolbarItemGroup.rs @@ -0,0 +1,90 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSToolbarItemGroupSelectionMode { + NSToolbarItemGroupSelectionModeSelectOne = 0, + NSToolbarItemGroupSelectionModeSelectAny = 1, + NSToolbarItemGroupSelectionModeMomentary = 2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSToolbarItemGroupControlRepresentation { + NSToolbarItemGroupControlRepresentationAutomatic = 0, + NSToolbarItemGroupControlRepresentationExpanded = 1, + NSToolbarItemGroupControlRepresentationCollapsed = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSToolbarItemGroup; + + unsafe impl ClassType for NSToolbarItemGroup { + type Super = NSToolbarItem; + } +); + +extern_methods!( + unsafe impl NSToolbarItemGroup { + #[method_id(@__retain_semantics Other groupWithItemIdentifier:titles:selectionMode:labels:target:action:)] + pub unsafe fn groupWithItemIdentifier_titles_selectionMode_labels_target_action( + itemIdentifier: &NSToolbarItemIdentifier, + titles: &NSArray, + selectionMode: NSToolbarItemGroupSelectionMode, + labels: Option<&NSArray>, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Other groupWithItemIdentifier:images:selectionMode:labels:target:action:)] + pub unsafe fn groupWithItemIdentifier_images_selectionMode_labels_target_action( + itemIdentifier: &NSToolbarItemIdentifier, + images: &NSArray, + selectionMode: NSToolbarItemGroupSelectionMode, + labels: Option<&NSArray>, + target: Option<&Object>, + action: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Other subitems)] + pub unsafe fn subitems(&self) -> Id, Shared>; + + #[method(setSubitems:)] + pub unsafe fn setSubitems(&self, subitems: &NSArray); + + #[method(controlRepresentation)] + pub unsafe fn controlRepresentation(&self) -> NSToolbarItemGroupControlRepresentation; + + #[method(setControlRepresentation:)] + pub unsafe fn setControlRepresentation( + &self, + controlRepresentation: NSToolbarItemGroupControlRepresentation, + ); + + #[method(selectionMode)] + pub unsafe fn selectionMode(&self) -> NSToolbarItemGroupSelectionMode; + + #[method(setSelectionMode:)] + pub unsafe fn setSelectionMode(&self, selectionMode: NSToolbarItemGroupSelectionMode); + + #[method(selectedIndex)] + pub unsafe fn selectedIndex(&self) -> NSInteger; + + #[method(setSelectedIndex:)] + pub unsafe fn setSelectedIndex(&self, selectedIndex: NSInteger); + + #[method(setSelected:atIndex:)] + pub unsafe fn setSelected_atIndex(&self, selected: bool, index: NSInteger); + + #[method(isSelectedAtIndex:)] + pub unsafe fn isSelectedAtIndex(&self, index: NSInteger) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTouch.rs b/crates/icrate/src/generated/AppKit/NSTouch.rs new file mode 100644 index 000000000..7bca0fd13 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTouch.rs @@ -0,0 +1,86 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTouchPhase { + NSTouchPhaseBegan = 1 << 0, + NSTouchPhaseMoved = 1 << 1, + NSTouchPhaseStationary = 1 << 2, + NSTouchPhaseEnded = 1 << 3, + NSTouchPhaseCancelled = 1 << 4, + NSTouchPhaseTouching = NSTouchPhaseBegan | NSTouchPhaseMoved | NSTouchPhaseStationary, + NSTouchPhaseAny = 18446744073709551615, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTouchType { + NSTouchTypeDirect = 0, + NSTouchTypeIndirect = 1, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTouchTypeMask { + NSTouchTypeMaskDirect = 1 << NSTouchTypeDirect, + NSTouchTypeMaskIndirect = 1 << NSTouchTypeIndirect, + } +); + +inline_fn!( + pub unsafe fn NSTouchTypeMaskFromType(type_: NSTouchType) -> NSTouchTypeMask { + todo!() + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTouch; + + unsafe impl ClassType for NSTouch { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTouch { + #[method_id(@__retain_semantics Other identity)] + pub unsafe fn identity(&self) -> Id; + + #[method(phase)] + pub unsafe fn phase(&self) -> NSTouchPhase; + + #[method(normalizedPosition)] + pub unsafe fn normalizedPosition(&self) -> NSPoint; + + #[method(isResting)] + pub unsafe fn isResting(&self) -> bool; + + #[method_id(@__retain_semantics Other device)] + pub unsafe fn device(&self) -> Option>; + + #[method(deviceSize)] + pub unsafe fn deviceSize(&self) -> NSSize; + } +); + +extern_methods!( + /// NSTouchBar + unsafe impl NSTouch { + #[method(type)] + pub unsafe fn type_(&self) -> NSTouchType; + + #[method(locationInView:)] + pub unsafe fn locationInView(&self, view: Option<&NSView>) -> NSPoint; + + #[method(previousLocationInView:)] + pub unsafe fn previousLocationInView(&self, view: Option<&NSView>) -> NSPoint; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTouchBar.rs b/crates/icrate/src/generated/AppKit/NSTouchBar.rs new file mode 100644 index 000000000..231a523c4 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTouchBar.rs @@ -0,0 +1,182 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSTouchBarCustomizationIdentifier = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSTouchBar; + + unsafe impl ClassType for NSTouchBar { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTouchBar { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other customizationIdentifier)] + pub unsafe fn customizationIdentifier( + &self, + ) -> Option>; + + #[method(setCustomizationIdentifier:)] + pub unsafe fn setCustomizationIdentifier( + &self, + customizationIdentifier: Option<&NSTouchBarCustomizationIdentifier>, + ); + + #[method_id(@__retain_semantics Other customizationAllowedItemIdentifiers)] + pub unsafe fn customizationAllowedItemIdentifiers( + &self, + ) -> Id, Shared>; + + #[method(setCustomizationAllowedItemIdentifiers:)] + pub unsafe fn setCustomizationAllowedItemIdentifiers( + &self, + customizationAllowedItemIdentifiers: &NSArray, + ); + + #[method_id(@__retain_semantics Other customizationRequiredItemIdentifiers)] + pub unsafe fn customizationRequiredItemIdentifiers( + &self, + ) -> Id, Shared>; + + #[method(setCustomizationRequiredItemIdentifiers:)] + pub unsafe fn setCustomizationRequiredItemIdentifiers( + &self, + customizationRequiredItemIdentifiers: &NSArray, + ); + + #[method_id(@__retain_semantics Other defaultItemIdentifiers)] + pub unsafe fn defaultItemIdentifiers( + &self, + ) -> Id, Shared>; + + #[method(setDefaultItemIdentifiers:)] + pub unsafe fn setDefaultItemIdentifiers( + &self, + defaultItemIdentifiers: &NSArray, + ); + + #[method_id(@__retain_semantics Other itemIdentifiers)] + pub unsafe fn itemIdentifiers(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other principalItemIdentifier)] + pub unsafe fn principalItemIdentifier( + &self, + ) -> Option>; + + #[method(setPrincipalItemIdentifier:)] + pub unsafe fn setPrincipalItemIdentifier( + &self, + principalItemIdentifier: Option<&NSTouchBarItemIdentifier>, + ); + + #[method_id(@__retain_semantics Other escapeKeyReplacementItemIdentifier)] + pub unsafe fn escapeKeyReplacementItemIdentifier( + &self, + ) -> Option>; + + #[method(setEscapeKeyReplacementItemIdentifier:)] + pub unsafe fn setEscapeKeyReplacementItemIdentifier( + &self, + escapeKeyReplacementItemIdentifier: Option<&NSTouchBarItemIdentifier>, + ); + + #[method_id(@__retain_semantics Other templateItems)] + pub unsafe fn templateItems(&self) -> Id, Shared>; + + #[method(setTemplateItems:)] + pub unsafe fn setTemplateItems(&self, templateItems: &NSSet); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSTouchBarDelegate>); + + #[method_id(@__retain_semantics Other itemForIdentifier:)] + pub unsafe fn itemForIdentifier( + &self, + identifier: &NSTouchBarItemIdentifier, + ) -> Option>; + + #[method(isVisible)] + pub unsafe fn isVisible(&self) -> bool; + + #[method(isAutomaticCustomizeTouchBarMenuItemEnabled)] + pub unsafe fn isAutomaticCustomizeTouchBarMenuItemEnabled() -> bool; + + #[method(setAutomaticCustomizeTouchBarMenuItemEnabled:)] + pub unsafe fn setAutomaticCustomizeTouchBarMenuItemEnabled( + automaticCustomizeTouchBarMenuItemEnabled: bool, + ); + } +); + +extern_protocol!( + pub struct NSTouchBarDelegate; + + unsafe impl NSTouchBarDelegate { + #[optional] + #[method_id(@__retain_semantics Other touchBar:makeItemForIdentifier:)] + pub unsafe fn touchBar_makeItemForIdentifier( + &self, + touchBar: &NSTouchBar, + identifier: &NSTouchBarItemIdentifier, + ) -> Option>; + } +); + +extern_protocol!( + pub struct NSTouchBarProvider; + + unsafe impl NSTouchBarProvider { + #[method_id(@__retain_semantics Other touchBar)] + pub unsafe fn touchBar(&self) -> Option>; + } +); + +extern_methods!( + /// NSTouchBarProvider + unsafe impl NSResponder { + #[method_id(@__retain_semantics Other touchBar)] + pub unsafe fn touchBar(&self) -> Option>; + + #[method(setTouchBar:)] + pub unsafe fn setTouchBar(&self, touchBar: Option<&NSTouchBar>); + + #[method_id(@__retain_semantics Other makeTouchBar)] + pub unsafe fn makeTouchBar(&self) -> Option>; + } +); + +extern_methods!( + /// NSTouchBarCustomization + unsafe impl NSApplication { + #[method(isAutomaticCustomizeTouchBarMenuItemEnabled)] + pub unsafe fn isAutomaticCustomizeTouchBarMenuItemEnabled(&self) -> bool; + + #[method(setAutomaticCustomizeTouchBarMenuItemEnabled:)] + pub unsafe fn setAutomaticCustomizeTouchBarMenuItemEnabled( + &self, + automaticCustomizeTouchBarMenuItemEnabled: bool, + ); + + #[method(toggleTouchBarCustomizationPalette:)] + pub unsafe fn toggleTouchBarCustomizationPalette(&self, sender: Option<&Object>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTouchBarItem.rs b/crates/icrate/src/generated/AppKit/NSTouchBarItem.rs new file mode 100644 index 000000000..dbffb161c --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTouchBarItem.rs @@ -0,0 +1,73 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSTouchBarItemIdentifier = NSString; + +pub type NSTouchBarItemPriority = c_float; + +extern_static!(NSTouchBarItemPriorityHigh: NSTouchBarItemPriority = 1000); + +extern_static!(NSTouchBarItemPriorityNormal: NSTouchBarItemPriority = 0); + +extern_static!(NSTouchBarItemPriorityLow: NSTouchBarItemPriority = -1000); + +extern_class!( + #[derive(Debug)] + pub struct NSTouchBarItem; + + unsafe impl ClassType for NSTouchBarItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTouchBarItem { + #[method_id(@__retain_semantics Init initWithIdentifier:)] + pub unsafe fn initWithIdentifier( + this: Option>, + identifier: &NSTouchBarItemIdentifier, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Id; + + #[method(visibilityPriority)] + pub unsafe fn visibilityPriority(&self) -> NSTouchBarItemPriority; + + #[method(setVisibilityPriority:)] + pub unsafe fn setVisibilityPriority(&self, visibilityPriority: NSTouchBarItemPriority); + + #[method_id(@__retain_semantics Other view)] + pub unsafe fn view(&self) -> Option>; + + #[method_id(@__retain_semantics Other viewController)] + pub unsafe fn viewController(&self) -> Option>; + + #[method_id(@__retain_semantics Other customizationLabel)] + pub unsafe fn customizationLabel(&self) -> Id; + + #[method(isVisible)] + pub unsafe fn isVisible(&self) -> bool; + } +); + +extern_static!(NSTouchBarItemIdentifierFixedSpaceSmall: &'static NSTouchBarItemIdentifier); + +extern_static!(NSTouchBarItemIdentifierFixedSpaceLarge: &'static NSTouchBarItemIdentifier); + +extern_static!(NSTouchBarItemIdentifierFlexibleSpace: &'static NSTouchBarItemIdentifier); + +extern_static!(NSTouchBarItemIdentifierOtherItemsProxy: &'static NSTouchBarItemIdentifier); diff --git a/crates/icrate/src/generated/AppKit/NSTrackingArea.rs b/crates/icrate/src/generated/AppKit/NSTrackingArea.rs new file mode 100644 index 000000000..d95a6f3b6 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTrackingArea.rs @@ -0,0 +1,56 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTrackingAreaOptions { + NSTrackingMouseEnteredAndExited = 0x01, + NSTrackingMouseMoved = 0x02, + NSTrackingCursorUpdate = 0x04, + NSTrackingActiveWhenFirstResponder = 0x10, + NSTrackingActiveInKeyWindow = 0x20, + NSTrackingActiveInActiveApp = 0x40, + NSTrackingActiveAlways = 0x80, + NSTrackingAssumeInside = 0x100, + NSTrackingInVisibleRect = 0x200, + NSTrackingEnabledDuringMouseDrag = 0x400, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTrackingArea; + + unsafe impl ClassType for NSTrackingArea { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTrackingArea { + #[method_id(@__retain_semantics Init initWithRect:options:owner:userInfo:)] + pub unsafe fn initWithRect_options_owner_userInfo( + this: Option>, + rect: NSRect, + options: NSTrackingAreaOptions, + owner: Option<&Object>, + userInfo: Option<&NSDictionary>, + ) -> Id; + + #[method(rect)] + pub unsafe fn rect(&self) -> NSRect; + + #[method(options)] + pub unsafe fn options(&self) -> NSTrackingAreaOptions; + + #[method_id(@__retain_semantics Other owner)] + pub unsafe fn owner(&self) -> Option>; + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option, Shared>>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTrackingSeparatorToolbarItem.rs b/crates/icrate/src/generated/AppKit/NSTrackingSeparatorToolbarItem.rs new file mode 100644 index 000000000..41a47d077 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTrackingSeparatorToolbarItem.rs @@ -0,0 +1,38 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTrackingSeparatorToolbarItem; + + unsafe impl ClassType for NSTrackingSeparatorToolbarItem { + type Super = NSToolbarItem; + } +); + +extern_methods!( + unsafe impl NSTrackingSeparatorToolbarItem { + #[method_id(@__retain_semantics Other trackingSeparatorToolbarItemWithIdentifier:splitView:dividerIndex:)] + pub unsafe fn trackingSeparatorToolbarItemWithIdentifier_splitView_dividerIndex( + identifier: &NSToolbarItemIdentifier, + splitView: &NSSplitView, + dividerIndex: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other splitView)] + pub unsafe fn splitView(&self) -> Id; + + #[method(setSplitView:)] + pub unsafe fn setSplitView(&self, splitView: &NSSplitView); + + #[method(dividerIndex)] + pub unsafe fn dividerIndex(&self) -> NSInteger; + + #[method(setDividerIndex:)] + pub unsafe fn setDividerIndex(&self, dividerIndex: NSInteger); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTreeController.rs b/crates/icrate/src/generated/AppKit/NSTreeController.rs new file mode 100644 index 000000000..15a84e6a9 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTreeController.rs @@ -0,0 +1,176 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTreeController; + + unsafe impl ClassType for NSTreeController { + type Super = NSObjectController; + } +); + +extern_methods!( + unsafe impl NSTreeController { + #[method(rearrangeObjects)] + pub unsafe fn rearrangeObjects(&self); + + #[method_id(@__retain_semantics Other arrangedObjects)] + pub unsafe fn arrangedObjects(&self) -> Id; + + #[method_id(@__retain_semantics Other childrenKeyPath)] + pub unsafe fn childrenKeyPath(&self) -> Option>; + + #[method(setChildrenKeyPath:)] + pub unsafe fn setChildrenKeyPath(&self, childrenKeyPath: Option<&NSString>); + + #[method_id(@__retain_semantics Other countKeyPath)] + pub unsafe fn countKeyPath(&self) -> Option>; + + #[method(setCountKeyPath:)] + pub unsafe fn setCountKeyPath(&self, countKeyPath: Option<&NSString>); + + #[method_id(@__retain_semantics Other leafKeyPath)] + pub unsafe fn leafKeyPath(&self) -> Option>; + + #[method(setLeafKeyPath:)] + pub unsafe fn setLeafKeyPath(&self, leafKeyPath: Option<&NSString>); + + #[method_id(@__retain_semantics Other sortDescriptors)] + pub unsafe fn sortDescriptors(&self) -> Id, Shared>; + + #[method(setSortDescriptors:)] + pub unsafe fn setSortDescriptors(&self, sortDescriptors: &NSArray); + + #[method_id(@__retain_semantics Other content)] + pub unsafe fn content(&self) -> Option>; + + #[method(setContent:)] + pub unsafe fn setContent(&self, content: Option<&Object>); + + #[method(add:)] + pub unsafe fn add(&self, sender: Option<&Object>); + + #[method(remove:)] + pub unsafe fn remove(&self, sender: Option<&Object>); + + #[method(addChild:)] + pub unsafe fn addChild(&self, sender: Option<&Object>); + + #[method(insert:)] + pub unsafe fn insert(&self, sender: Option<&Object>); + + #[method(insertChild:)] + pub unsafe fn insertChild(&self, sender: Option<&Object>); + + #[method(canInsert)] + pub unsafe fn canInsert(&self) -> bool; + + #[method(canInsertChild)] + pub unsafe fn canInsertChild(&self) -> bool; + + #[method(canAddChild)] + pub unsafe fn canAddChild(&self) -> bool; + + #[method(insertObject:atArrangedObjectIndexPath:)] + pub unsafe fn insertObject_atArrangedObjectIndexPath( + &self, + object: Option<&Object>, + indexPath: &NSIndexPath, + ); + + #[method(insertObjects:atArrangedObjectIndexPaths:)] + pub unsafe fn insertObjects_atArrangedObjectIndexPaths( + &self, + objects: &NSArray, + indexPaths: &NSArray, + ); + + #[method(removeObjectAtArrangedObjectIndexPath:)] + pub unsafe fn removeObjectAtArrangedObjectIndexPath(&self, indexPath: &NSIndexPath); + + #[method(removeObjectsAtArrangedObjectIndexPaths:)] + pub unsafe fn removeObjectsAtArrangedObjectIndexPaths( + &self, + indexPaths: &NSArray, + ); + + #[method(avoidsEmptySelection)] + pub unsafe fn avoidsEmptySelection(&self) -> bool; + + #[method(setAvoidsEmptySelection:)] + pub unsafe fn setAvoidsEmptySelection(&self, avoidsEmptySelection: bool); + + #[method(preservesSelection)] + pub unsafe fn preservesSelection(&self) -> bool; + + #[method(setPreservesSelection:)] + pub unsafe fn setPreservesSelection(&self, preservesSelection: bool); + + #[method(selectsInsertedObjects)] + pub unsafe fn selectsInsertedObjects(&self) -> bool; + + #[method(setSelectsInsertedObjects:)] + pub unsafe fn setSelectsInsertedObjects(&self, selectsInsertedObjects: bool); + + #[method(alwaysUsesMultipleValuesMarker)] + pub unsafe fn alwaysUsesMultipleValuesMarker(&self) -> bool; + + #[method(setAlwaysUsesMultipleValuesMarker:)] + pub unsafe fn setAlwaysUsesMultipleValuesMarker( + &self, + alwaysUsesMultipleValuesMarker: bool, + ); + + #[method_id(@__retain_semantics Other selectedObjects)] + pub unsafe fn selectedObjects(&self) -> Id; + + #[method(setSelectionIndexPaths:)] + pub unsafe fn setSelectionIndexPaths(&self, indexPaths: &NSArray) -> bool; + + #[method_id(@__retain_semantics Other selectionIndexPaths)] + pub unsafe fn selectionIndexPaths(&self) -> Id, Shared>; + + #[method(setSelectionIndexPath:)] + pub unsafe fn setSelectionIndexPath(&self, indexPath: Option<&NSIndexPath>) -> bool; + + #[method_id(@__retain_semantics Other selectionIndexPath)] + pub unsafe fn selectionIndexPath(&self) -> Option>; + + #[method(addSelectionIndexPaths:)] + pub unsafe fn addSelectionIndexPaths(&self, indexPaths: &NSArray) -> bool; + + #[method(removeSelectionIndexPaths:)] + pub unsafe fn removeSelectionIndexPaths(&self, indexPaths: &NSArray) -> bool; + + #[method_id(@__retain_semantics Other selectedNodes)] + pub unsafe fn selectedNodes(&self) -> Id, Shared>; + + #[method(moveNode:toIndexPath:)] + pub unsafe fn moveNode_toIndexPath(&self, node: &NSTreeNode, indexPath: &NSIndexPath); + + #[method(moveNodes:toIndexPath:)] + pub unsafe fn moveNodes_toIndexPath( + &self, + nodes: &NSArray, + startingIndexPath: &NSIndexPath, + ); + + #[method_id(@__retain_semantics Other childrenKeyPathForNode:)] + pub unsafe fn childrenKeyPathForNode( + &self, + node: &NSTreeNode, + ) -> Option>; + + #[method_id(@__retain_semantics Other countKeyPathForNode:)] + pub unsafe fn countKeyPathForNode(&self, node: &NSTreeNode) + -> Option>; + + #[method_id(@__retain_semantics Other leafKeyPathForNode:)] + pub unsafe fn leafKeyPathForNode(&self, node: &NSTreeNode) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTreeNode.rs b/crates/icrate/src/generated/AppKit/NSTreeNode.rs new file mode 100644 index 000000000..8c10f0fb8 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTreeNode.rs @@ -0,0 +1,61 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTreeNode; + + unsafe impl ClassType for NSTreeNode { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTreeNode { + #[method_id(@__retain_semantics Other treeNodeWithRepresentedObject:)] + pub unsafe fn treeNodeWithRepresentedObject( + modelObject: Option<&Object>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithRepresentedObject:)] + pub unsafe fn initWithRepresentedObject( + this: Option>, + modelObject: Option<&Object>, + ) -> Id; + + #[method_id(@__retain_semantics Other representedObject)] + pub unsafe fn representedObject(&self) -> Option>; + + #[method_id(@__retain_semantics Other indexPath)] + pub unsafe fn indexPath(&self) -> Id; + + #[method(isLeaf)] + pub unsafe fn isLeaf(&self) -> bool; + + #[method_id(@__retain_semantics Other childNodes)] + pub unsafe fn childNodes(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other mutableChildNodes)] + pub unsafe fn mutableChildNodes(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other descendantNodeAtIndexPath:)] + pub unsafe fn descendantNodeAtIndexPath( + &self, + indexPath: &NSIndexPath, + ) -> Option>; + + #[method_id(@__retain_semantics Other parentNode)] + pub unsafe fn parentNode(&self) -> Option>; + + #[method(sortWithSortDescriptors:recursively:)] + pub unsafe fn sortWithSortDescriptors_recursively( + &self, + sortDescriptors: &NSArray, + recursively: bool, + ); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSTypesetter.rs b/crates/icrate/src/generated/AppKit/NSTypesetter.rs new file mode 100644 index 000000000..7cf7f5fab --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSTypesetter.rs @@ -0,0 +1,359 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTypesetter; + + unsafe impl ClassType for NSTypesetter { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTypesetter { + #[method(usesFontLeading)] + pub unsafe fn usesFontLeading(&self) -> bool; + + #[method(setUsesFontLeading:)] + pub unsafe fn setUsesFontLeading(&self, usesFontLeading: bool); + + #[method(typesetterBehavior)] + pub unsafe fn typesetterBehavior(&self) -> NSTypesetterBehavior; + + #[method(setTypesetterBehavior:)] + pub unsafe fn setTypesetterBehavior(&self, typesetterBehavior: NSTypesetterBehavior); + + #[method(hyphenationFactor)] + pub unsafe fn hyphenationFactor(&self) -> c_float; + + #[method(setHyphenationFactor:)] + pub unsafe fn setHyphenationFactor(&self, hyphenationFactor: c_float); + + #[method(lineFragmentPadding)] + pub unsafe fn lineFragmentPadding(&self) -> CGFloat; + + #[method(setLineFragmentPadding:)] + pub unsafe fn setLineFragmentPadding(&self, lineFragmentPadding: CGFloat); + + #[method_id(@__retain_semantics Other substituteFontForFont:)] + pub unsafe fn substituteFontForFont(&self, originalFont: &NSFont) -> Id; + + #[method_id(@__retain_semantics Other textTabForGlyphLocation:writingDirection:maxLocation:)] + pub unsafe fn textTabForGlyphLocation_writingDirection_maxLocation( + &self, + glyphLocation: CGFloat, + direction: NSWritingDirection, + maxLocation: CGFloat, + ) -> Option>; + + #[method(bidiProcessingEnabled)] + pub unsafe fn bidiProcessingEnabled(&self) -> bool; + + #[method(setBidiProcessingEnabled:)] + pub unsafe fn setBidiProcessingEnabled(&self, bidiProcessingEnabled: bool); + + #[method_id(@__retain_semantics Other attributedString)] + pub unsafe fn attributedString(&self) -> Option>; + + #[method(setAttributedString:)] + pub unsafe fn setAttributedString(&self, attributedString: Option<&NSAttributedString>); + + #[method(setParagraphGlyphRange:separatorGlyphRange:)] + pub unsafe fn setParagraphGlyphRange_separatorGlyphRange( + &self, + paragraphRange: NSRange, + paragraphSeparatorRange: NSRange, + ); + + #[method(paragraphGlyphRange)] + pub unsafe fn paragraphGlyphRange(&self) -> NSRange; + + #[method(paragraphSeparatorGlyphRange)] + pub unsafe fn paragraphSeparatorGlyphRange(&self) -> NSRange; + + #[method(paragraphCharacterRange)] + pub unsafe fn paragraphCharacterRange(&self) -> NSRange; + + #[method(paragraphSeparatorCharacterRange)] + pub unsafe fn paragraphSeparatorCharacterRange(&self) -> NSRange; + + #[method(layoutParagraphAtPoint:)] + pub unsafe fn layoutParagraphAtPoint( + &self, + lineFragmentOrigin: NSPointPointer, + ) -> NSUInteger; + + #[method(beginParagraph)] + pub unsafe fn beginParagraph(&self); + + #[method(endParagraph)] + pub unsafe fn endParagraph(&self); + + #[method(beginLineWithGlyphAtIndex:)] + pub unsafe fn beginLineWithGlyphAtIndex(&self, glyphIndex: NSUInteger); + + #[method(endLineWithGlyphRange:)] + pub unsafe fn endLineWithGlyphRange(&self, lineGlyphRange: NSRange); + + #[method(lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:)] + pub unsafe fn lineSpacingAfterGlyphAtIndex_withProposedLineFragmentRect( + &self, + glyphIndex: NSUInteger, + rect: NSRect, + ) -> CGFloat; + + #[method(paragraphSpacingBeforeGlyphAtIndex:withProposedLineFragmentRect:)] + pub unsafe fn paragraphSpacingBeforeGlyphAtIndex_withProposedLineFragmentRect( + &self, + glyphIndex: NSUInteger, + rect: NSRect, + ) -> CGFloat; + + #[method(paragraphSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:)] + pub unsafe fn paragraphSpacingAfterGlyphAtIndex_withProposedLineFragmentRect( + &self, + glyphIndex: NSUInteger, + rect: NSRect, + ) -> CGFloat; + + #[method(getLineFragmentRect:usedRect:forParagraphSeparatorGlyphRange:atProposedOrigin:)] + pub unsafe fn getLineFragmentRect_usedRect_forParagraphSeparatorGlyphRange_atProposedOrigin( + &self, + lineFragmentRect: NSRectPointer, + lineFragmentUsedRect: NSRectPointer, + paragraphSeparatorGlyphRange: NSRange, + lineOrigin: NSPoint, + ); + + #[method_id(@__retain_semantics Other attributesForExtraLineFragment)] + pub unsafe fn attributesForExtraLineFragment( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other layoutManager)] + pub unsafe fn layoutManager(&self) -> Option>; + + #[method_id(@__retain_semantics Other textContainers)] + pub unsafe fn textContainers(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other currentTextContainer)] + pub unsafe fn currentTextContainer(&self) -> Option>; + + #[method_id(@__retain_semantics Other currentParagraphStyle)] + pub unsafe fn currentParagraphStyle(&self) -> Option>; + + #[method(setHardInvalidation:forGlyphRange:)] + pub unsafe fn setHardInvalidation_forGlyphRange(&self, flag: bool, glyphRange: NSRange); + + #[method(layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:)] + pub unsafe fn layoutGlyphsInLayoutManager_startingAtGlyphIndex_maxNumberOfLineFragments_nextGlyphIndex( + &self, + layoutManager: &NSLayoutManager, + startGlyphIndex: NSUInteger, + maxNumLines: NSUInteger, + nextGlyph: NonNull, + ); + + #[method(layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:)] + pub unsafe fn layoutCharactersInRange_forLayoutManager_maximumNumberOfLineFragments( + &self, + characterRange: NSRange, + layoutManager: &NSLayoutManager, + maxNumLines: NSUInteger, + ) -> NSRange; + + #[method(printingAdjustmentInLayoutManager:forNominallySpacedGlyphRange:packedGlyphs:count:)] + pub unsafe fn printingAdjustmentInLayoutManager_forNominallySpacedGlyphRange_packedGlyphs_count( + layoutMgr: &NSLayoutManager, + nominallySpacedGlyphsRange: NSRange, + packedGlyphs: NonNull, + packedGlyphsCount: NSUInteger, + ) -> NSSize; + + #[method(baselineOffsetInLayoutManager:glyphIndex:)] + pub unsafe fn baselineOffsetInLayoutManager_glyphIndex( + &self, + layoutMgr: &NSLayoutManager, + glyphIndex: NSUInteger, + ) -> CGFloat; + + #[method_id(@__retain_semantics Other sharedSystemTypesetter)] + pub unsafe fn sharedSystemTypesetter() -> Id; + + #[method_id(@__retain_semantics Other sharedSystemTypesetterForBehavior:)] + pub unsafe fn sharedSystemTypesetterForBehavior( + behavior: NSTypesetterBehavior, + ) -> Id; + + #[method(defaultTypesetterBehavior)] + pub unsafe fn defaultTypesetterBehavior() -> NSTypesetterBehavior; + } +); + +extern_methods!( + /// NSLayoutPhaseInterface + unsafe impl NSTypesetter { + #[method(willSetLineFragmentRect:forGlyphRange:usedRect:baselineOffset:)] + pub unsafe fn willSetLineFragmentRect_forGlyphRange_usedRect_baselineOffset( + &self, + lineRect: NSRectPointer, + glyphRange: NSRange, + usedRect: NSRectPointer, + baselineOffset: NonNull, + ); + + #[method(shouldBreakLineByWordBeforeCharacterAtIndex:)] + pub unsafe fn shouldBreakLineByWordBeforeCharacterAtIndex( + &self, + charIndex: NSUInteger, + ) -> bool; + + #[method(shouldBreakLineByHyphenatingBeforeCharacterAtIndex:)] + pub unsafe fn shouldBreakLineByHyphenatingBeforeCharacterAtIndex( + &self, + charIndex: NSUInteger, + ) -> bool; + + #[method(hyphenationFactorForGlyphAtIndex:)] + pub unsafe fn hyphenationFactorForGlyphAtIndex(&self, glyphIndex: NSUInteger) -> c_float; + + #[method(hyphenCharacterForGlyphAtIndex:)] + pub unsafe fn hyphenCharacterForGlyphAtIndex(&self, glyphIndex: NSUInteger) -> UTF32Char; + + #[method(boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex:)] + pub unsafe fn boundingBoxForControlGlyphAtIndex_forTextContainer_proposedLineFragment_glyphPosition_characterIndex( + &self, + glyphIndex: NSUInteger, + textContainer: &NSTextContainer, + proposedRect: NSRect, + glyphPosition: NSPoint, + charIndex: NSUInteger, + ) -> NSRect; + } +); + +extern_methods!( + /// NSGlyphStorageInterface + unsafe impl NSTypesetter { + #[method(characterRangeForGlyphRange:actualGlyphRange:)] + pub unsafe fn characterRangeForGlyphRange_actualGlyphRange( + &self, + glyphRange: NSRange, + actualGlyphRange: NSRangePointer, + ) -> NSRange; + + #[method(glyphRangeForCharacterRange:actualCharacterRange:)] + pub unsafe fn glyphRangeForCharacterRange_actualCharacterRange( + &self, + charRange: NSRange, + actualCharRange: NSRangePointer, + ) -> NSRange; + + #[method(getLineFragmentRect:usedRect:remainingRect:forStartingGlyphAtIndex:proposedRect:lineSpacing:paragraphSpacingBefore:paragraphSpacingAfter:)] + pub unsafe fn getLineFragmentRect_usedRect_remainingRect_forStartingGlyphAtIndex_proposedRect_lineSpacing_paragraphSpacingBefore_paragraphSpacingAfter( + &self, + lineFragmentRect: NSRectPointer, + lineFragmentUsedRect: NSRectPointer, + remainingRect: NSRectPointer, + startingGlyphIndex: NSUInteger, + proposedRect: NSRect, + lineSpacing: CGFloat, + paragraphSpacingBefore: CGFloat, + paragraphSpacingAfter: CGFloat, + ); + + #[method(setLineFragmentRect:forGlyphRange:usedRect:baselineOffset:)] + pub unsafe fn setLineFragmentRect_forGlyphRange_usedRect_baselineOffset( + &self, + fragmentRect: NSRect, + glyphRange: NSRange, + usedRect: NSRect, + baselineOffset: CGFloat, + ); + + #[method(setNotShownAttribute:forGlyphRange:)] + pub unsafe fn setNotShownAttribute_forGlyphRange(&self, flag: bool, glyphRange: NSRange); + + #[method(setDrawsOutsideLineFragment:forGlyphRange:)] + pub unsafe fn setDrawsOutsideLineFragment_forGlyphRange( + &self, + flag: bool, + glyphRange: NSRange, + ); + + #[method(setLocation:withAdvancements:forStartOfGlyphRange:)] + pub unsafe fn setLocation_withAdvancements_forStartOfGlyphRange( + &self, + location: NSPoint, + advancements: *mut CGFloat, + glyphRange: NSRange, + ); + + #[method(setAttachmentSize:forGlyphRange:)] + pub unsafe fn setAttachmentSize_forGlyphRange( + &self, + attachmentSize: NSSize, + glyphRange: NSRange, + ); + + #[method(setBidiLevels:forGlyphRange:)] + pub unsafe fn setBidiLevels_forGlyphRange(&self, levels: *mut u8, glyphRange: NSRange); + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSTypesetterControlCharacterAction { + NSTypesetterZeroAdvancementAction = 1 << 0, + NSTypesetterWhitespaceAction = 1 << 1, + NSTypesetterHorizontalTabAction = 1 << 2, + NSTypesetterLineBreakAction = 1 << 3, + NSTypesetterParagraphBreakAction = 1 << 4, + NSTypesetterContainerBreakAction = 1 << 5, + } +); + +extern_methods!( + /// NSTypesetter_Deprecated + unsafe impl NSTypesetter { + #[method(actionForControlCharacterAtIndex:)] + pub unsafe fn actionForControlCharacterAtIndex( + &self, + charIndex: NSUInteger, + ) -> NSTypesetterControlCharacterAction; + + #[method(getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels:)] + pub unsafe fn getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits_bidiLevels( + &self, + glyphsRange: NSRange, + glyphBuffer: *mut NSGlyph, + charIndexBuffer: *mut NSUInteger, + inscribeBuffer: *mut NSGlyphInscription, + elasticBuffer: *mut Bool, + bidiLevelBuffer: *mut c_uchar, + ) -> NSUInteger; + + #[method(substituteGlyphsInRange:withGlyphs:)] + pub unsafe fn substituteGlyphsInRange_withGlyphs( + &self, + glyphRange: NSRange, + glyphs: *mut NSGlyph, + ); + + #[method(insertGlyph:atGlyphIndex:characterIndex:)] + pub unsafe fn insertGlyph_atGlyphIndex_characterIndex( + &self, + glyph: NSGlyph, + glyphIndex: NSUInteger, + characterIndex: NSUInteger, + ); + + #[method(deleteGlyphsInRange:)] + pub unsafe fn deleteGlyphsInRange(&self, glyphRange: NSRange); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSUserActivity.rs b/crates/icrate/src/generated/AppKit/NSUserActivity.rs new file mode 100644 index 000000000..4279b3475 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSUserActivity.rs @@ -0,0 +1,45 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSUserActivityRestoring; + + unsafe impl NSUserActivityRestoring { + #[method(restoreUserActivityState:)] + pub unsafe fn restoreUserActivityState(&self, userActivity: &NSUserActivity); + } +); + +extern_methods!( + /// NSUserActivity + unsafe impl NSResponder { + #[method_id(@__retain_semantics Other userActivity)] + pub unsafe fn userActivity(&self) -> Option>; + + #[method(setUserActivity:)] + pub unsafe fn setUserActivity(&self, userActivity: Option<&NSUserActivity>); + + #[method(updateUserActivityState:)] + pub unsafe fn updateUserActivityState(&self, userActivity: &NSUserActivity); + } +); + +extern_methods!( + /// NSUserActivity + unsafe impl NSDocument { + #[method_id(@__retain_semantics Other userActivity)] + pub unsafe fn userActivity(&self) -> Option>; + + #[method(setUserActivity:)] + pub unsafe fn setUserActivity(&self, userActivity: Option<&NSUserActivity>); + + #[method(updateUserActivityState:)] + pub unsafe fn updateUserActivityState(&self, activity: &NSUserActivity); + } +); + +extern_static!(NSUserActivityDocumentURLKey: &'static NSString); diff --git a/crates/icrate/src/generated/AppKit/NSUserDefaultsController.rs b/crates/icrate/src/generated/AppKit/NSUserDefaultsController.rs new file mode 100644 index 000000000..47edb2f5a --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSUserDefaultsController.rs @@ -0,0 +1,68 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSUserDefaultsController; + + unsafe impl ClassType for NSUserDefaultsController { + type Super = NSController; + } +); + +extern_methods!( + unsafe impl NSUserDefaultsController { + #[method_id(@__retain_semantics Other sharedUserDefaultsController)] + pub unsafe fn sharedUserDefaultsController() -> Id; + + #[method_id(@__retain_semantics Init initWithDefaults:initialValues:)] + pub unsafe fn initWithDefaults_initialValues( + this: Option>, + defaults: Option<&NSUserDefaults>, + initialValues: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other defaults)] + pub unsafe fn defaults(&self) -> Id; + + #[method_id(@__retain_semantics Other initialValues)] + pub unsafe fn initialValues(&self) -> Option, Shared>>; + + #[method(setInitialValues:)] + pub unsafe fn setInitialValues( + &self, + initialValues: Option<&NSDictionary>, + ); + + #[method(appliesImmediately)] + pub unsafe fn appliesImmediately(&self) -> bool; + + #[method(setAppliesImmediately:)] + pub unsafe fn setAppliesImmediately(&self, appliesImmediately: bool); + + #[method(hasUnappliedChanges)] + pub unsafe fn hasUnappliedChanges(&self) -> bool; + + #[method_id(@__retain_semantics Other values)] + pub unsafe fn values(&self) -> Id; + + #[method(revert:)] + pub unsafe fn revert(&self, sender: Option<&Object>); + + #[method(save:)] + pub unsafe fn save(&self, sender: Option<&Object>); + + #[method(revertToInitialValues:)] + pub unsafe fn revertToInitialValues(&self, sender: Option<&Object>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSUserInterfaceCompression.rs b/crates/icrate/src/generated/AppKit/NSUserInterfaceCompression.rs new file mode 100644 index 000000000..8c5a4511d --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSUserInterfaceCompression.rs @@ -0,0 +1,100 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSUserInterfaceCompressionOptions; + + unsafe impl ClassType for NSUserInterfaceCompressionOptions { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSUserInterfaceCompressionOptions { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithIdentifier:)] + pub unsafe fn initWithIdentifier( + this: Option>, + identifier: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCompressionOptions:)] + pub unsafe fn initWithCompressionOptions( + this: Option>, + options: &NSSet, + ) -> Id; + + #[method(containsOptions:)] + pub unsafe fn containsOptions(&self, options: &NSUserInterfaceCompressionOptions) -> bool; + + #[method(intersectsOptions:)] + pub unsafe fn intersectsOptions(&self, options: &NSUserInterfaceCompressionOptions) + -> bool; + + #[method(isEmpty)] + pub unsafe fn isEmpty(&self) -> bool; + + #[method_id(@__retain_semantics Other optionsByAddingOptions:)] + pub unsafe fn optionsByAddingOptions( + &self, + options: &NSUserInterfaceCompressionOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other optionsByRemovingOptions:)] + pub unsafe fn optionsByRemovingOptions( + &self, + options: &NSUserInterfaceCompressionOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other hideImagesOption)] + pub unsafe fn hideImagesOption() -> Id; + + #[method_id(@__retain_semantics Other hideTextOption)] + pub unsafe fn hideTextOption() -> Id; + + #[method_id(@__retain_semantics Other reduceMetricsOption)] + pub unsafe fn reduceMetricsOption() -> Id; + + #[method_id(@__retain_semantics Other breakEqualWidthsOption)] + pub unsafe fn breakEqualWidthsOption() -> Id; + + #[method_id(@__retain_semantics Other standardOptions)] + pub unsafe fn standardOptions() -> Id; + } +); + +extern_protocol!( + pub struct NSUserInterfaceCompression; + + unsafe impl NSUserInterfaceCompression { + #[method(compressWithPrioritizedCompressionOptions:)] + pub unsafe fn compressWithPrioritizedCompressionOptions( + &self, + prioritizedOptions: &NSArray, + ); + + #[method(minimumSizeWithPrioritizedCompressionOptions:)] + pub unsafe fn minimumSizeWithPrioritizedCompressionOptions( + &self, + prioritizedOptions: &NSArray, + ) -> NSSize; + + #[method_id(@__retain_semantics Other activeCompressionOptions)] + pub unsafe fn activeCompressionOptions( + &self, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSUserInterfaceItemIdentification.rs b/crates/icrate/src/generated/AppKit/NSUserInterfaceItemIdentification.rs new file mode 100644 index 000000000..3be79bfbd --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSUserInterfaceItemIdentification.rs @@ -0,0 +1,20 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +pub type NSUserInterfaceItemIdentifier = NSString; + +extern_protocol!( + pub struct NSUserInterfaceItemIdentification; + + unsafe impl NSUserInterfaceItemIdentification { + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Option>; + + #[method(setIdentifier:)] + pub unsafe fn setIdentifier(&self, identifier: Option<&NSUserInterfaceItemIdentifier>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSUserInterfaceItemSearching.rs b/crates/icrate/src/generated/AppKit/NSUserInterfaceItemSearching.rs new file mode 100644 index 000000000..667712a37 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSUserInterfaceItemSearching.rs @@ -0,0 +1,58 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSUserInterfaceItemSearching; + + unsafe impl NSUserInterfaceItemSearching { + #[method(searchForItemsWithSearchString:resultLimit:matchedItemHandler:)] + pub unsafe fn searchForItemsWithSearchString_resultLimit_matchedItemHandler( + &self, + searchString: &NSString, + resultLimit: NSInteger, + handleMatchedItems: &Block<(NonNull,), ()>, + ); + + #[method_id(@__retain_semantics Other localizedTitlesForItem:)] + pub unsafe fn localizedTitlesForItem(&self, item: &Object) + -> Id, Shared>; + + #[optional] + #[method(performActionForItem:)] + pub unsafe fn performActionForItem(&self, item: &Object); + + #[optional] + #[method(showAllHelpTopicsForSearchString:)] + pub unsafe fn showAllHelpTopicsForSearchString(&self, searchString: &NSString); + } +); + +extern_methods!( + /// NSUserInterfaceItemSearching + unsafe impl NSApplication { + #[method(registerUserInterfaceItemSearchHandler:)] + pub unsafe fn registerUserInterfaceItemSearchHandler( + &self, + handler: &NSUserInterfaceItemSearching, + ); + + #[method(unregisterUserInterfaceItemSearchHandler:)] + pub unsafe fn unregisterUserInterfaceItemSearchHandler( + &self, + handler: &NSUserInterfaceItemSearching, + ); + + #[method(searchString:inUserInterfaceItemString:searchRange:foundRange:)] + pub unsafe fn searchString_inUserInterfaceItemString_searchRange_foundRange( + &self, + searchString: &NSString, + stringToSearch: &NSString, + searchRange: NSRange, + foundRange: *mut NSRange, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSUserInterfaceLayout.rs b/crates/icrate/src/generated/AppKit/NSUserInterfaceLayout.rs new file mode 100644 index 000000000..dbbef7ed3 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSUserInterfaceLayout.rs @@ -0,0 +1,22 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSUserInterfaceLayoutDirection { + NSUserInterfaceLayoutDirectionLeftToRight = 0, + NSUserInterfaceLayoutDirectionRightToLeft = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSUserInterfaceLayoutOrientation { + NSUserInterfaceLayoutOrientationHorizontal = 0, + NSUserInterfaceLayoutOrientationVertical = 1, + } +); diff --git a/crates/icrate/src/generated/AppKit/NSUserInterfaceValidation.rs b/crates/icrate/src/generated/AppKit/NSUserInterfaceValidation.rs new file mode 100644 index 000000000..6fb05997b --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSUserInterfaceValidation.rs @@ -0,0 +1,28 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSValidatedUserInterfaceItem; + + unsafe impl NSValidatedUserInterfaceItem { + #[method(action)] + pub unsafe fn action(&self) -> OptionSel; + + #[method(tag)] + pub unsafe fn tag(&self) -> NSInteger; + } +); + +extern_protocol!( + pub struct NSUserInterfaceValidations; + + unsafe impl NSUserInterfaceValidations { + #[method(validateUserInterfaceItem:)] + pub unsafe fn validateUserInterfaceItem(&self, item: &NSValidatedUserInterfaceItem) + -> bool; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSView.rs b/crates/icrate/src/generated/AppKit/NSView.rs new file mode 100644 index 000000000..82df4b0f6 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSView.rs @@ -0,0 +1,1107 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSAutoresizingMaskOptions { + NSViewNotSizable = 0, + NSViewMinXMargin = 1, + NSViewWidthSizable = 2, + NSViewMaxXMargin = 4, + NSViewMinYMargin = 8, + NSViewHeightSizable = 16, + NSViewMaxYMargin = 32, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSBorderType { + NSNoBorder = 0, + NSLineBorder = 1, + NSBezelBorder = 2, + NSGrooveBorder = 3, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSViewLayerContentsRedrawPolicy { + NSViewLayerContentsRedrawNever = 0, + NSViewLayerContentsRedrawOnSetNeedsDisplay = 1, + NSViewLayerContentsRedrawDuringViewResize = 2, + NSViewLayerContentsRedrawBeforeViewResize = 3, + NSViewLayerContentsRedrawCrossfade = 4, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSViewLayerContentsPlacement { + NSViewLayerContentsPlacementScaleAxesIndependently = 0, + NSViewLayerContentsPlacementScaleProportionallyToFit = 1, + NSViewLayerContentsPlacementScaleProportionallyToFill = 2, + NSViewLayerContentsPlacementCenter = 3, + NSViewLayerContentsPlacementTop = 4, + NSViewLayerContentsPlacementTopRight = 5, + NSViewLayerContentsPlacementRight = 6, + NSViewLayerContentsPlacementBottomRight = 7, + NSViewLayerContentsPlacementBottom = 8, + NSViewLayerContentsPlacementBottomLeft = 9, + NSViewLayerContentsPlacementLeft = 10, + NSViewLayerContentsPlacementTopLeft = 11, + } +); + +pub type NSTrackingRectTag = NSInteger; + +pub type NSToolTipTag = NSInteger; + +extern_class!( + #[derive(Debug)] + pub struct NSView; + + unsafe impl ClassType for NSView { + type Super = NSResponder; + } +); + +extern_methods!( + unsafe impl NSView { + #[method_id(@__retain_semantics Init initWithFrame:)] + pub unsafe fn initWithFrame( + this: Option>, + frameRect: NSRect, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other window)] + pub unsafe fn window(&self) -> Option>; + + #[method_id(@__retain_semantics Other superview)] + pub unsafe fn superview(&self) -> Option>; + + #[method_id(@__retain_semantics Other subviews)] + pub unsafe fn subviews(&self) -> Id, Shared>; + + #[method(setSubviews:)] + pub unsafe fn setSubviews(&self, subviews: &NSArray); + + #[method(isDescendantOf:)] + pub unsafe fn isDescendantOf(&self, view: &NSView) -> bool; + + #[method_id(@__retain_semantics Other ancestorSharedWithView:)] + pub unsafe fn ancestorSharedWithView(&self, view: &NSView) -> Option>; + + #[method_id(@__retain_semantics Other opaqueAncestor)] + pub unsafe fn opaqueAncestor(&self) -> Option>; + + #[method(isHidden)] + pub unsafe fn isHidden(&self) -> bool; + + #[method(setHidden:)] + pub unsafe fn setHidden(&self, hidden: bool); + + #[method(isHiddenOrHasHiddenAncestor)] + pub unsafe fn isHiddenOrHasHiddenAncestor(&self) -> bool; + + #[method(getRectsBeingDrawn:count:)] + pub unsafe fn getRectsBeingDrawn_count( + &self, + rects: *mut *mut NSRect, + count: *mut NSInteger, + ); + + #[method(needsToDrawRect:)] + pub unsafe fn needsToDrawRect(&self, rect: NSRect) -> bool; + + #[method(wantsDefaultClipping)] + pub unsafe fn wantsDefaultClipping(&self) -> bool; + + #[method(viewDidHide)] + pub unsafe fn viewDidHide(&self); + + #[method(viewDidUnhide)] + pub unsafe fn viewDidUnhide(&self); + + #[method(addSubview:)] + pub unsafe fn addSubview(&self, view: &NSView); + + #[method(addSubview:positioned:relativeTo:)] + pub unsafe fn addSubview_positioned_relativeTo( + &self, + view: &NSView, + place: NSWindowOrderingMode, + otherView: Option<&NSView>, + ); + + #[method(sortSubviewsUsingFunction:context:)] + pub unsafe fn sortSubviewsUsingFunction_context( + &self, + compare: unsafe extern "C" fn( + NonNull, + NonNull, + *mut c_void, + ) -> NSComparisonResult, + context: *mut c_void, + ); + + #[method(viewWillMoveToWindow:)] + pub unsafe fn viewWillMoveToWindow(&self, newWindow: Option<&NSWindow>); + + #[method(viewDidMoveToWindow)] + pub unsafe fn viewDidMoveToWindow(&self); + + #[method(viewWillMoveToSuperview:)] + pub unsafe fn viewWillMoveToSuperview(&self, newSuperview: Option<&NSView>); + + #[method(viewDidMoveToSuperview)] + pub unsafe fn viewDidMoveToSuperview(&self); + + #[method(didAddSubview:)] + pub unsafe fn didAddSubview(&self, subview: &NSView); + + #[method(willRemoveSubview:)] + pub unsafe fn willRemoveSubview(&self, subview: &NSView); + + #[method(removeFromSuperview)] + pub unsafe fn removeFromSuperview(&self); + + #[method(replaceSubview:with:)] + pub unsafe fn replaceSubview_with(&self, oldView: &NSView, newView: &NSView); + + #[method(removeFromSuperviewWithoutNeedingDisplay)] + pub unsafe fn removeFromSuperviewWithoutNeedingDisplay(&self); + + #[method(viewDidChangeBackingProperties)] + pub unsafe fn viewDidChangeBackingProperties(&self); + + #[method(postsFrameChangedNotifications)] + pub unsafe fn postsFrameChangedNotifications(&self) -> bool; + + #[method(setPostsFrameChangedNotifications:)] + pub unsafe fn setPostsFrameChangedNotifications( + &self, + postsFrameChangedNotifications: bool, + ); + + #[method(resizeSubviewsWithOldSize:)] + pub unsafe fn resizeSubviewsWithOldSize(&self, oldSize: NSSize); + + #[method(resizeWithOldSuperviewSize:)] + pub unsafe fn resizeWithOldSuperviewSize(&self, oldSize: NSSize); + + #[method(autoresizesSubviews)] + pub unsafe fn autoresizesSubviews(&self) -> bool; + + #[method(setAutoresizesSubviews:)] + pub unsafe fn setAutoresizesSubviews(&self, autoresizesSubviews: bool); + + #[method(autoresizingMask)] + pub unsafe fn autoresizingMask(&self) -> NSAutoresizingMaskOptions; + + #[method(setAutoresizingMask:)] + pub unsafe fn setAutoresizingMask(&self, autoresizingMask: NSAutoresizingMaskOptions); + + #[method(setFrameOrigin:)] + pub unsafe fn setFrameOrigin(&self, newOrigin: NSPoint); + + #[method(setFrameSize:)] + pub unsafe fn setFrameSize(&self, newSize: NSSize); + + #[method(frame)] + pub unsafe fn frame(&self) -> NSRect; + + #[method(setFrame:)] + pub unsafe fn setFrame(&self, frame: NSRect); + + #[method(frameRotation)] + pub unsafe fn frameRotation(&self) -> CGFloat; + + #[method(setFrameRotation:)] + pub unsafe fn setFrameRotation(&self, frameRotation: CGFloat); + + #[method(frameCenterRotation)] + pub unsafe fn frameCenterRotation(&self) -> CGFloat; + + #[method(setFrameCenterRotation:)] + pub unsafe fn setFrameCenterRotation(&self, frameCenterRotation: CGFloat); + + #[method(setBoundsOrigin:)] + pub unsafe fn setBoundsOrigin(&self, newOrigin: NSPoint); + + #[method(setBoundsSize:)] + pub unsafe fn setBoundsSize(&self, newSize: NSSize); + + #[method(boundsRotation)] + pub unsafe fn boundsRotation(&self) -> CGFloat; + + #[method(setBoundsRotation:)] + pub unsafe fn setBoundsRotation(&self, boundsRotation: CGFloat); + + #[method(translateOriginToPoint:)] + pub unsafe fn translateOriginToPoint(&self, translation: NSPoint); + + #[method(scaleUnitSquareToSize:)] + pub unsafe fn scaleUnitSquareToSize(&self, newUnitSize: NSSize); + + #[method(rotateByAngle:)] + pub unsafe fn rotateByAngle(&self, angle: CGFloat); + + #[method(bounds)] + pub unsafe fn bounds(&self) -> NSRect; + + #[method(setBounds:)] + pub unsafe fn setBounds(&self, bounds: NSRect); + + #[method(isFlipped)] + pub unsafe fn isFlipped(&self) -> bool; + + #[method(isRotatedFromBase)] + pub unsafe fn isRotatedFromBase(&self) -> bool; + + #[method(isRotatedOrScaledFromBase)] + pub unsafe fn isRotatedOrScaledFromBase(&self) -> bool; + + #[method(isOpaque)] + pub unsafe fn isOpaque(&self) -> bool; + + #[method(convertPoint:fromView:)] + pub unsafe fn convertPoint_fromView( + &self, + point: NSPoint, + view: Option<&NSView>, + ) -> NSPoint; + + #[method(convertPoint:toView:)] + pub unsafe fn convertPoint_toView(&self, point: NSPoint, view: Option<&NSView>) -> NSPoint; + + #[method(convertSize:fromView:)] + pub unsafe fn convertSize_fromView(&self, size: NSSize, view: Option<&NSView>) -> NSSize; + + #[method(convertSize:toView:)] + pub unsafe fn convertSize_toView(&self, size: NSSize, view: Option<&NSView>) -> NSSize; + + #[method(convertRect:fromView:)] + pub unsafe fn convertRect_fromView(&self, rect: NSRect, view: Option<&NSView>) -> NSRect; + + #[method(convertRect:toView:)] + pub unsafe fn convertRect_toView(&self, rect: NSRect, view: Option<&NSView>) -> NSRect; + + #[method(backingAlignedRect:options:)] + pub unsafe fn backingAlignedRect_options( + &self, + rect: NSRect, + options: NSAlignmentOptions, + ) -> NSRect; + + #[method(centerScanRect:)] + pub unsafe fn centerScanRect(&self, rect: NSRect) -> NSRect; + + #[method(convertPointToBacking:)] + pub unsafe fn convertPointToBacking(&self, point: NSPoint) -> NSPoint; + + #[method(convertPointFromBacking:)] + pub unsafe fn convertPointFromBacking(&self, point: NSPoint) -> NSPoint; + + #[method(convertSizeToBacking:)] + pub unsafe fn convertSizeToBacking(&self, size: NSSize) -> NSSize; + + #[method(convertSizeFromBacking:)] + pub unsafe fn convertSizeFromBacking(&self, size: NSSize) -> NSSize; + + #[method(convertRectToBacking:)] + pub unsafe fn convertRectToBacking(&self, rect: NSRect) -> NSRect; + + #[method(convertRectFromBacking:)] + pub unsafe fn convertRectFromBacking(&self, rect: NSRect) -> NSRect; + + #[method(convertPointToLayer:)] + pub unsafe fn convertPointToLayer(&self, point: NSPoint) -> NSPoint; + + #[method(convertPointFromLayer:)] + pub unsafe fn convertPointFromLayer(&self, point: NSPoint) -> NSPoint; + + #[method(convertSizeToLayer:)] + pub unsafe fn convertSizeToLayer(&self, size: NSSize) -> NSSize; + + #[method(convertSizeFromLayer:)] + pub unsafe fn convertSizeFromLayer(&self, size: NSSize) -> NSSize; + + #[method(convertRectToLayer:)] + pub unsafe fn convertRectToLayer(&self, rect: NSRect) -> NSRect; + + #[method(convertRectFromLayer:)] + pub unsafe fn convertRectFromLayer(&self, rect: NSRect) -> NSRect; + + #[method(canDrawConcurrently)] + pub unsafe fn canDrawConcurrently(&self) -> bool; + + #[method(setCanDrawConcurrently:)] + pub unsafe fn setCanDrawConcurrently(&self, canDrawConcurrently: bool); + + #[method(canDraw)] + pub unsafe fn canDraw(&self) -> bool; + + #[method(setNeedsDisplayInRect:)] + pub unsafe fn setNeedsDisplayInRect(&self, invalidRect: NSRect); + + #[method(needsDisplay)] + pub unsafe fn needsDisplay(&self) -> bool; + + #[method(setNeedsDisplay:)] + pub unsafe fn setNeedsDisplay(&self, needsDisplay: bool); + + #[method(lockFocus)] + pub unsafe fn lockFocus(&self); + + #[method(unlockFocus)] + pub unsafe fn unlockFocus(&self); + + #[method(lockFocusIfCanDraw)] + pub unsafe fn lockFocusIfCanDraw(&self) -> bool; + + #[method(lockFocusIfCanDrawInContext:)] + pub unsafe fn lockFocusIfCanDrawInContext(&self, context: &NSGraphicsContext) -> bool; + + #[method_id(@__retain_semantics Other focusView)] + pub unsafe fn focusView() -> Option>; + + #[method(visibleRect)] + pub unsafe fn visibleRect(&self) -> NSRect; + + #[method(display)] + pub unsafe fn display(&self); + + #[method(displayIfNeeded)] + pub unsafe fn displayIfNeeded(&self); + + #[method(displayIfNeededIgnoringOpacity)] + pub unsafe fn displayIfNeededIgnoringOpacity(&self); + + #[method(displayRect:)] + pub unsafe fn displayRect(&self, rect: NSRect); + + #[method(displayIfNeededInRect:)] + pub unsafe fn displayIfNeededInRect(&self, rect: NSRect); + + #[method(displayRectIgnoringOpacity:)] + pub unsafe fn displayRectIgnoringOpacity(&self, rect: NSRect); + + #[method(displayIfNeededInRectIgnoringOpacity:)] + pub unsafe fn displayIfNeededInRectIgnoringOpacity(&self, rect: NSRect); + + #[method(drawRect:)] + pub unsafe fn drawRect(&self, dirtyRect: NSRect); + + #[method(displayRectIgnoringOpacity:inContext:)] + pub unsafe fn displayRectIgnoringOpacity_inContext( + &self, + rect: NSRect, + context: &NSGraphicsContext, + ); + + #[method_id(@__retain_semantics Other bitmapImageRepForCachingDisplayInRect:)] + pub unsafe fn bitmapImageRepForCachingDisplayInRect( + &self, + rect: NSRect, + ) -> Option>; + + #[method(cacheDisplayInRect:toBitmapImageRep:)] + pub unsafe fn cacheDisplayInRect_toBitmapImageRep( + &self, + rect: NSRect, + bitmapImageRep: &NSBitmapImageRep, + ); + + #[method(viewWillDraw)] + pub unsafe fn viewWillDraw(&self); + + #[method(scrollPoint:)] + pub unsafe fn scrollPoint(&self, point: NSPoint); + + #[method(scrollRectToVisible:)] + pub unsafe fn scrollRectToVisible(&self, rect: NSRect) -> bool; + + #[method(autoscroll:)] + pub unsafe fn autoscroll(&self, event: &NSEvent) -> bool; + + #[method(adjustScroll:)] + pub unsafe fn adjustScroll(&self, newVisible: NSRect) -> NSRect; + + #[method(scrollRect:by:)] + pub unsafe fn scrollRect_by(&self, rect: NSRect, delta: NSSize); + + #[method(translateRectsNeedingDisplayInRect:by:)] + pub unsafe fn translateRectsNeedingDisplayInRect_by(&self, clipRect: NSRect, delta: NSSize); + + #[method_id(@__retain_semantics Other hitTest:)] + pub unsafe fn hitTest(&self, point: NSPoint) -> Option>; + + #[method(mouse:inRect:)] + pub unsafe fn mouse_inRect(&self, point: NSPoint, rect: NSRect) -> bool; + + #[method_id(@__retain_semantics Other viewWithTag:)] + pub unsafe fn viewWithTag(&self, tag: NSInteger) -> Option>; + + #[method(tag)] + pub unsafe fn tag(&self) -> NSInteger; + + #[method(performKeyEquivalent:)] + pub unsafe fn performKeyEquivalent(&self, event: &NSEvent) -> bool; + + #[method(acceptsFirstMouse:)] + pub unsafe fn acceptsFirstMouse(&self, event: Option<&NSEvent>) -> bool; + + #[method(shouldDelayWindowOrderingForEvent:)] + pub unsafe fn shouldDelayWindowOrderingForEvent(&self, event: &NSEvent) -> bool; + + #[method(needsPanelToBecomeKey)] + pub unsafe fn needsPanelToBecomeKey(&self) -> bool; + + #[method(mouseDownCanMoveWindow)] + pub unsafe fn mouseDownCanMoveWindow(&self) -> bool; + + #[method(acceptsTouchEvents)] + pub unsafe fn acceptsTouchEvents(&self) -> bool; + + #[method(setAcceptsTouchEvents:)] + pub unsafe fn setAcceptsTouchEvents(&self, acceptsTouchEvents: bool); + + #[method(wantsRestingTouches)] + pub unsafe fn wantsRestingTouches(&self) -> bool; + + #[method(setWantsRestingTouches:)] + pub unsafe fn setWantsRestingTouches(&self, wantsRestingTouches: bool); + + #[method(addCursorRect:cursor:)] + pub unsafe fn addCursorRect_cursor(&self, rect: NSRect, object: &NSCursor); + + #[method(removeCursorRect:cursor:)] + pub unsafe fn removeCursorRect_cursor(&self, rect: NSRect, object: &NSCursor); + + #[method(discardCursorRects)] + pub unsafe fn discardCursorRects(&self); + + #[method(resetCursorRects)] + pub unsafe fn resetCursorRects(&self); + + #[method(addTrackingRect:owner:userData:assumeInside:)] + pub unsafe fn addTrackingRect_owner_userData_assumeInside( + &self, + rect: NSRect, + owner: &Object, + data: *mut c_void, + flag: bool, + ) -> NSTrackingRectTag; + + #[method(removeTrackingRect:)] + pub unsafe fn removeTrackingRect(&self, tag: NSTrackingRectTag); + + #[method(layerContentsRedrawPolicy)] + pub unsafe fn layerContentsRedrawPolicy(&self) -> NSViewLayerContentsRedrawPolicy; + + #[method(setLayerContentsRedrawPolicy:)] + pub unsafe fn setLayerContentsRedrawPolicy( + &self, + layerContentsRedrawPolicy: NSViewLayerContentsRedrawPolicy, + ); + + #[method(layerContentsPlacement)] + pub unsafe fn layerContentsPlacement(&self) -> NSViewLayerContentsPlacement; + + #[method(setLayerContentsPlacement:)] + pub unsafe fn setLayerContentsPlacement( + &self, + layerContentsPlacement: NSViewLayerContentsPlacement, + ); + + #[method(wantsLayer)] + pub unsafe fn wantsLayer(&self) -> bool; + + #[method(setWantsLayer:)] + pub unsafe fn setWantsLayer(&self, wantsLayer: bool); + + #[method(wantsUpdateLayer)] + pub unsafe fn wantsUpdateLayer(&self) -> bool; + + #[method(updateLayer)] + pub unsafe fn updateLayer(&self); + + #[method(canDrawSubviewsIntoLayer)] + pub unsafe fn canDrawSubviewsIntoLayer(&self) -> bool; + + #[method(setCanDrawSubviewsIntoLayer:)] + pub unsafe fn setCanDrawSubviewsIntoLayer(&self, canDrawSubviewsIntoLayer: bool); + + #[method(layoutSubtreeIfNeeded)] + pub unsafe fn layoutSubtreeIfNeeded(&self); + + #[method(layout)] + pub unsafe fn layout(&self); + + #[method(needsLayout)] + pub unsafe fn needsLayout(&self) -> bool; + + #[method(setNeedsLayout:)] + pub unsafe fn setNeedsLayout(&self, needsLayout: bool); + + #[method(alphaValue)] + pub unsafe fn alphaValue(&self) -> CGFloat; + + #[method(setAlphaValue:)] + pub unsafe fn setAlphaValue(&self, alphaValue: CGFloat); + + #[method(layerUsesCoreImageFilters)] + pub unsafe fn layerUsesCoreImageFilters(&self) -> bool; + + #[method(setLayerUsesCoreImageFilters:)] + pub unsafe fn setLayerUsesCoreImageFilters(&self, layerUsesCoreImageFilters: bool); + + #[method_id(@__retain_semantics Other shadow)] + pub unsafe fn shadow(&self) -> Option>; + + #[method(setShadow:)] + pub unsafe fn setShadow(&self, shadow: Option<&NSShadow>); + + #[method(addTrackingArea:)] + pub unsafe fn addTrackingArea(&self, trackingArea: &NSTrackingArea); + + #[method(removeTrackingArea:)] + pub unsafe fn removeTrackingArea(&self, trackingArea: &NSTrackingArea); + + #[method_id(@__retain_semantics Other trackingAreas)] + pub unsafe fn trackingAreas(&self) -> Id, Shared>; + + #[method(updateTrackingAreas)] + pub unsafe fn updateTrackingAreas(&self); + + #[method(postsBoundsChangedNotifications)] + pub unsafe fn postsBoundsChangedNotifications(&self) -> bool; + + #[method(setPostsBoundsChangedNotifications:)] + pub unsafe fn setPostsBoundsChangedNotifications( + &self, + postsBoundsChangedNotifications: bool, + ); + + #[method_id(@__retain_semantics Other enclosingScrollView)] + pub unsafe fn enclosingScrollView(&self) -> Option>; + + #[method_id(@__retain_semantics Other menuForEvent:)] + pub unsafe fn menuForEvent(&self, event: &NSEvent) -> Option>; + + #[method_id(@__retain_semantics Other defaultMenu)] + pub unsafe fn defaultMenu() -> Option>; + + #[method(willOpenMenu:withEvent:)] + pub unsafe fn willOpenMenu_withEvent(&self, menu: &NSMenu, event: &NSEvent); + + #[method(didCloseMenu:withEvent:)] + pub unsafe fn didCloseMenu_withEvent(&self, menu: &NSMenu, event: Option<&NSEvent>); + + #[method_id(@__retain_semantics Other toolTip)] + pub unsafe fn toolTip(&self) -> Option>; + + #[method(setToolTip:)] + pub unsafe fn setToolTip(&self, toolTip: Option<&NSString>); + + #[method(addToolTipRect:owner:userData:)] + pub unsafe fn addToolTipRect_owner_userData( + &self, + rect: NSRect, + owner: &Object, + data: *mut c_void, + ) -> NSToolTipTag; + + #[method(removeToolTip:)] + pub unsafe fn removeToolTip(&self, tag: NSToolTipTag); + + #[method(removeAllToolTips)] + pub unsafe fn removeAllToolTips(&self); + + #[method(viewWillStartLiveResize)] + pub unsafe fn viewWillStartLiveResize(&self); + + #[method(viewDidEndLiveResize)] + pub unsafe fn viewDidEndLiveResize(&self); + + #[method(inLiveResize)] + pub unsafe fn inLiveResize(&self) -> bool; + + #[method(preservesContentDuringLiveResize)] + pub unsafe fn preservesContentDuringLiveResize(&self) -> bool; + + #[method(rectPreservedDuringLiveResize)] + pub unsafe fn rectPreservedDuringLiveResize(&self) -> NSRect; + + #[method(getRectsExposedDuringLiveResize:count:)] + pub unsafe fn getRectsExposedDuringLiveResize_count( + &self, + exposedRects: [NSRect; 4], + count: NonNull, + ); + + #[method_id(@__retain_semantics Other inputContext)] + pub unsafe fn inputContext(&self) -> Option>; + + #[method(rectForSmartMagnificationAtPoint:inRect:)] + pub unsafe fn rectForSmartMagnificationAtPoint_inRect( + &self, + location: NSPoint, + visibleRect: NSRect, + ) -> NSRect; + + #[method(userInterfaceLayoutDirection)] + pub unsafe fn userInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection; + + #[method(setUserInterfaceLayoutDirection:)] + pub unsafe fn setUserInterfaceLayoutDirection( + &self, + userInterfaceLayoutDirection: NSUserInterfaceLayoutDirection, + ); + + #[method(prepareForReuse)] + pub unsafe fn prepareForReuse(&self); + + #[method(isCompatibleWithResponsiveScrolling)] + pub unsafe fn isCompatibleWithResponsiveScrolling() -> bool; + + #[method(prepareContentInRect:)] + pub unsafe fn prepareContentInRect(&self, rect: NSRect); + + #[method(preparedContentRect)] + pub unsafe fn preparedContentRect(&self) -> NSRect; + + #[method(setPreparedContentRect:)] + pub unsafe fn setPreparedContentRect(&self, preparedContentRect: NSRect); + + #[method(allowsVibrancy)] + pub unsafe fn allowsVibrancy(&self) -> bool; + + #[method(viewDidChangeEffectiveAppearance)] + pub unsafe fn viewDidChangeEffectiveAppearance(&self); + } +); + +extern_protocol!( + pub struct NSViewLayerContentScaleDelegate; + + unsafe impl NSViewLayerContentScaleDelegate { + #[optional] + #[method(layer:shouldInheritContentsScale:fromWindow:)] + pub unsafe fn layer_shouldInheritContentsScale_fromWindow( + &self, + layer: &CALayer, + newScale: CGFloat, + window: &NSWindow, + ) -> bool; + } +); + +extern_methods!( + /// NSLayerDelegateContentsScaleUpdating + unsafe impl NSObject {} +); + +extern_protocol!( + pub struct NSViewToolTipOwner; + + unsafe impl NSViewToolTipOwner { + #[method_id(@__retain_semantics Other view:stringForToolTip:point:userData:)] + pub unsafe fn view_stringForToolTip_point_userData( + &self, + view: &NSView, + tag: NSToolTipTag, + point: NSPoint, + data: *mut c_void, + ) -> Id; + } +); + +extern_methods!( + /// NSToolTipOwner + unsafe impl NSObject { + #[method_id(@__retain_semantics Other view:stringForToolTip:point:userData:)] + pub unsafe fn view_stringForToolTip_point_userData( + &self, + view: &NSView, + tag: NSToolTipTag, + point: NSPoint, + data: *mut c_void, + ) -> Id; + } +); + +extern_methods!( + /// NSKeyboardUI + unsafe impl NSView { + #[method_id(@__retain_semantics Other nextKeyView)] + pub unsafe fn nextKeyView(&self) -> Option>; + + #[method(setNextKeyView:)] + pub unsafe fn setNextKeyView(&self, nextKeyView: Option<&NSView>); + + #[method_id(@__retain_semantics Other previousKeyView)] + pub unsafe fn previousKeyView(&self) -> Option>; + + #[method_id(@__retain_semantics Other nextValidKeyView)] + pub unsafe fn nextValidKeyView(&self) -> Option>; + + #[method_id(@__retain_semantics Other previousValidKeyView)] + pub unsafe fn previousValidKeyView(&self) -> Option>; + + #[method(canBecomeKeyView)] + pub unsafe fn canBecomeKeyView(&self) -> bool; + + #[method(setKeyboardFocusRingNeedsDisplayInRect:)] + pub unsafe fn setKeyboardFocusRingNeedsDisplayInRect(&self, rect: NSRect); + + #[method(focusRingType)] + pub unsafe fn focusRingType(&self) -> NSFocusRingType; + + #[method(setFocusRingType:)] + pub unsafe fn setFocusRingType(&self, focusRingType: NSFocusRingType); + + #[method(defaultFocusRingType)] + pub unsafe fn defaultFocusRingType() -> NSFocusRingType; + + #[method(drawFocusRingMask)] + pub unsafe fn drawFocusRingMask(&self); + + #[method(focusRingMaskBounds)] + pub unsafe fn focusRingMaskBounds(&self) -> NSRect; + + #[method(noteFocusRingMaskChanged)] + pub unsafe fn noteFocusRingMaskChanged(&self); + } +); + +extern_methods!( + /// NSPrinting + unsafe impl NSView { + #[method(writeEPSInsideRect:toPasteboard:)] + pub unsafe fn writeEPSInsideRect_toPasteboard( + &self, + rect: NSRect, + pasteboard: &NSPasteboard, + ); + + #[method_id(@__retain_semantics Other dataWithEPSInsideRect:)] + pub unsafe fn dataWithEPSInsideRect(&self, rect: NSRect) -> Id; + + #[method(writePDFInsideRect:toPasteboard:)] + pub unsafe fn writePDFInsideRect_toPasteboard( + &self, + rect: NSRect, + pasteboard: &NSPasteboard, + ); + + #[method_id(@__retain_semantics Other dataWithPDFInsideRect:)] + pub unsafe fn dataWithPDFInsideRect(&self, rect: NSRect) -> Id; + + #[method(print:)] + pub unsafe fn print(&self, sender: Option<&Object>); + + #[method(knowsPageRange:)] + pub unsafe fn knowsPageRange(&self, range: NSRangePointer) -> bool; + + #[method(heightAdjustLimit)] + pub unsafe fn heightAdjustLimit(&self) -> CGFloat; + + #[method(widthAdjustLimit)] + pub unsafe fn widthAdjustLimit(&self) -> CGFloat; + + #[method(adjustPageWidthNew:left:right:limit:)] + pub unsafe fn adjustPageWidthNew_left_right_limit( + &self, + newRight: NonNull, + oldLeft: CGFloat, + oldRight: CGFloat, + rightLimit: CGFloat, + ); + + #[method(adjustPageHeightNew:top:bottom:limit:)] + pub unsafe fn adjustPageHeightNew_top_bottom_limit( + &self, + newBottom: NonNull, + oldTop: CGFloat, + oldBottom: CGFloat, + bottomLimit: CGFloat, + ); + + #[method(rectForPage:)] + pub unsafe fn rectForPage(&self, page: NSInteger) -> NSRect; + + #[method(locationOfPrintRect:)] + pub unsafe fn locationOfPrintRect(&self, rect: NSRect) -> NSPoint; + + #[method(drawPageBorderWithSize:)] + pub unsafe fn drawPageBorderWithSize(&self, borderSize: NSSize); + + #[method_id(@__retain_semantics Other pageHeader)] + pub unsafe fn pageHeader(&self) -> Id; + + #[method_id(@__retain_semantics Other pageFooter)] + pub unsafe fn pageFooter(&self) -> Id; + + #[method(drawSheetBorderWithSize:)] + pub unsafe fn drawSheetBorderWithSize(&self, borderSize: NSSize); + + #[method_id(@__retain_semantics Other printJobTitle)] + pub unsafe fn printJobTitle(&self) -> Id; + + #[method(beginDocument)] + pub unsafe fn beginDocument(&self); + + #[method(endDocument)] + pub unsafe fn endDocument(&self); + + #[method(beginPageInRect:atPlacement:)] + pub unsafe fn beginPageInRect_atPlacement(&self, rect: NSRect, location: NSPoint); + + #[method(endPage)] + pub unsafe fn endPage(&self); + } +); + +extern_methods!( + /// NSDrag + unsafe impl NSView { + #[method_id(@__retain_semantics Other beginDraggingSessionWithItems:event:source:)] + pub unsafe fn beginDraggingSessionWithItems_event_source( + &self, + items: &NSArray, + event: &NSEvent, + source: &NSDraggingSource, + ) -> Id; + + #[method_id(@__retain_semantics Other registeredDraggedTypes)] + pub unsafe fn registeredDraggedTypes(&self) -> Id, Shared>; + + #[method(registerForDraggedTypes:)] + pub unsafe fn registerForDraggedTypes(&self, newTypes: &NSArray); + + #[method(unregisterDraggedTypes)] + pub unsafe fn unregisterDraggedTypes(&self); + } +); + +pub type NSViewFullScreenModeOptionKey = NSString; + +extern_static!(NSFullScreenModeAllScreens: &'static NSViewFullScreenModeOptionKey); + +extern_static!(NSFullScreenModeSetting: &'static NSViewFullScreenModeOptionKey); + +extern_static!(NSFullScreenModeWindowLevel: &'static NSViewFullScreenModeOptionKey); + +extern_static!( + NSFullScreenModeApplicationPresentationOptions: &'static NSViewFullScreenModeOptionKey +); + +extern_methods!( + /// NSFullScreenMode + unsafe impl NSView { + #[method(enterFullScreenMode:withOptions:)] + pub unsafe fn enterFullScreenMode_withOptions( + &self, + screen: &NSScreen, + options: Option<&NSDictionary>, + ) -> bool; + + #[method(exitFullScreenModeWithOptions:)] + pub unsafe fn exitFullScreenModeWithOptions( + &self, + options: Option<&NSDictionary>, + ); + + #[method(isInFullScreenMode)] + pub unsafe fn isInFullScreenMode(&self) -> bool; + } +); + +pub type NSDefinitionOptionKey = NSString; + +extern_static!(NSDefinitionPresentationTypeKey: &'static NSDefinitionOptionKey); + +pub type NSDefinitionPresentationType = NSString; + +extern_static!(NSDefinitionPresentationTypeOverlay: &'static NSDefinitionPresentationType); + +extern_static!( + NSDefinitionPresentationTypeDictionaryApplication: &'static NSDefinitionPresentationType +); + +extern_methods!( + /// NSDefinition + unsafe impl NSView { + #[method(showDefinitionForAttributedString:atPoint:)] + pub unsafe fn showDefinitionForAttributedString_atPoint( + &self, + attrString: Option<&NSAttributedString>, + textBaselineOrigin: NSPoint, + ); + + #[method(showDefinitionForAttributedString:range:options:baselineOriginProvider:)] + pub unsafe fn showDefinitionForAttributedString_range_options_baselineOriginProvider( + &self, + attrString: Option<&NSAttributedString>, + targetRange: NSRange, + options: Option<&NSDictionary>, + originProvider: Option<&Block<(NSRange,), NSPoint>>, + ); + } +); + +extern_methods!( + /// NSFindIndicator + unsafe impl NSView { + #[method(isDrawingFindIndicator)] + pub unsafe fn isDrawingFindIndicator(&self) -> bool; + } +); + +extern_methods!( + /// NSGestureRecognizer + unsafe impl NSView { + #[method_id(@__retain_semantics Other gestureRecognizers)] + pub unsafe fn gestureRecognizers(&self) -> Id, Shared>; + + #[method(setGestureRecognizers:)] + pub unsafe fn setGestureRecognizers( + &self, + gestureRecognizers: &NSArray, + ); + + #[method(addGestureRecognizer:)] + pub unsafe fn addGestureRecognizer(&self, gestureRecognizer: &NSGestureRecognizer); + + #[method(removeGestureRecognizer:)] + pub unsafe fn removeGestureRecognizer(&self, gestureRecognizer: &NSGestureRecognizer); + } +); + +extern_methods!( + /// NSTouchBar + unsafe impl NSView { + #[method(allowedTouchTypes)] + pub unsafe fn allowedTouchTypes(&self) -> NSTouchTypeMask; + + #[method(setAllowedTouchTypes:)] + pub unsafe fn setAllowedTouchTypes(&self, allowedTouchTypes: NSTouchTypeMask); + } +); + +extern_methods!( + /// NSSafeAreas + unsafe impl NSView { + #[method(safeAreaInsets)] + pub unsafe fn safeAreaInsets(&self) -> NSEdgeInsets; + + #[method(additionalSafeAreaInsets)] + pub unsafe fn additionalSafeAreaInsets(&self) -> NSEdgeInsets; + + #[method(setAdditionalSafeAreaInsets:)] + pub unsafe fn setAdditionalSafeAreaInsets(&self, additionalSafeAreaInsets: NSEdgeInsets); + + #[method_id(@__retain_semantics Other safeAreaLayoutGuide)] + pub unsafe fn safeAreaLayoutGuide(&self) -> Id; + + #[method(safeAreaRect)] + pub unsafe fn safeAreaRect(&self) -> NSRect; + + #[method_id(@__retain_semantics Other layoutMarginsGuide)] + pub unsafe fn layoutMarginsGuide(&self) -> Id; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSView { + #[method(dragImage:at:offset:event:pasteboard:source:slideBack:)] + pub unsafe fn dragImage_at_offset_event_pasteboard_source_slideBack( + &self, + image: &NSImage, + viewLocation: NSPoint, + initialOffset: NSSize, + event: &NSEvent, + pboard: &NSPasteboard, + sourceObj: &Object, + slideFlag: bool, + ); + + #[method(dragFile:fromRect:slideBack:event:)] + pub unsafe fn dragFile_fromRect_slideBack_event( + &self, + filename: &NSString, + rect: NSRect, + flag: bool, + event: &NSEvent, + ) -> bool; + + #[method(dragPromisedFilesOfTypes:fromRect:source:slideBack:event:)] + pub unsafe fn dragPromisedFilesOfTypes_fromRect_source_slideBack_event( + &self, + typeArray: &NSArray, + rect: NSRect, + sourceObject: &Object, + flag: bool, + event: &NSEvent, + ) -> bool; + + #[method(convertPointToBase:)] + pub unsafe fn convertPointToBase(&self, point: NSPoint) -> NSPoint; + + #[method(convertPointFromBase:)] + pub unsafe fn convertPointFromBase(&self, point: NSPoint) -> NSPoint; + + #[method(convertSizeToBase:)] + pub unsafe fn convertSizeToBase(&self, size: NSSize) -> NSSize; + + #[method(convertSizeFromBase:)] + pub unsafe fn convertSizeFromBase(&self, size: NSSize) -> NSSize; + + #[method(convertRectToBase:)] + pub unsafe fn convertRectToBase(&self, rect: NSRect) -> NSRect; + + #[method(convertRectFromBase:)] + pub unsafe fn convertRectFromBase(&self, rect: NSRect) -> NSRect; + + #[method(performMnemonic:)] + pub unsafe fn performMnemonic(&self, string: &NSString) -> bool; + + #[method(shouldDrawColor)] + pub unsafe fn shouldDrawColor(&self) -> bool; + + #[method(gState)] + pub unsafe fn gState(&self) -> NSInteger; + + #[method(allocateGState)] + pub unsafe fn allocateGState(&self); + + #[method(setUpGState)] + pub unsafe fn setUpGState(&self); + + #[method(renewGState)] + pub unsafe fn renewGState(&self); + } +); + +extern_static!(NSViewFrameDidChangeNotification: &'static NSNotificationName); + +extern_static!(NSViewFocusDidChangeNotification: &'static NSNotificationName); + +extern_static!(NSViewBoundsDidChangeNotification: &'static NSNotificationName); + +extern_static!(NSViewGlobalFrameDidChangeNotification: &'static NSNotificationName); + +extern_static!(NSViewDidUpdateTrackingAreasNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/AppKit/NSViewController.rs b/crates/icrate/src/generated/AppKit/NSViewController.rs new file mode 100644 index 000000000..9b17bd169 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSViewController.rs @@ -0,0 +1,273 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSViewControllerTransitionOptions { + NSViewControllerTransitionNone = 0x0, + NSViewControllerTransitionCrossfade = 0x1, + NSViewControllerTransitionSlideUp = 0x10, + NSViewControllerTransitionSlideDown = 0x20, + NSViewControllerTransitionSlideLeft = 0x40, + NSViewControllerTransitionSlideRight = 0x80, + NSViewControllerTransitionSlideForward = 0x140, + NSViewControllerTransitionSlideBackward = 0x180, + NSViewControllerTransitionAllowUserInteraction = 0x1000, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSViewController; + + unsafe impl ClassType for NSViewController { + type Super = NSResponder; + } +); + +extern_methods!( + unsafe impl NSViewController { + #[method_id(@__retain_semantics Init initWithNibName:bundle:)] + pub unsafe fn initWithNibName_bundle( + this: Option>, + nibNameOrNil: Option<&NSNibName>, + nibBundleOrNil: Option<&NSBundle>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other nibName)] + pub unsafe fn nibName(&self) -> Option>; + + #[method_id(@__retain_semantics Other nibBundle)] + pub unsafe fn nibBundle(&self) -> Option>; + + #[method_id(@__retain_semantics Other representedObject)] + pub unsafe fn representedObject(&self) -> Option>; + + #[method(setRepresentedObject:)] + pub unsafe fn setRepresentedObject(&self, representedObject: Option<&Object>); + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Option>; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: Option<&NSString>); + + #[method_id(@__retain_semantics Other view)] + pub unsafe fn view(&self) -> Id; + + #[method(setView:)] + pub unsafe fn setView(&self, view: &NSView); + + #[method(loadView)] + pub unsafe fn loadView(&self); + + #[method(commitEditingWithDelegate:didCommitSelector:contextInfo:)] + pub unsafe fn commitEditingWithDelegate_didCommitSelector_contextInfo( + &self, + delegate: Option<&Object>, + didCommitSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(commitEditing)] + pub unsafe fn commitEditing(&self) -> bool; + + #[method(discardEditing)] + pub unsafe fn discardEditing(&self); + + #[method(viewDidLoad)] + pub unsafe fn viewDidLoad(&self); + + #[method(isViewLoaded)] + pub unsafe fn isViewLoaded(&self) -> bool; + + #[method(viewWillAppear)] + pub unsafe fn viewWillAppear(&self); + + #[method(viewDidAppear)] + pub unsafe fn viewDidAppear(&self); + + #[method(viewWillDisappear)] + pub unsafe fn viewWillDisappear(&self); + + #[method(viewDidDisappear)] + pub unsafe fn viewDidDisappear(&self); + + #[method(preferredContentSize)] + pub unsafe fn preferredContentSize(&self) -> NSSize; + + #[method(setPreferredContentSize:)] + pub unsafe fn setPreferredContentSize(&self, preferredContentSize: NSSize); + + #[method(updateViewConstraints)] + pub unsafe fn updateViewConstraints(&self); + + #[method(viewWillLayout)] + pub unsafe fn viewWillLayout(&self); + + #[method(viewDidLayout)] + pub unsafe fn viewDidLayout(&self); + } +); + +extern_methods!( + /// NSViewControllerPresentation + unsafe impl NSViewController { + #[method(presentViewController:animator:)] + pub unsafe fn presentViewController_animator( + &self, + viewController: &NSViewController, + animator: &NSViewControllerPresentationAnimator, + ); + + #[method(dismissViewController:)] + pub unsafe fn dismissViewController(&self, viewController: &NSViewController); + + #[method(dismissController:)] + pub unsafe fn dismissController(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other presentedViewControllers)] + pub unsafe fn presentedViewControllers( + &self, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other presentingViewController)] + pub unsafe fn presentingViewController(&self) -> Option>; + } +); + +extern_methods!( + /// NSViewControllerPresentationAndTransitionStyles + unsafe impl NSViewController { + #[method(presentViewControllerAsSheet:)] + pub unsafe fn presentViewControllerAsSheet(&self, viewController: &NSViewController); + + #[method(presentViewControllerAsModalWindow:)] + pub unsafe fn presentViewControllerAsModalWindow(&self, viewController: &NSViewController); + + #[method(presentViewController:asPopoverRelativeToRect:ofView:preferredEdge:behavior:)] + pub unsafe fn presentViewController_asPopoverRelativeToRect_ofView_preferredEdge_behavior( + &self, + viewController: &NSViewController, + positioningRect: NSRect, + positioningView: &NSView, + preferredEdge: NSRectEdge, + behavior: NSPopoverBehavior, + ); + + #[method(transitionFromViewController:toViewController:options:completionHandler:)] + pub unsafe fn transitionFromViewController_toViewController_options_completionHandler( + &self, + fromViewController: &NSViewController, + toViewController: &NSViewController, + options: NSViewControllerTransitionOptions, + completion: Option<&Block<(), ()>>, + ); + } +); + +extern_methods!( + /// NSViewControllerContainer + unsafe impl NSViewController { + #[method_id(@__retain_semantics Other parentViewController)] + pub unsafe fn parentViewController(&self) -> Option>; + + #[method_id(@__retain_semantics Other childViewControllers)] + pub unsafe fn childViewControllers(&self) -> Id, Shared>; + + #[method(setChildViewControllers:)] + pub unsafe fn setChildViewControllers( + &self, + childViewControllers: &NSArray, + ); + + #[method(addChildViewController:)] + pub unsafe fn addChildViewController(&self, childViewController: &NSViewController); + + #[method(removeFromParentViewController)] + pub unsafe fn removeFromParentViewController(&self); + + #[method(insertChildViewController:atIndex:)] + pub unsafe fn insertChildViewController_atIndex( + &self, + childViewController: &NSViewController, + index: NSInteger, + ); + + #[method(removeChildViewControllerAtIndex:)] + pub unsafe fn removeChildViewControllerAtIndex(&self, index: NSInteger); + + #[method(preferredContentSizeDidChangeForViewController:)] + pub unsafe fn preferredContentSizeDidChangeForViewController( + &self, + viewController: &NSViewController, + ); + + #[method(viewWillTransitionToSize:)] + pub unsafe fn viewWillTransitionToSize(&self, newSize: NSSize); + } +); + +extern_protocol!( + pub struct NSViewControllerPresentationAnimator; + + unsafe impl NSViewControllerPresentationAnimator { + #[method(animatePresentationOfViewController:fromViewController:)] + pub unsafe fn animatePresentationOfViewController_fromViewController( + &self, + viewController: &NSViewController, + fromViewController: &NSViewController, + ); + + #[method(animateDismissalOfViewController:fromViewController:)] + pub unsafe fn animateDismissalOfViewController_fromViewController( + &self, + viewController: &NSViewController, + fromViewController: &NSViewController, + ); + } +); + +extern_methods!( + /// NSViewControllerStoryboardingMethods + unsafe impl NSViewController { + #[method_id(@__retain_semantics Other storyboard)] + pub unsafe fn storyboard(&self) -> Option>; + } +); + +extern_methods!( + /// NSExtensionAdditions + unsafe impl NSViewController { + #[method_id(@__retain_semantics Other extensionContext)] + pub unsafe fn extensionContext(&self) -> Option>; + + #[method_id(@__retain_semantics Other sourceItemView)] + pub unsafe fn sourceItemView(&self) -> Option>; + + #[method(setSourceItemView:)] + pub unsafe fn setSourceItemView(&self, sourceItemView: Option<&NSView>); + + #[method(preferredScreenOrigin)] + pub unsafe fn preferredScreenOrigin(&self) -> NSPoint; + + #[method(setPreferredScreenOrigin:)] + pub unsafe fn setPreferredScreenOrigin(&self, preferredScreenOrigin: NSPoint); + + #[method(preferredMinimumSize)] + pub unsafe fn preferredMinimumSize(&self) -> NSSize; + + #[method(preferredMaximumSize)] + pub unsafe fn preferredMaximumSize(&self) -> NSSize; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSVisualEffectView.rs b/crates/icrate/src/generated/AppKit/NSVisualEffectView.rs new file mode 100644 index 000000000..d863b57c1 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSVisualEffectView.rs @@ -0,0 +1,100 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSVisualEffectMaterial { + NSVisualEffectMaterialTitlebar = 3, + NSVisualEffectMaterialSelection = 4, + NSVisualEffectMaterialMenu = 5, + NSVisualEffectMaterialPopover = 6, + NSVisualEffectMaterialSidebar = 7, + NSVisualEffectMaterialHeaderView = 10, + NSVisualEffectMaterialSheet = 11, + NSVisualEffectMaterialWindowBackground = 12, + NSVisualEffectMaterialHUDWindow = 13, + NSVisualEffectMaterialFullScreenUI = 15, + NSVisualEffectMaterialToolTip = 17, + NSVisualEffectMaterialContentBackground = 18, + NSVisualEffectMaterialUnderWindowBackground = 21, + NSVisualEffectMaterialUnderPageBackground = 22, + NSVisualEffectMaterialAppearanceBased = 0, + NSVisualEffectMaterialLight = 1, + NSVisualEffectMaterialDark = 2, + NSVisualEffectMaterialMediumLight = 8, + NSVisualEffectMaterialUltraDark = 9, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSVisualEffectBlendingMode { + NSVisualEffectBlendingModeBehindWindow = 0, + NSVisualEffectBlendingModeWithinWindow = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSVisualEffectState { + NSVisualEffectStateFollowsWindowActiveState = 0, + NSVisualEffectStateActive = 1, + NSVisualEffectStateInactive = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSVisualEffectView; + + unsafe impl ClassType for NSVisualEffectView { + type Super = NSView; + } +); + +extern_methods!( + unsafe impl NSVisualEffectView { + #[method(material)] + pub unsafe fn material(&self) -> NSVisualEffectMaterial; + + #[method(setMaterial:)] + pub unsafe fn setMaterial(&self, material: NSVisualEffectMaterial); + + #[method(interiorBackgroundStyle)] + pub unsafe fn interiorBackgroundStyle(&self) -> NSBackgroundStyle; + + #[method(blendingMode)] + pub unsafe fn blendingMode(&self) -> NSVisualEffectBlendingMode; + + #[method(setBlendingMode:)] + pub unsafe fn setBlendingMode(&self, blendingMode: NSVisualEffectBlendingMode); + + #[method(state)] + pub unsafe fn state(&self) -> NSVisualEffectState; + + #[method(setState:)] + pub unsafe fn setState(&self, state: NSVisualEffectState); + + #[method_id(@__retain_semantics Other maskImage)] + pub unsafe fn maskImage(&self) -> Option>; + + #[method(setMaskImage:)] + pub unsafe fn setMaskImage(&self, maskImage: Option<&NSImage>); + + #[method(isEmphasized)] + pub unsafe fn isEmphasized(&self) -> bool; + + #[method(setEmphasized:)] + pub unsafe fn setEmphasized(&self, emphasized: bool); + + #[method(viewDidMoveToWindow)] + pub unsafe fn viewDidMoveToWindow(&self); + + #[method(viewWillMoveToWindow:)] + pub unsafe fn viewWillMoveToWindow(&self, newWindow: Option<&NSWindow>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSWindow.rs b/crates/icrate/src/generated/AppKit/NSWindow.rs new file mode 100644 index 000000000..1abe9bdaa --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSWindow.rs @@ -0,0 +1,1687 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSAppKitVersionNumberWithCustomSheetPosition: NSAppKitVersion = 686.0); + +extern_static!(NSAppKitVersionNumberWithDeferredWindowDisplaySupport: NSAppKitVersion = 1019.0); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSWindowStyleMask { + NSWindowStyleMaskBorderless = 0, + NSWindowStyleMaskTitled = 1 << 0, + NSWindowStyleMaskClosable = 1 << 1, + NSWindowStyleMaskMiniaturizable = 1 << 2, + NSWindowStyleMaskResizable = 1 << 3, + NSWindowStyleMaskTexturedBackground = 1 << 8, + NSWindowStyleMaskUnifiedTitleAndToolbar = 1 << 12, + NSWindowStyleMaskFullScreen = 1 << 14, + NSWindowStyleMaskFullSizeContentView = 1 << 15, + NSWindowStyleMaskUtilityWindow = 1 << 4, + NSWindowStyleMaskDocModalWindow = 1 << 6, + NSWindowStyleMaskNonactivatingPanel = 1 << 7, + NSWindowStyleMaskHUDWindow = 1 << 13, + } +); + +extern_static!(NSModalResponseOK: NSModalResponse = 1); + +extern_static!(NSModalResponseCancel: NSModalResponse = 0); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSDisplayWindowRunLoopOrdering = 600000, + NSResetCursorRectsRunLoopOrdering = 700000, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSWindowSharingType { + NSWindowSharingNone = 0, + NSWindowSharingReadOnly = 1, + NSWindowSharingReadWrite = 2, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSWindowCollectionBehavior { + NSWindowCollectionBehaviorDefault = 0, + NSWindowCollectionBehaviorCanJoinAllSpaces = 1 << 0, + NSWindowCollectionBehaviorMoveToActiveSpace = 1 << 1, + NSWindowCollectionBehaviorManaged = 1 << 2, + NSWindowCollectionBehaviorTransient = 1 << 3, + NSWindowCollectionBehaviorStationary = 1 << 4, + NSWindowCollectionBehaviorParticipatesInCycle = 1 << 5, + NSWindowCollectionBehaviorIgnoresCycle = 1 << 6, + NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7, + NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8, + NSWindowCollectionBehaviorFullScreenNone = 1 << 9, + NSWindowCollectionBehaviorFullScreenAllowsTiling = 1 << 11, + NSWindowCollectionBehaviorFullScreenDisallowsTiling = 1 << 12, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSWindowAnimationBehavior { + NSWindowAnimationBehaviorDefault = 0, + NSWindowAnimationBehaviorNone = 2, + NSWindowAnimationBehaviorDocumentWindow = 3, + NSWindowAnimationBehaviorUtilityWindow = 4, + NSWindowAnimationBehaviorAlertPanel = 5, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSWindowNumberListOptions { + NSWindowNumberListAllApplications = 1 << 0, + NSWindowNumberListAllSpaces = 1 << 4, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSWindowOcclusionState { + NSWindowOcclusionStateVisible = 1 << 1, + } +); + +pub type NSWindowLevel = NSInteger; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSSelectionDirection { + NSDirectSelection = 0, + NSSelectingNext = 1, + NSSelectingPrevious = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSWindowButton { + NSWindowCloseButton = 0, + NSWindowMiniaturizeButton = 1, + NSWindowZoomButton = 2, + NSWindowToolbarButton = 3, + NSWindowDocumentIconButton = 4, + NSWindowDocumentVersionsButton = 6, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSWindowTitleVisibility { + NSWindowTitleVisible = 0, + NSWindowTitleHidden = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSWindowToolbarStyle { + NSWindowToolbarStyleAutomatic = 0, + NSWindowToolbarStyleExpanded = 1, + NSWindowToolbarStylePreference = 2, + NSWindowToolbarStyleUnified = 3, + NSWindowToolbarStyleUnifiedCompact = 4, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSWindowUserTabbingPreference { + NSWindowUserTabbingPreferenceManual = 0, + NSWindowUserTabbingPreferenceAlways = 1, + NSWindowUserTabbingPreferenceInFullScreen = 2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSWindowTabbingMode { + NSWindowTabbingModeAutomatic = 0, + NSWindowTabbingModePreferred = 1, + NSWindowTabbingModeDisallowed = 2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTitlebarSeparatorStyle { + NSTitlebarSeparatorStyleAutomatic = 0, + NSTitlebarSeparatorStyleNone = 1, + NSTitlebarSeparatorStyleLine = 2, + NSTitlebarSeparatorStyleShadow = 3, + } +); + +pub type NSWindowFrameAutosaveName = NSString; + +pub type NSWindowPersistableFrameDescriptor = NSString; + +pub type NSWindowTabbingIdentifier = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSWindow; + + unsafe impl ClassType for NSWindow { + type Super = NSResponder; + } +); + +extern_methods!( + unsafe impl NSWindow { + #[method(frameRectForContentRect:styleMask:)] + pub unsafe fn frameRectForContentRect_styleMask( + cRect: NSRect, + style: NSWindowStyleMask, + ) -> NSRect; + + #[method(contentRectForFrameRect:styleMask:)] + pub unsafe fn contentRectForFrameRect_styleMask( + fRect: NSRect, + style: NSWindowStyleMask, + ) -> NSRect; + + #[method(minFrameWidthWithTitle:styleMask:)] + pub unsafe fn minFrameWidthWithTitle_styleMask( + title: &NSString, + style: NSWindowStyleMask, + ) -> CGFloat; + + #[method(defaultDepthLimit)] + pub unsafe fn defaultDepthLimit() -> NSWindowDepth; + + #[method(frameRectForContentRect:)] + pub unsafe fn frameRectForContentRect(&self, contentRect: NSRect) -> NSRect; + + #[method(contentRectForFrameRect:)] + pub unsafe fn contentRectForFrameRect(&self, frameRect: NSRect) -> NSRect; + + #[method_id(@__retain_semantics Init initWithContentRect:styleMask:backing:defer:)] + pub unsafe fn initWithContentRect_styleMask_backing_defer( + this: Option>, + contentRect: NSRect, + style: NSWindowStyleMask, + backingStoreType: NSBackingStoreType, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithContentRect:styleMask:backing:defer:screen:)] + pub unsafe fn initWithContentRect_styleMask_backing_defer_screen( + this: Option>, + contentRect: NSRect, + style: NSWindowStyleMask, + backingStoreType: NSBackingStoreType, + flag: bool, + screen: Option<&NSScreen>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: &NSString); + + #[method_id(@__retain_semantics Other subtitle)] + pub unsafe fn subtitle(&self) -> Id; + + #[method(setSubtitle:)] + pub unsafe fn setSubtitle(&self, subtitle: &NSString); + + #[method(titleVisibility)] + pub unsafe fn titleVisibility(&self) -> NSWindowTitleVisibility; + + #[method(setTitleVisibility:)] + pub unsafe fn setTitleVisibility(&self, titleVisibility: NSWindowTitleVisibility); + + #[method(titlebarAppearsTransparent)] + pub unsafe fn titlebarAppearsTransparent(&self) -> bool; + + #[method(setTitlebarAppearsTransparent:)] + pub unsafe fn setTitlebarAppearsTransparent(&self, titlebarAppearsTransparent: bool); + + #[method(toolbarStyle)] + pub unsafe fn toolbarStyle(&self) -> NSWindowToolbarStyle; + + #[method(setToolbarStyle:)] + pub unsafe fn setToolbarStyle(&self, toolbarStyle: NSWindowToolbarStyle); + + #[method(contentLayoutRect)] + pub unsafe fn contentLayoutRect(&self) -> NSRect; + + #[method_id(@__retain_semantics Other contentLayoutGuide)] + pub unsafe fn contentLayoutGuide(&self) -> Option>; + + #[method_id(@__retain_semantics Other titlebarAccessoryViewControllers)] + pub unsafe fn titlebarAccessoryViewControllers( + &self, + ) -> Id, Shared>; + + #[method(setTitlebarAccessoryViewControllers:)] + pub unsafe fn setTitlebarAccessoryViewControllers( + &self, + titlebarAccessoryViewControllers: &NSArray, + ); + + #[method(addTitlebarAccessoryViewController:)] + pub unsafe fn addTitlebarAccessoryViewController( + &self, + childViewController: &NSTitlebarAccessoryViewController, + ); + + #[method(insertTitlebarAccessoryViewController:atIndex:)] + pub unsafe fn insertTitlebarAccessoryViewController_atIndex( + &self, + childViewController: &NSTitlebarAccessoryViewController, + index: NSInteger, + ); + + #[method(removeTitlebarAccessoryViewControllerAtIndex:)] + pub unsafe fn removeTitlebarAccessoryViewControllerAtIndex(&self, index: NSInteger); + + #[method_id(@__retain_semantics Other representedURL)] + pub unsafe fn representedURL(&self) -> Option>; + + #[method(setRepresentedURL:)] + pub unsafe fn setRepresentedURL(&self, representedURL: Option<&NSURL>); + + #[method_id(@__retain_semantics Other representedFilename)] + pub unsafe fn representedFilename(&self) -> Id; + + #[method(setRepresentedFilename:)] + pub unsafe fn setRepresentedFilename(&self, representedFilename: &NSString); + + #[method(setTitleWithRepresentedFilename:)] + pub unsafe fn setTitleWithRepresentedFilename(&self, filename: &NSString); + + #[method(isExcludedFromWindowsMenu)] + pub unsafe fn isExcludedFromWindowsMenu(&self) -> bool; + + #[method(setExcludedFromWindowsMenu:)] + pub unsafe fn setExcludedFromWindowsMenu(&self, excludedFromWindowsMenu: bool); + + #[method_id(@__retain_semantics Other contentView)] + pub unsafe fn contentView(&self) -> Option>; + + #[method(setContentView:)] + pub unsafe fn setContentView(&self, contentView: Option<&NSView>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSWindowDelegate>); + + #[method(windowNumber)] + pub unsafe fn windowNumber(&self) -> NSInteger; + + #[method(styleMask)] + pub unsafe fn styleMask(&self) -> NSWindowStyleMask; + + #[method(setStyleMask:)] + pub unsafe fn setStyleMask(&self, styleMask: NSWindowStyleMask); + + #[method_id(@__retain_semantics Other fieldEditor:forObject:)] + pub unsafe fn fieldEditor_forObject( + &self, + createFlag: bool, + object: Option<&Object>, + ) -> Option>; + + #[method(endEditingFor:)] + pub unsafe fn endEditingFor(&self, object: Option<&Object>); + + #[method(constrainFrameRect:toScreen:)] + pub unsafe fn constrainFrameRect_toScreen( + &self, + frameRect: NSRect, + screen: Option<&NSScreen>, + ) -> NSRect; + + #[method(setFrame:display:)] + pub unsafe fn setFrame_display(&self, frameRect: NSRect, flag: bool); + + #[method(setContentSize:)] + pub unsafe fn setContentSize(&self, size: NSSize); + + #[method(setFrameOrigin:)] + pub unsafe fn setFrameOrigin(&self, point: NSPoint); + + #[method(setFrameTopLeftPoint:)] + pub unsafe fn setFrameTopLeftPoint(&self, point: NSPoint); + + #[method(cascadeTopLeftFromPoint:)] + pub unsafe fn cascadeTopLeftFromPoint(&self, topLeftPoint: NSPoint) -> NSPoint; + + #[method(frame)] + pub unsafe fn frame(&self) -> NSRect; + + #[method(animationResizeTime:)] + pub unsafe fn animationResizeTime(&self, newFrame: NSRect) -> NSTimeInterval; + + #[method(setFrame:display:animate:)] + pub unsafe fn setFrame_display_animate( + &self, + frameRect: NSRect, + displayFlag: bool, + animateFlag: bool, + ); + + #[method(inLiveResize)] + pub unsafe fn inLiveResize(&self) -> bool; + + #[method(resizeIncrements)] + pub unsafe fn resizeIncrements(&self) -> NSSize; + + #[method(setResizeIncrements:)] + pub unsafe fn setResizeIncrements(&self, resizeIncrements: NSSize); + + #[method(aspectRatio)] + pub unsafe fn aspectRatio(&self) -> NSSize; + + #[method(setAspectRatio:)] + pub unsafe fn setAspectRatio(&self, aspectRatio: NSSize); + + #[method(contentResizeIncrements)] + pub unsafe fn contentResizeIncrements(&self) -> NSSize; + + #[method(setContentResizeIncrements:)] + pub unsafe fn setContentResizeIncrements(&self, contentResizeIncrements: NSSize); + + #[method(contentAspectRatio)] + pub unsafe fn contentAspectRatio(&self) -> NSSize; + + #[method(setContentAspectRatio:)] + pub unsafe fn setContentAspectRatio(&self, contentAspectRatio: NSSize); + + #[method(viewsNeedDisplay)] + pub unsafe fn viewsNeedDisplay(&self) -> bool; + + #[method(setViewsNeedDisplay:)] + pub unsafe fn setViewsNeedDisplay(&self, viewsNeedDisplay: bool); + + #[method(displayIfNeeded)] + pub unsafe fn displayIfNeeded(&self); + + #[method(display)] + pub unsafe fn display(&self); + + #[method(preservesContentDuringLiveResize)] + pub unsafe fn preservesContentDuringLiveResize(&self) -> bool; + + #[method(setPreservesContentDuringLiveResize:)] + pub unsafe fn setPreservesContentDuringLiveResize( + &self, + preservesContentDuringLiveResize: bool, + ); + + #[method(update)] + pub unsafe fn update(&self); + + #[method(makeFirstResponder:)] + pub unsafe fn makeFirstResponder(&self, responder: Option<&NSResponder>) -> bool; + + #[method_id(@__retain_semantics Other firstResponder)] + pub unsafe fn firstResponder(&self) -> Option>; + + #[method(resizeFlags)] + pub unsafe fn resizeFlags(&self) -> NSEventModifierFlags; + + #[method(close)] + pub unsafe fn close(&self); + + #[method(isReleasedWhenClosed)] + pub unsafe fn isReleasedWhenClosed(&self) -> bool; + + #[method(setReleasedWhenClosed:)] + pub unsafe fn setReleasedWhenClosed(&self, releasedWhenClosed: bool); + + #[method(miniaturize:)] + pub unsafe fn miniaturize(&self, sender: Option<&Object>); + + #[method(deminiaturize:)] + pub unsafe fn deminiaturize(&self, sender: Option<&Object>); + + #[method(isZoomed)] + pub unsafe fn isZoomed(&self) -> bool; + + #[method(zoom:)] + pub unsafe fn zoom(&self, sender: Option<&Object>); + + #[method(isMiniaturized)] + pub unsafe fn isMiniaturized(&self) -> bool; + + #[method(tryToPerform:with:)] + pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&Object>) -> bool; + + #[method_id(@__retain_semantics Other validRequestorForSendType:returnType:)] + pub unsafe fn validRequestorForSendType_returnType( + &self, + sendType: Option<&NSPasteboardType>, + returnType: Option<&NSPasteboardType>, + ) -> Option>; + + #[method_id(@__retain_semantics Other backgroundColor)] + pub unsafe fn backgroundColor(&self) -> Id; + + #[method(setBackgroundColor:)] + pub unsafe fn setBackgroundColor(&self, backgroundColor: Option<&NSColor>); + + #[method(setContentBorderThickness:forEdge:)] + pub unsafe fn setContentBorderThickness_forEdge( + &self, + thickness: CGFloat, + edge: NSRectEdge, + ); + + #[method(contentBorderThicknessForEdge:)] + pub unsafe fn contentBorderThicknessForEdge(&self, edge: NSRectEdge) -> CGFloat; + + #[method(setAutorecalculatesContentBorderThickness:forEdge:)] + pub unsafe fn setAutorecalculatesContentBorderThickness_forEdge( + &self, + flag: bool, + edge: NSRectEdge, + ); + + #[method(autorecalculatesContentBorderThicknessForEdge:)] + pub unsafe fn autorecalculatesContentBorderThicknessForEdge( + &self, + edge: NSRectEdge, + ) -> bool; + + #[method(isMovable)] + pub unsafe fn isMovable(&self) -> bool; + + #[method(setMovable:)] + pub unsafe fn setMovable(&self, movable: bool); + + #[method(isMovableByWindowBackground)] + pub unsafe fn isMovableByWindowBackground(&self) -> bool; + + #[method(setMovableByWindowBackground:)] + pub unsafe fn setMovableByWindowBackground(&self, movableByWindowBackground: bool); + + #[method(hidesOnDeactivate)] + pub unsafe fn hidesOnDeactivate(&self) -> bool; + + #[method(setHidesOnDeactivate:)] + pub unsafe fn setHidesOnDeactivate(&self, hidesOnDeactivate: bool); + + #[method(canHide)] + pub unsafe fn canHide(&self) -> bool; + + #[method(setCanHide:)] + pub unsafe fn setCanHide(&self, canHide: bool); + + #[method(center)] + pub unsafe fn center(&self); + + #[method(makeKeyAndOrderFront:)] + pub unsafe fn makeKeyAndOrderFront(&self, sender: Option<&Object>); + + #[method(orderFront:)] + pub unsafe fn orderFront(&self, sender: Option<&Object>); + + #[method(orderBack:)] + pub unsafe fn orderBack(&self, sender: Option<&Object>); + + #[method(orderOut:)] + pub unsafe fn orderOut(&self, sender: Option<&Object>); + + #[method(orderWindow:relativeTo:)] + pub unsafe fn orderWindow_relativeTo( + &self, + place: NSWindowOrderingMode, + otherWin: NSInteger, + ); + + #[method(orderFrontRegardless)] + pub unsafe fn orderFrontRegardless(&self); + + #[method_id(@__retain_semantics Other miniwindowImage)] + pub unsafe fn miniwindowImage(&self) -> Option>; + + #[method(setMiniwindowImage:)] + pub unsafe fn setMiniwindowImage(&self, miniwindowImage: Option<&NSImage>); + + #[method_id(@__retain_semantics Other miniwindowTitle)] + pub unsafe fn miniwindowTitle(&self) -> Id; + + #[method(setMiniwindowTitle:)] + pub unsafe fn setMiniwindowTitle(&self, miniwindowTitle: Option<&NSString>); + + #[method_id(@__retain_semantics Other dockTile)] + pub unsafe fn dockTile(&self) -> Id; + + #[method(isDocumentEdited)] + pub unsafe fn isDocumentEdited(&self) -> bool; + + #[method(setDocumentEdited:)] + pub unsafe fn setDocumentEdited(&self, documentEdited: bool); + + #[method(isVisible)] + pub unsafe fn isVisible(&self) -> bool; + + #[method(isKeyWindow)] + pub unsafe fn isKeyWindow(&self) -> bool; + + #[method(isMainWindow)] + pub unsafe fn isMainWindow(&self) -> bool; + + #[method(canBecomeKeyWindow)] + pub unsafe fn canBecomeKeyWindow(&self) -> bool; + + #[method(canBecomeMainWindow)] + pub unsafe fn canBecomeMainWindow(&self) -> bool; + + #[method(makeKeyWindow)] + pub unsafe fn makeKeyWindow(&self); + + #[method(makeMainWindow)] + pub unsafe fn makeMainWindow(&self); + + #[method(becomeKeyWindow)] + pub unsafe fn becomeKeyWindow(&self); + + #[method(resignKeyWindow)] + pub unsafe fn resignKeyWindow(&self); + + #[method(becomeMainWindow)] + pub unsafe fn becomeMainWindow(&self); + + #[method(resignMainWindow)] + pub unsafe fn resignMainWindow(&self); + + #[method(worksWhenModal)] + pub unsafe fn worksWhenModal(&self) -> bool; + + #[method(preventsApplicationTerminationWhenModal)] + pub unsafe fn preventsApplicationTerminationWhenModal(&self) -> bool; + + #[method(setPreventsApplicationTerminationWhenModal:)] + pub unsafe fn setPreventsApplicationTerminationWhenModal( + &self, + preventsApplicationTerminationWhenModal: bool, + ); + + #[method(convertRectToScreen:)] + pub unsafe fn convertRectToScreen(&self, rect: NSRect) -> NSRect; + + #[method(convertRectFromScreen:)] + pub unsafe fn convertRectFromScreen(&self, rect: NSRect) -> NSRect; + + #[method(convertPointToScreen:)] + pub unsafe fn convertPointToScreen(&self, point: NSPoint) -> NSPoint; + + #[method(convertPointFromScreen:)] + pub unsafe fn convertPointFromScreen(&self, point: NSPoint) -> NSPoint; + + #[method(convertRectToBacking:)] + pub unsafe fn convertRectToBacking(&self, rect: NSRect) -> NSRect; + + #[method(convertRectFromBacking:)] + pub unsafe fn convertRectFromBacking(&self, rect: NSRect) -> NSRect; + + #[method(convertPointToBacking:)] + pub unsafe fn convertPointToBacking(&self, point: NSPoint) -> NSPoint; + + #[method(convertPointFromBacking:)] + pub unsafe fn convertPointFromBacking(&self, point: NSPoint) -> NSPoint; + + #[method(backingAlignedRect:options:)] + pub unsafe fn backingAlignedRect_options( + &self, + rect: NSRect, + options: NSAlignmentOptions, + ) -> NSRect; + + #[method(backingScaleFactor)] + pub unsafe fn backingScaleFactor(&self) -> CGFloat; + + #[method(performClose:)] + pub unsafe fn performClose(&self, sender: Option<&Object>); + + #[method(performMiniaturize:)] + pub unsafe fn performMiniaturize(&self, sender: Option<&Object>); + + #[method(performZoom:)] + pub unsafe fn performZoom(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other dataWithEPSInsideRect:)] + pub unsafe fn dataWithEPSInsideRect(&self, rect: NSRect) -> Id; + + #[method_id(@__retain_semantics Other dataWithPDFInsideRect:)] + pub unsafe fn dataWithPDFInsideRect(&self, rect: NSRect) -> Id; + + #[method(print:)] + pub unsafe fn print(&self, sender: Option<&Object>); + + #[method(allowsToolTipsWhenApplicationIsInactive)] + pub unsafe fn allowsToolTipsWhenApplicationIsInactive(&self) -> bool; + + #[method(setAllowsToolTipsWhenApplicationIsInactive:)] + pub unsafe fn setAllowsToolTipsWhenApplicationIsInactive( + &self, + allowsToolTipsWhenApplicationIsInactive: bool, + ); + + #[method(backingType)] + pub unsafe fn backingType(&self) -> NSBackingStoreType; + + #[method(setBackingType:)] + pub unsafe fn setBackingType(&self, backingType: NSBackingStoreType); + + #[method(level)] + pub unsafe fn level(&self) -> NSWindowLevel; + + #[method(setLevel:)] + pub unsafe fn setLevel(&self, level: NSWindowLevel); + + #[method(depthLimit)] + pub unsafe fn depthLimit(&self) -> NSWindowDepth; + + #[method(setDepthLimit:)] + pub unsafe fn setDepthLimit(&self, depthLimit: NSWindowDepth); + + #[method(setDynamicDepthLimit:)] + pub unsafe fn setDynamicDepthLimit(&self, flag: bool); + + #[method(hasDynamicDepthLimit)] + pub unsafe fn hasDynamicDepthLimit(&self) -> bool; + + #[method_id(@__retain_semantics Other screen)] + pub unsafe fn screen(&self) -> Option>; + + #[method_id(@__retain_semantics Other deepestScreen)] + pub unsafe fn deepestScreen(&self) -> Option>; + + #[method(hasShadow)] + pub unsafe fn hasShadow(&self) -> bool; + + #[method(setHasShadow:)] + pub unsafe fn setHasShadow(&self, hasShadow: bool); + + #[method(invalidateShadow)] + pub unsafe fn invalidateShadow(&self); + + #[method(alphaValue)] + pub unsafe fn alphaValue(&self) -> CGFloat; + + #[method(setAlphaValue:)] + pub unsafe fn setAlphaValue(&self, alphaValue: CGFloat); + + #[method(isOpaque)] + pub unsafe fn isOpaque(&self) -> bool; + + #[method(setOpaque:)] + pub unsafe fn setOpaque(&self, opaque: bool); + + #[method(sharingType)] + pub unsafe fn sharingType(&self) -> NSWindowSharingType; + + #[method(setSharingType:)] + pub unsafe fn setSharingType(&self, sharingType: NSWindowSharingType); + + #[method(allowsConcurrentViewDrawing)] + pub unsafe fn allowsConcurrentViewDrawing(&self) -> bool; + + #[method(setAllowsConcurrentViewDrawing:)] + pub unsafe fn setAllowsConcurrentViewDrawing(&self, allowsConcurrentViewDrawing: bool); + + #[method(displaysWhenScreenProfileChanges)] + pub unsafe fn displaysWhenScreenProfileChanges(&self) -> bool; + + #[method(setDisplaysWhenScreenProfileChanges:)] + pub unsafe fn setDisplaysWhenScreenProfileChanges( + &self, + displaysWhenScreenProfileChanges: bool, + ); + + #[method(disableScreenUpdatesUntilFlush)] + pub unsafe fn disableScreenUpdatesUntilFlush(&self); + + #[method(canBecomeVisibleWithoutLogin)] + pub unsafe fn canBecomeVisibleWithoutLogin(&self) -> bool; + + #[method(setCanBecomeVisibleWithoutLogin:)] + pub unsafe fn setCanBecomeVisibleWithoutLogin(&self, canBecomeVisibleWithoutLogin: bool); + + #[method(collectionBehavior)] + pub unsafe fn collectionBehavior(&self) -> NSWindowCollectionBehavior; + + #[method(setCollectionBehavior:)] + pub unsafe fn setCollectionBehavior(&self, collectionBehavior: NSWindowCollectionBehavior); + + #[method(animationBehavior)] + pub unsafe fn animationBehavior(&self) -> NSWindowAnimationBehavior; + + #[method(setAnimationBehavior:)] + pub unsafe fn setAnimationBehavior(&self, animationBehavior: NSWindowAnimationBehavior); + + #[method(isOnActiveSpace)] + pub unsafe fn isOnActiveSpace(&self) -> bool; + + #[method(toggleFullScreen:)] + pub unsafe fn toggleFullScreen(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other stringWithSavedFrame)] + pub unsafe fn stringWithSavedFrame(&self) + -> Id; + + #[method(setFrameFromString:)] + pub unsafe fn setFrameFromString(&self, string: &NSWindowPersistableFrameDescriptor); + + #[method(saveFrameUsingName:)] + pub unsafe fn saveFrameUsingName(&self, name: &NSWindowFrameAutosaveName); + + #[method(setFrameUsingName:force:)] + pub unsafe fn setFrameUsingName_force( + &self, + name: &NSWindowFrameAutosaveName, + force: bool, + ) -> bool; + + #[method(setFrameUsingName:)] + pub unsafe fn setFrameUsingName(&self, name: &NSWindowFrameAutosaveName) -> bool; + + #[method(setFrameAutosaveName:)] + pub unsafe fn setFrameAutosaveName(&self, name: &NSWindowFrameAutosaveName) -> bool; + + #[method_id(@__retain_semantics Other frameAutosaveName)] + pub unsafe fn frameAutosaveName(&self) -> Id; + + #[method(removeFrameUsingName:)] + pub unsafe fn removeFrameUsingName(name: &NSWindowFrameAutosaveName); + + #[method(minSize)] + pub unsafe fn minSize(&self) -> NSSize; + + #[method(setMinSize:)] + pub unsafe fn setMinSize(&self, minSize: NSSize); + + #[method(maxSize)] + pub unsafe fn maxSize(&self) -> NSSize; + + #[method(setMaxSize:)] + pub unsafe fn setMaxSize(&self, maxSize: NSSize); + + #[method(contentMinSize)] + pub unsafe fn contentMinSize(&self) -> NSSize; + + #[method(setContentMinSize:)] + pub unsafe fn setContentMinSize(&self, contentMinSize: NSSize); + + #[method(contentMaxSize)] + pub unsafe fn contentMaxSize(&self) -> NSSize; + + #[method(setContentMaxSize:)] + pub unsafe fn setContentMaxSize(&self, contentMaxSize: NSSize); + + #[method(minFullScreenContentSize)] + pub unsafe fn minFullScreenContentSize(&self) -> NSSize; + + #[method(setMinFullScreenContentSize:)] + pub unsafe fn setMinFullScreenContentSize(&self, minFullScreenContentSize: NSSize); + + #[method(maxFullScreenContentSize)] + pub unsafe fn maxFullScreenContentSize(&self) -> NSSize; + + #[method(setMaxFullScreenContentSize:)] + pub unsafe fn setMaxFullScreenContentSize(&self, maxFullScreenContentSize: NSSize); + + #[method_id(@__retain_semantics Other deviceDescription)] + pub unsafe fn deviceDescription( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other windowController)] + pub unsafe fn windowController(&self) -> Option>; + + #[method(setWindowController:)] + pub unsafe fn setWindowController(&self, windowController: Option<&NSWindowController>); + + #[method(beginSheet:completionHandler:)] + pub unsafe fn beginSheet_completionHandler( + &self, + sheetWindow: &NSWindow, + handler: Option<&Block<(NSModalResponse,), ()>>, + ); + + #[method(beginCriticalSheet:completionHandler:)] + pub unsafe fn beginCriticalSheet_completionHandler( + &self, + sheetWindow: &NSWindow, + handler: Option<&Block<(NSModalResponse,), ()>>, + ); + + #[method(endSheet:)] + pub unsafe fn endSheet(&self, sheetWindow: &NSWindow); + + #[method(endSheet:returnCode:)] + pub unsafe fn endSheet_returnCode( + &self, + sheetWindow: &NSWindow, + returnCode: NSModalResponse, + ); + + #[method_id(@__retain_semantics Other sheets)] + pub unsafe fn sheets(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other attachedSheet)] + pub unsafe fn attachedSheet(&self) -> Option>; + + #[method(isSheet)] + pub unsafe fn isSheet(&self) -> bool; + + #[method_id(@__retain_semantics Other sheetParent)] + pub unsafe fn sheetParent(&self) -> Option>; + + #[method_id(@__retain_semantics Other standardWindowButton:forStyleMask:)] + pub unsafe fn standardWindowButton_forStyleMask( + b: NSWindowButton, + styleMask: NSWindowStyleMask, + ) -> Option>; + + #[method_id(@__retain_semantics Other standardWindowButton:)] + pub unsafe fn standardWindowButton( + &self, + b: NSWindowButton, + ) -> Option>; + + #[method(addChildWindow:ordered:)] + pub unsafe fn addChildWindow_ordered( + &self, + childWin: &NSWindow, + place: NSWindowOrderingMode, + ); + + #[method(removeChildWindow:)] + pub unsafe fn removeChildWindow(&self, childWin: &NSWindow); + + #[method_id(@__retain_semantics Other childWindows)] + pub unsafe fn childWindows(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other parentWindow)] + pub unsafe fn parentWindow(&self) -> Option>; + + #[method(setParentWindow:)] + pub unsafe fn setParentWindow(&self, parentWindow: Option<&NSWindow>); + + #[method_id(@__retain_semantics Other appearanceSource)] + pub unsafe fn appearanceSource(&self) -> Option>; + + #[method(setAppearanceSource:)] + pub unsafe fn setAppearanceSource(&self, appearanceSource: Option<&TodoProtocols>); + + #[method_id(@__retain_semantics Other colorSpace)] + pub unsafe fn colorSpace(&self) -> Option>; + + #[method(setColorSpace:)] + pub unsafe fn setColorSpace(&self, colorSpace: Option<&NSColorSpace>); + + #[method(canRepresentDisplayGamut:)] + pub unsafe fn canRepresentDisplayGamut(&self, displayGamut: NSDisplayGamut) -> bool; + + #[method_id(@__retain_semantics Other windowNumbersWithOptions:)] + pub unsafe fn windowNumbersWithOptions( + options: NSWindowNumberListOptions, + ) -> Option, Shared>>; + + #[method(windowNumberAtPoint:belowWindowWithWindowNumber:)] + pub unsafe fn windowNumberAtPoint_belowWindowWithWindowNumber( + point: NSPoint, + windowNumber: NSInteger, + ) -> NSInteger; + + #[method(occlusionState)] + pub unsafe fn occlusionState(&self) -> NSWindowOcclusionState; + + #[method(titlebarSeparatorStyle)] + pub unsafe fn titlebarSeparatorStyle(&self) -> NSTitlebarSeparatorStyle; + + #[method(setTitlebarSeparatorStyle:)] + pub unsafe fn setTitlebarSeparatorStyle( + &self, + titlebarSeparatorStyle: NSTitlebarSeparatorStyle, + ); + + #[method_id(@__retain_semantics Other contentViewController)] + pub unsafe fn contentViewController(&self) -> Option>; + + #[method(setContentViewController:)] + pub unsafe fn setContentViewController( + &self, + contentViewController: Option<&NSViewController>, + ); + + #[method_id(@__retain_semantics Other windowWithContentViewController:)] + pub unsafe fn windowWithContentViewController( + contentViewController: &NSViewController, + ) -> Id; + + #[method(performWindowDragWithEvent:)] + pub unsafe fn performWindowDragWithEvent(&self, event: &NSEvent); + + #[method_id(@__retain_semantics Other initialFirstResponder)] + pub unsafe fn initialFirstResponder(&self) -> Option>; + + #[method(setInitialFirstResponder:)] + pub unsafe fn setInitialFirstResponder(&self, initialFirstResponder: Option<&NSView>); + + #[method(selectNextKeyView:)] + pub unsafe fn selectNextKeyView(&self, sender: Option<&Object>); + + #[method(selectPreviousKeyView:)] + pub unsafe fn selectPreviousKeyView(&self, sender: Option<&Object>); + + #[method(selectKeyViewFollowingView:)] + pub unsafe fn selectKeyViewFollowingView(&self, view: &NSView); + + #[method(selectKeyViewPrecedingView:)] + pub unsafe fn selectKeyViewPrecedingView(&self, view: &NSView); + + #[method(keyViewSelectionDirection)] + pub unsafe fn keyViewSelectionDirection(&self) -> NSSelectionDirection; + + #[method_id(@__retain_semantics Other defaultButtonCell)] + pub unsafe fn defaultButtonCell(&self) -> Option>; + + #[method(setDefaultButtonCell:)] + pub unsafe fn setDefaultButtonCell(&self, defaultButtonCell: Option<&NSButtonCell>); + + #[method(disableKeyEquivalentForDefaultButtonCell)] + pub unsafe fn disableKeyEquivalentForDefaultButtonCell(&self); + + #[method(enableKeyEquivalentForDefaultButtonCell)] + pub unsafe fn enableKeyEquivalentForDefaultButtonCell(&self); + + #[method(autorecalculatesKeyViewLoop)] + pub unsafe fn autorecalculatesKeyViewLoop(&self) -> bool; + + #[method(setAutorecalculatesKeyViewLoop:)] + pub unsafe fn setAutorecalculatesKeyViewLoop(&self, autorecalculatesKeyViewLoop: bool); + + #[method(recalculateKeyViewLoop)] + pub unsafe fn recalculateKeyViewLoop(&self); + + #[method_id(@__retain_semantics Other toolbar)] + pub unsafe fn toolbar(&self) -> Option>; + + #[method(setToolbar:)] + pub unsafe fn setToolbar(&self, toolbar: Option<&NSToolbar>); + + #[method(toggleToolbarShown:)] + pub unsafe fn toggleToolbarShown(&self, sender: Option<&Object>); + + #[method(runToolbarCustomizationPalette:)] + pub unsafe fn runToolbarCustomizationPalette(&self, sender: Option<&Object>); + + #[method(showsToolbarButton)] + pub unsafe fn showsToolbarButton(&self) -> bool; + + #[method(setShowsToolbarButton:)] + pub unsafe fn setShowsToolbarButton(&self, showsToolbarButton: bool); + + #[method(allowsAutomaticWindowTabbing)] + pub unsafe fn allowsAutomaticWindowTabbing() -> bool; + + #[method(setAllowsAutomaticWindowTabbing:)] + pub unsafe fn setAllowsAutomaticWindowTabbing(allowsAutomaticWindowTabbing: bool); + + #[method(userTabbingPreference)] + pub unsafe fn userTabbingPreference() -> NSWindowUserTabbingPreference; + + #[method(tabbingMode)] + pub unsafe fn tabbingMode(&self) -> NSWindowTabbingMode; + + #[method(setTabbingMode:)] + pub unsafe fn setTabbingMode(&self, tabbingMode: NSWindowTabbingMode); + + #[method_id(@__retain_semantics Other tabbingIdentifier)] + pub unsafe fn tabbingIdentifier(&self) -> Id; + + #[method(setTabbingIdentifier:)] + pub unsafe fn setTabbingIdentifier(&self, tabbingIdentifier: &NSWindowTabbingIdentifier); + + #[method(selectNextTab:)] + pub unsafe fn selectNextTab(&self, sender: Option<&Object>); + + #[method(selectPreviousTab:)] + pub unsafe fn selectPreviousTab(&self, sender: Option<&Object>); + + #[method(moveTabToNewWindow:)] + pub unsafe fn moveTabToNewWindow(&self, sender: Option<&Object>); + + #[method(mergeAllWindows:)] + pub unsafe fn mergeAllWindows(&self, sender: Option<&Object>); + + #[method(toggleTabBar:)] + pub unsafe fn toggleTabBar(&self, sender: Option<&Object>); + + #[method(toggleTabOverview:)] + pub unsafe fn toggleTabOverview(&self, sender: Option<&Object>); + + #[method_id(@__retain_semantics Other tabbedWindows)] + pub unsafe fn tabbedWindows(&self) -> Option, Shared>>; + + #[method(addTabbedWindow:ordered:)] + pub unsafe fn addTabbedWindow_ordered( + &self, + window: &NSWindow, + ordered: NSWindowOrderingMode, + ); + + #[method_id(@__retain_semantics Other tab)] + pub unsafe fn tab(&self) -> Id; + + #[method_id(@__retain_semantics Other tabGroup)] + pub unsafe fn tabGroup(&self) -> Option>; + + #[method(windowTitlebarLayoutDirection)] + pub unsafe fn windowTitlebarLayoutDirection(&self) -> NSUserInterfaceLayoutDirection; + } +); + +extern_methods!( + /// NSEvent + unsafe impl NSWindow { + #[method(trackEventsMatchingMask:timeout:mode:handler:)] + pub unsafe fn trackEventsMatchingMask_timeout_mode_handler( + &self, + mask: NSEventMask, + timeout: NSTimeInterval, + mode: &NSRunLoopMode, + trackingHandler: &Block<(*mut NSEvent, NonNull), ()>, + ); + + #[method_id(@__retain_semantics Other nextEventMatchingMask:)] + pub unsafe fn nextEventMatchingMask( + &self, + mask: NSEventMask, + ) -> Option>; + + #[method_id(@__retain_semantics Other nextEventMatchingMask:untilDate:inMode:dequeue:)] + pub unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue( + &self, + mask: NSEventMask, + expiration: Option<&NSDate>, + mode: &NSRunLoopMode, + deqFlag: bool, + ) -> Option>; + + #[method(discardEventsMatchingMask:beforeEvent:)] + pub unsafe fn discardEventsMatchingMask_beforeEvent( + &self, + mask: NSEventMask, + lastEvent: Option<&NSEvent>, + ); + + #[method(postEvent:atStart:)] + pub unsafe fn postEvent_atStart(&self, event: &NSEvent, flag: bool); + + #[method(sendEvent:)] + pub unsafe fn sendEvent(&self, event: &NSEvent); + + #[method_id(@__retain_semantics Other currentEvent)] + pub unsafe fn currentEvent(&self) -> Option>; + + #[method(acceptsMouseMovedEvents)] + pub unsafe fn acceptsMouseMovedEvents(&self) -> bool; + + #[method(setAcceptsMouseMovedEvents:)] + pub unsafe fn setAcceptsMouseMovedEvents(&self, acceptsMouseMovedEvents: bool); + + #[method(ignoresMouseEvents)] + pub unsafe fn ignoresMouseEvents(&self) -> bool; + + #[method(setIgnoresMouseEvents:)] + pub unsafe fn setIgnoresMouseEvents(&self, ignoresMouseEvents: bool); + + #[method(mouseLocationOutsideOfEventStream)] + pub unsafe fn mouseLocationOutsideOfEventStream(&self) -> NSPoint; + } +); + +extern_methods!( + /// NSCursorRect + unsafe impl NSWindow { + #[method(disableCursorRects)] + pub unsafe fn disableCursorRects(&self); + + #[method(enableCursorRects)] + pub unsafe fn enableCursorRects(&self); + + #[method(discardCursorRects)] + pub unsafe fn discardCursorRects(&self); + + #[method(areCursorRectsEnabled)] + pub unsafe fn areCursorRectsEnabled(&self) -> bool; + + #[method(invalidateCursorRectsForView:)] + pub unsafe fn invalidateCursorRectsForView(&self, view: &NSView); + + #[method(resetCursorRects)] + pub unsafe fn resetCursorRects(&self); + } +); + +extern_methods!( + /// NSDrag + unsafe impl NSWindow { + #[method(dragImage:at:offset:event:pasteboard:source:slideBack:)] + pub unsafe fn dragImage_at_offset_event_pasteboard_source_slideBack( + &self, + image: &NSImage, + baseLocation: NSPoint, + initialOffset: NSSize, + event: &NSEvent, + pboard: &NSPasteboard, + sourceObj: &Object, + slideFlag: bool, + ); + + #[method(registerForDraggedTypes:)] + pub unsafe fn registerForDraggedTypes(&self, newTypes: &NSArray); + + #[method(unregisterDraggedTypes)] + pub unsafe fn unregisterDraggedTypes(&self); + } +); + +extern_methods!( + /// NSCarbonExtensions + unsafe impl NSWindow { + #[method_id(@__retain_semantics Init initWithWindowRef:)] + pub unsafe fn initWithWindowRef( + this: Option>, + windowRef: NonNull, + ) -> Option>; + + #[method(windowRef)] + pub unsafe fn windowRef(&self) -> NonNull; + } +); + +extern_protocol!( + pub struct NSWindowDelegate; + + unsafe impl NSWindowDelegate { + #[optional] + #[method(windowShouldClose:)] + pub unsafe fn windowShouldClose(&self, sender: &NSWindow) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other windowWillReturnFieldEditor:toObject:)] + pub unsafe fn windowWillReturnFieldEditor_toObject( + &self, + sender: &NSWindow, + client: Option<&Object>, + ) -> Option>; + + #[optional] + #[method(windowWillResize:toSize:)] + pub unsafe fn windowWillResize_toSize( + &self, + sender: &NSWindow, + frameSize: NSSize, + ) -> NSSize; + + #[optional] + #[method(windowWillUseStandardFrame:defaultFrame:)] + pub unsafe fn windowWillUseStandardFrame_defaultFrame( + &self, + window: &NSWindow, + newFrame: NSRect, + ) -> NSRect; + + #[optional] + #[method(windowShouldZoom:toFrame:)] + pub unsafe fn windowShouldZoom_toFrame(&self, window: &NSWindow, newFrame: NSRect) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other windowWillReturnUndoManager:)] + pub unsafe fn windowWillReturnUndoManager( + &self, + window: &NSWindow, + ) -> Option>; + + #[optional] + #[method(window:willPositionSheet:usingRect:)] + pub unsafe fn window_willPositionSheet_usingRect( + &self, + window: &NSWindow, + sheet: &NSWindow, + rect: NSRect, + ) -> NSRect; + + #[optional] + #[method(window:shouldPopUpDocumentPathMenu:)] + pub unsafe fn window_shouldPopUpDocumentPathMenu( + &self, + window: &NSWindow, + menu: &NSMenu, + ) -> bool; + + #[optional] + #[method(window:shouldDragDocumentWithEvent:from:withPasteboard:)] + pub unsafe fn window_shouldDragDocumentWithEvent_from_withPasteboard( + &self, + window: &NSWindow, + event: &NSEvent, + dragImageLocation: NSPoint, + pasteboard: &NSPasteboard, + ) -> bool; + + #[optional] + #[method(window:willUseFullScreenContentSize:)] + pub unsafe fn window_willUseFullScreenContentSize( + &self, + window: &NSWindow, + proposedSize: NSSize, + ) -> NSSize; + + #[optional] + #[method(window:willUseFullScreenPresentationOptions:)] + pub unsafe fn window_willUseFullScreenPresentationOptions( + &self, + window: &NSWindow, + proposedOptions: NSApplicationPresentationOptions, + ) -> NSApplicationPresentationOptions; + + #[optional] + #[method_id(@__retain_semantics Other customWindowsToEnterFullScreenForWindow:)] + pub unsafe fn customWindowsToEnterFullScreenForWindow( + &self, + window: &NSWindow, + ) -> Option, Shared>>; + + #[optional] + #[method(window:startCustomAnimationToEnterFullScreenWithDuration:)] + pub unsafe fn window_startCustomAnimationToEnterFullScreenWithDuration( + &self, + window: &NSWindow, + duration: NSTimeInterval, + ); + + #[optional] + #[method(windowDidFailToEnterFullScreen:)] + pub unsafe fn windowDidFailToEnterFullScreen(&self, window: &NSWindow); + + #[optional] + #[method_id(@__retain_semantics Other customWindowsToExitFullScreenForWindow:)] + pub unsafe fn customWindowsToExitFullScreenForWindow( + &self, + window: &NSWindow, + ) -> Option, Shared>>; + + #[optional] + #[method(window:startCustomAnimationToExitFullScreenWithDuration:)] + pub unsafe fn window_startCustomAnimationToExitFullScreenWithDuration( + &self, + window: &NSWindow, + duration: NSTimeInterval, + ); + + #[optional] + #[method_id(@__retain_semantics Other customWindowsToEnterFullScreenForWindow:onScreen:)] + pub unsafe fn customWindowsToEnterFullScreenForWindow_onScreen( + &self, + window: &NSWindow, + screen: &NSScreen, + ) -> Option, Shared>>; + + #[optional] + #[method(window:startCustomAnimationToEnterFullScreenOnScreen:withDuration:)] + pub unsafe fn window_startCustomAnimationToEnterFullScreenOnScreen_withDuration( + &self, + window: &NSWindow, + screen: &NSScreen, + duration: NSTimeInterval, + ); + + #[optional] + #[method(windowDidFailToExitFullScreen:)] + pub unsafe fn windowDidFailToExitFullScreen(&self, window: &NSWindow); + + #[optional] + #[method(window:willResizeForVersionBrowserWithMaxPreferredSize:maxAllowedSize:)] + pub unsafe fn window_willResizeForVersionBrowserWithMaxPreferredSize_maxAllowedSize( + &self, + window: &NSWindow, + maxPreferredFrameSize: NSSize, + maxAllowedFrameSize: NSSize, + ) -> NSSize; + + #[optional] + #[method(window:willEncodeRestorableState:)] + pub unsafe fn window_willEncodeRestorableState(&self, window: &NSWindow, state: &NSCoder); + + #[optional] + #[method(window:didDecodeRestorableState:)] + pub unsafe fn window_didDecodeRestorableState(&self, window: &NSWindow, state: &NSCoder); + + #[optional] + #[method(windowDidResize:)] + pub unsafe fn windowDidResize(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidExpose:)] + pub unsafe fn windowDidExpose(&self, notification: &NSNotification); + + #[optional] + #[method(windowWillMove:)] + pub unsafe fn windowWillMove(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidMove:)] + pub unsafe fn windowDidMove(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidBecomeKey:)] + pub unsafe fn windowDidBecomeKey(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidResignKey:)] + pub unsafe fn windowDidResignKey(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidBecomeMain:)] + pub unsafe fn windowDidBecomeMain(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidResignMain:)] + pub unsafe fn windowDidResignMain(&self, notification: &NSNotification); + + #[optional] + #[method(windowWillClose:)] + pub unsafe fn windowWillClose(&self, notification: &NSNotification); + + #[optional] + #[method(windowWillMiniaturize:)] + pub unsafe fn windowWillMiniaturize(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidMiniaturize:)] + pub unsafe fn windowDidMiniaturize(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidDeminiaturize:)] + pub unsafe fn windowDidDeminiaturize(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidUpdate:)] + pub unsafe fn windowDidUpdate(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidChangeScreen:)] + pub unsafe fn windowDidChangeScreen(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidChangeScreenProfile:)] + pub unsafe fn windowDidChangeScreenProfile(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidChangeBackingProperties:)] + pub unsafe fn windowDidChangeBackingProperties(&self, notification: &NSNotification); + + #[optional] + #[method(windowWillBeginSheet:)] + pub unsafe fn windowWillBeginSheet(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidEndSheet:)] + pub unsafe fn windowDidEndSheet(&self, notification: &NSNotification); + + #[optional] + #[method(windowWillStartLiveResize:)] + pub unsafe fn windowWillStartLiveResize(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidEndLiveResize:)] + pub unsafe fn windowDidEndLiveResize(&self, notification: &NSNotification); + + #[optional] + #[method(windowWillEnterFullScreen:)] + pub unsafe fn windowWillEnterFullScreen(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidEnterFullScreen:)] + pub unsafe fn windowDidEnterFullScreen(&self, notification: &NSNotification); + + #[optional] + #[method(windowWillExitFullScreen:)] + pub unsafe fn windowWillExitFullScreen(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidExitFullScreen:)] + pub unsafe fn windowDidExitFullScreen(&self, notification: &NSNotification); + + #[optional] + #[method(windowWillEnterVersionBrowser:)] + pub unsafe fn windowWillEnterVersionBrowser(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidEnterVersionBrowser:)] + pub unsafe fn windowDidEnterVersionBrowser(&self, notification: &NSNotification); + + #[optional] + #[method(windowWillExitVersionBrowser:)] + pub unsafe fn windowWillExitVersionBrowser(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidExitVersionBrowser:)] + pub unsafe fn windowDidExitVersionBrowser(&self, notification: &NSNotification); + + #[optional] + #[method(windowDidChangeOcclusionState:)] + pub unsafe fn windowDidChangeOcclusionState(&self, notification: &NSNotification); + } +); + +extern_static!(NSWindowDidBecomeKeyNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidBecomeMainNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidChangeScreenNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidDeminiaturizeNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidExposeNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidMiniaturizeNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidMoveNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidResignKeyNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidResignMainNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidResizeNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidUpdateNotification: &'static NSNotificationName); + +extern_static!(NSWindowWillCloseNotification: &'static NSNotificationName); + +extern_static!(NSWindowWillMiniaturizeNotification: &'static NSNotificationName); + +extern_static!(NSWindowWillMoveNotification: &'static NSNotificationName); + +extern_static!(NSWindowWillBeginSheetNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidEndSheetNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidChangeBackingPropertiesNotification: &'static NSNotificationName); + +extern_static!(NSBackingPropertyOldScaleFactorKey: &'static NSString); + +extern_static!(NSBackingPropertyOldColorSpaceKey: &'static NSString); + +extern_static!(NSWindowDidChangeScreenProfileNotification: &'static NSNotificationName); + +extern_static!(NSWindowWillStartLiveResizeNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidEndLiveResizeNotification: &'static NSNotificationName); + +extern_static!(NSWindowWillEnterFullScreenNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidEnterFullScreenNotification: &'static NSNotificationName); + +extern_static!(NSWindowWillExitFullScreenNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidExitFullScreenNotification: &'static NSNotificationName); + +extern_static!(NSWindowWillEnterVersionBrowserNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidEnterVersionBrowserNotification: &'static NSNotificationName); + +extern_static!(NSWindowWillExitVersionBrowserNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidExitVersionBrowserNotification: &'static NSNotificationName); + +extern_static!(NSWindowDidChangeOcclusionStateNotification: &'static NSNotificationName); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSWindowBackingLocation { + NSWindowBackingLocationDefault = 0, + NSWindowBackingLocationVideoMemory = 1, + NSWindowBackingLocationMainMemory = 2, + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSWindow { + #[method(cacheImageInRect:)] + pub unsafe fn cacheImageInRect(&self, rect: NSRect); + + #[method(restoreCachedImage)] + pub unsafe fn restoreCachedImage(&self); + + #[method(discardCachedImage)] + pub unsafe fn discardCachedImage(&self); + + #[method(menuChanged:)] + pub unsafe fn menuChanged(menu: &NSMenu); + + #[method(gState)] + pub unsafe fn gState(&self) -> NSInteger; + + #[method(convertBaseToScreen:)] + pub unsafe fn convertBaseToScreen(&self, point: NSPoint) -> NSPoint; + + #[method(convertScreenToBase:)] + pub unsafe fn convertScreenToBase(&self, point: NSPoint) -> NSPoint; + + #[method(userSpaceScaleFactor)] + pub unsafe fn userSpaceScaleFactor(&self) -> CGFloat; + + #[method(useOptimizedDrawing:)] + pub unsafe fn useOptimizedDrawing(&self, flag: bool); + + #[method(canStoreColor)] + pub unsafe fn canStoreColor(&self) -> bool; + + #[method(disableFlushWindow)] + pub unsafe fn disableFlushWindow(&self); + + #[method(enableFlushWindow)] + pub unsafe fn enableFlushWindow(&self); + + #[method(isFlushWindowDisabled)] + pub unsafe fn isFlushWindowDisabled(&self) -> bool; + + #[method(flushWindow)] + pub unsafe fn flushWindow(&self); + + #[method(flushWindowIfNeeded)] + pub unsafe fn flushWindowIfNeeded(&self); + + #[method(isAutodisplay)] + pub unsafe fn isAutodisplay(&self) -> bool; + + #[method(setAutodisplay:)] + pub unsafe fn setAutodisplay(&self, autodisplay: bool); + + #[method_id(@__retain_semantics Other graphicsContext)] + pub unsafe fn graphicsContext(&self) -> Option>; + + #[method(isOneShot)] + pub unsafe fn isOneShot(&self) -> bool; + + #[method(setOneShot:)] + pub unsafe fn setOneShot(&self, oneShot: bool); + + #[method(preferredBackingLocation)] + pub unsafe fn preferredBackingLocation(&self) -> NSWindowBackingLocation; + + #[method(setPreferredBackingLocation:)] + pub unsafe fn setPreferredBackingLocation( + &self, + preferredBackingLocation: NSWindowBackingLocation, + ); + + #[method(backingLocation)] + pub unsafe fn backingLocation(&self) -> NSWindowBackingLocation; + + #[method(showsResizeIndicator)] + pub unsafe fn showsResizeIndicator(&self) -> bool; + + #[method(setShowsResizeIndicator:)] + pub unsafe fn setShowsResizeIndicator(&self, showsResizeIndicator: bool); + } +); + +extern_static!(NSBorderlessWindowMask: NSWindowStyleMask = NSWindowStyleMaskBorderless); + +extern_static!(NSTitledWindowMask: NSWindowStyleMask = NSWindowStyleMaskTitled); + +extern_static!(NSClosableWindowMask: NSWindowStyleMask = NSWindowStyleMaskClosable); + +extern_static!(NSMiniaturizableWindowMask: NSWindowStyleMask = NSWindowStyleMaskMiniaturizable); + +extern_static!(NSResizableWindowMask: NSWindowStyleMask = NSWindowStyleMaskResizable); + +extern_static!( + NSTexturedBackgroundWindowMask: NSWindowStyleMask = NSWindowStyleMaskTexturedBackground +); + +extern_static!( + NSUnifiedTitleAndToolbarWindowMask: NSWindowStyleMask = NSWindowStyleMaskUnifiedTitleAndToolbar +); + +extern_static!(NSFullScreenWindowMask: NSWindowStyleMask = NSWindowStyleMaskFullScreen); + +extern_static!( + NSFullSizeContentViewWindowMask: NSWindowStyleMask = NSWindowStyleMaskFullSizeContentView +); + +extern_static!(NSUtilityWindowMask: NSWindowStyleMask = NSWindowStyleMaskUtilityWindow); + +extern_static!(NSDocModalWindowMask: NSWindowStyleMask = NSWindowStyleMaskDocModalWindow); + +extern_static!(NSNonactivatingPanelMask: NSWindowStyleMask = NSWindowStyleMaskNonactivatingPanel); + +extern_static!(NSHUDWindowMask: NSWindowStyleMask = NSWindowStyleMaskHUDWindow); + +extern_static!(NSUnscaledWindowMask: NSWindowStyleMask = 1 << 11); + +extern_static!(NSWindowFullScreenButton: NSWindowButton = 7); diff --git a/crates/icrate/src/generated/AppKit/NSWindowController.rs b/crates/icrate/src/generated/AppKit/NSWindowController.rs new file mode 100644 index 000000000..9c9bbe6de --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSWindowController.rs @@ -0,0 +1,148 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSWindowController; + + unsafe impl ClassType for NSWindowController { + type Super = NSResponder; + } +); + +extern_methods!( + unsafe impl NSWindowController { + #[method_id(@__retain_semantics Init initWithWindow:)] + pub unsafe fn initWithWindow( + this: Option>, + window: Option<&NSWindow>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithWindowNibName:)] + pub unsafe fn initWithWindowNibName( + this: Option>, + windowNibName: &NSNibName, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithWindowNibName:owner:)] + pub unsafe fn initWithWindowNibName_owner( + this: Option>, + windowNibName: &NSNibName, + owner: &Object, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithWindowNibPath:owner:)] + pub unsafe fn initWithWindowNibPath_owner( + this: Option>, + windowNibPath: &NSString, + owner: &Object, + ) -> Id; + + #[method_id(@__retain_semantics Other windowNibName)] + pub unsafe fn windowNibName(&self) -> Option>; + + #[method_id(@__retain_semantics Other windowNibPath)] + pub unsafe fn windowNibPath(&self) -> Option>; + + #[method_id(@__retain_semantics Other owner)] + pub unsafe fn owner(&self) -> Option>; + + #[method_id(@__retain_semantics Other windowFrameAutosaveName)] + pub unsafe fn windowFrameAutosaveName(&self) -> Id; + + #[method(setWindowFrameAutosaveName:)] + pub unsafe fn setWindowFrameAutosaveName( + &self, + windowFrameAutosaveName: &NSWindowFrameAutosaveName, + ); + + #[method(shouldCascadeWindows)] + pub unsafe fn shouldCascadeWindows(&self) -> bool; + + #[method(setShouldCascadeWindows:)] + pub unsafe fn setShouldCascadeWindows(&self, shouldCascadeWindows: bool); + + #[method_id(@__retain_semantics Other document)] + pub unsafe fn document(&self) -> Option>; + + #[method(setDocument:)] + pub unsafe fn setDocument(&self, document: Option<&Object>); + + #[method(setDocumentEdited:)] + pub unsafe fn setDocumentEdited(&self, dirtyFlag: bool); + + #[method(shouldCloseDocument)] + pub unsafe fn shouldCloseDocument(&self) -> bool; + + #[method(setShouldCloseDocument:)] + pub unsafe fn setShouldCloseDocument(&self, shouldCloseDocument: bool); + + #[method(synchronizeWindowTitleWithDocumentName)] + pub unsafe fn synchronizeWindowTitleWithDocumentName(&self); + + #[method_id(@__retain_semantics Other windowTitleForDocumentDisplayName:)] + pub unsafe fn windowTitleForDocumentDisplayName( + &self, + displayName: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other contentViewController)] + pub unsafe fn contentViewController(&self) -> Option>; + + #[method(setContentViewController:)] + pub unsafe fn setContentViewController( + &self, + contentViewController: Option<&NSViewController>, + ); + + #[method_id(@__retain_semantics Other window)] + pub unsafe fn window(&self) -> Option>; + + #[method(setWindow:)] + pub unsafe fn setWindow(&self, window: Option<&NSWindow>); + + #[method(isWindowLoaded)] + pub unsafe fn isWindowLoaded(&self) -> bool; + + #[method(windowWillLoad)] + pub unsafe fn windowWillLoad(&self); + + #[method(windowDidLoad)] + pub unsafe fn windowDidLoad(&self); + + #[method(loadWindow)] + pub unsafe fn loadWindow(&self); + + #[method(close)] + pub unsafe fn close(&self); + + #[method(showWindow:)] + pub unsafe fn showWindow(&self, sender: Option<&Object>); + } +); + +extern_methods!( + /// NSWindowControllerStoryboardingMethods + unsafe impl NSWindowController { + #[method_id(@__retain_semantics Other storyboard)] + pub unsafe fn storyboard(&self) -> Option>; + } +); + +extern_methods!( + /// NSWindowControllerDismissing + unsafe impl NSWindowController { + #[method(dismissController:)] + pub unsafe fn dismissController(&self, sender: Option<&Object>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSWindowRestoration.rs b/crates/icrate/src/generated/AppKit/NSWindowRestoration.rs new file mode 100644 index 000000000..5e573e1e7 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSWindowRestoration.rs @@ -0,0 +1,139 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSWindowRestoration; + + unsafe impl NSWindowRestoration { + #[method(restoreWindowWithIdentifier:state:completionHandler:)] + pub unsafe fn restoreWindowWithIdentifier_state_completionHandler( + identifier: &NSUserInterfaceItemIdentifier, + state: &NSCoder, + completionHandler: &Block<(*mut NSWindow, *mut NSError), ()>, + ); + } +); + +extern_methods!( + /// NSWindowRestoration + unsafe impl NSDocumentController {} +); + +extern_methods!( + /// NSWindowRestoration + unsafe impl NSApplication { + #[method(restoreWindowWithIdentifier:state:completionHandler:)] + pub unsafe fn restoreWindowWithIdentifier_state_completionHandler( + &self, + identifier: &NSUserInterfaceItemIdentifier, + state: &NSCoder, + completionHandler: &Block<(*mut NSWindow, *mut NSError), ()>, + ) -> bool; + } +); + +extern_static!(NSApplicationDidFinishRestoringWindowsNotification: &'static NSNotificationName); + +extern_methods!( + /// NSUserInterfaceRestoration + unsafe impl NSWindow { + #[method(isRestorable)] + pub unsafe fn isRestorable(&self) -> bool; + + #[method(setRestorable:)] + pub unsafe fn setRestorable(&self, restorable: bool); + + #[method_id(@__retain_semantics Other restorationClass)] + pub unsafe fn restorationClass(&self) -> Option>; + + #[method(setRestorationClass:)] + pub unsafe fn setRestorationClass(&self, restorationClass: Option<&TodoProtocols>); + + #[method(disableSnapshotRestoration)] + pub unsafe fn disableSnapshotRestoration(&self); + + #[method(enableSnapshotRestoration)] + pub unsafe fn enableSnapshotRestoration(&self); + } +); + +extern_methods!( + /// NSRestorableState + unsafe impl NSResponder { + #[method(encodeRestorableStateWithCoder:)] + pub unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder); + + #[method(encodeRestorableStateWithCoder:backgroundQueue:)] + pub unsafe fn encodeRestorableStateWithCoder_backgroundQueue( + &self, + coder: &NSCoder, + queue: &NSOperationQueue, + ); + + #[method(restoreStateWithCoder:)] + pub unsafe fn restoreStateWithCoder(&self, coder: &NSCoder); + + #[method(invalidateRestorableState)] + pub unsafe fn invalidateRestorableState(&self); + + #[method_id(@__retain_semantics Other restorableStateKeyPaths)] + pub unsafe fn restorableStateKeyPaths() -> Id, Shared>; + + #[method_id(@__retain_semantics Other allowedClassesForRestorableStateKeyPath:)] + pub unsafe fn allowedClassesForRestorableStateKeyPath( + keyPath: &NSString, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSRestorableStateExtension + unsafe impl NSApplication { + #[method(extendStateRestoration)] + pub unsafe fn extendStateRestoration(&self); + + #[method(completeStateRestoration)] + pub unsafe fn completeStateRestoration(&self); + } +); + +extern_methods!( + /// NSRestorableState + unsafe impl NSDocument { + #[method(restoreDocumentWindowWithIdentifier:state:completionHandler:)] + pub unsafe fn restoreDocumentWindowWithIdentifier_state_completionHandler( + &self, + identifier: &NSUserInterfaceItemIdentifier, + state: &NSCoder, + completionHandler: &Block<(*mut NSWindow, *mut NSError), ()>, + ); + + #[method(encodeRestorableStateWithCoder:)] + pub unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder); + + #[method(encodeRestorableStateWithCoder:backgroundQueue:)] + pub unsafe fn encodeRestorableStateWithCoder_backgroundQueue( + &self, + coder: &NSCoder, + queue: &NSOperationQueue, + ); + + #[method(restoreStateWithCoder:)] + pub unsafe fn restoreStateWithCoder(&self, coder: &NSCoder); + + #[method(invalidateRestorableState)] + pub unsafe fn invalidateRestorableState(&self); + + #[method_id(@__retain_semantics Other restorableStateKeyPaths)] + pub unsafe fn restorableStateKeyPaths() -> Id, Shared>; + + #[method_id(@__retain_semantics Other allowedClassesForRestorableStateKeyPath:)] + pub unsafe fn allowedClassesForRestorableStateKeyPath( + keyPath: &NSString, + ) -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSWindowScripting.rs b/crates/icrate/src/generated/AppKit/NSWindowScripting.rs new file mode 100644 index 000000000..304c953d6 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSWindowScripting.rs @@ -0,0 +1,65 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_methods!( + /// NSScripting + unsafe impl NSWindow { + #[method(hasCloseBox)] + pub unsafe fn hasCloseBox(&self) -> bool; + + #[method(hasTitleBar)] + pub unsafe fn hasTitleBar(&self) -> bool; + + #[method(isFloatingPanel)] + pub unsafe fn isFloatingPanel(&self) -> bool; + + #[method(isMiniaturizable)] + pub unsafe fn isMiniaturizable(&self) -> bool; + + #[method(isModalPanel)] + pub unsafe fn isModalPanel(&self) -> bool; + + #[method(isResizable)] + pub unsafe fn isResizable(&self) -> bool; + + #[method(isZoomable)] + pub unsafe fn isZoomable(&self) -> bool; + + #[method(orderedIndex)] + pub unsafe fn orderedIndex(&self) -> NSInteger; + + #[method(setOrderedIndex:)] + pub unsafe fn setOrderedIndex(&self, orderedIndex: NSInteger); + + #[method(setIsMiniaturized:)] + pub unsafe fn setIsMiniaturized(&self, flag: bool); + + #[method(setIsVisible:)] + pub unsafe fn setIsVisible(&self, flag: bool); + + #[method(setIsZoomed:)] + pub unsafe fn setIsZoomed(&self, flag: bool); + + #[method_id(@__retain_semantics Other handleCloseScriptCommand:)] + pub unsafe fn handleCloseScriptCommand( + &self, + command: &NSCloseCommand, + ) -> Option>; + + #[method_id(@__retain_semantics Other handlePrintScriptCommand:)] + pub unsafe fn handlePrintScriptCommand( + &self, + command: &NSScriptCommand, + ) -> Option>; + + #[method_id(@__retain_semantics Other handleSaveScriptCommand:)] + pub unsafe fn handleSaveScriptCommand( + &self, + command: &NSScriptCommand, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AppKit/NSWindowTab.rs b/crates/icrate/src/generated/AppKit/NSWindowTab.rs new file mode 100644 index 000000000..edb9ad40f --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSWindowTab.rs @@ -0,0 +1,43 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSWindowTab; + + unsafe impl ClassType for NSWindowTab { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSWindowTab { + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Id; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: Option<&NSString>); + + #[method_id(@__retain_semantics Other attributedTitle)] + pub unsafe fn attributedTitle(&self) -> Option>; + + #[method(setAttributedTitle:)] + pub unsafe fn setAttributedTitle(&self, attributedTitle: Option<&NSAttributedString>); + + #[method_id(@__retain_semantics Other toolTip)] + pub unsafe fn toolTip(&self) -> Id; + + #[method(setToolTip:)] + pub unsafe fn setToolTip(&self, toolTip: Option<&NSString>); + + #[method_id(@__retain_semantics Other accessoryView)] + pub unsafe fn accessoryView(&self) -> Option>; + + #[method(setAccessoryView:)] + pub unsafe fn setAccessoryView(&self, accessoryView: Option<&NSView>); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSWindowTabGroup.rs b/crates/icrate/src/generated/AppKit/NSWindowTabGroup.rs new file mode 100644 index 000000000..4543f846d --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSWindowTabGroup.rs @@ -0,0 +1,49 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSWindowTabGroup; + + unsafe impl ClassType for NSWindowTabGroup { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSWindowTabGroup { + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Id; + + #[method_id(@__retain_semantics Other windows)] + pub unsafe fn windows(&self) -> Id, Shared>; + + #[method(isOverviewVisible)] + pub unsafe fn isOverviewVisible(&self) -> bool; + + #[method(setOverviewVisible:)] + pub unsafe fn setOverviewVisible(&self, overviewVisible: bool); + + #[method(isTabBarVisible)] + pub unsafe fn isTabBarVisible(&self) -> bool; + + #[method_id(@__retain_semantics Other selectedWindow)] + pub unsafe fn selectedWindow(&self) -> Option>; + + #[method(setSelectedWindow:)] + pub unsafe fn setSelectedWindow(&self, selectedWindow: Option<&NSWindow>); + + #[method(addWindow:)] + pub unsafe fn addWindow(&self, window: &NSWindow); + + #[method(insertWindow:atIndex:)] + pub unsafe fn insertWindow_atIndex(&self, window: &NSWindow, index: NSInteger); + + #[method(removeWindow:)] + pub unsafe fn removeWindow(&self, window: &NSWindow); + } +); diff --git a/crates/icrate/src/generated/AppKit/NSWorkspace.rs b/crates/icrate/src/generated/AppKit/NSWorkspace.rs new file mode 100644 index 000000000..3001783a3 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/NSWorkspace.rs @@ -0,0 +1,670 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AppKit::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSWorkspaceIconCreationOptions { + NSExcludeQuickDrawElementsIconCreationOption = 1 << 1, + NSExclude10_4ElementsIconCreationOption = 1 << 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSWorkspace; + + unsafe impl ClassType for NSWorkspace { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSWorkspace { + #[method_id(@__retain_semantics Other sharedWorkspace)] + pub unsafe fn sharedWorkspace() -> Id; + + #[method_id(@__retain_semantics Other notificationCenter)] + pub unsafe fn notificationCenter(&self) -> Id; + + #[method(openURL:)] + pub unsafe fn openURL(&self, url: &NSURL) -> bool; + + #[method(openURL:configuration:completionHandler:)] + pub unsafe fn openURL_configuration_completionHandler( + &self, + url: &NSURL, + configuration: &NSWorkspaceOpenConfiguration, + completionHandler: Option<&Block<(*mut NSRunningApplication, *mut NSError), ()>>, + ); + + #[method(openURLs:withApplicationAtURL:configuration:completionHandler:)] + pub unsafe fn openURLs_withApplicationAtURL_configuration_completionHandler( + &self, + urls: &NSArray, + applicationURL: &NSURL, + configuration: &NSWorkspaceOpenConfiguration, + completionHandler: Option<&Block<(*mut NSRunningApplication, *mut NSError), ()>>, + ); + + #[method(openApplicationAtURL:configuration:completionHandler:)] + pub unsafe fn openApplicationAtURL_configuration_completionHandler( + &self, + applicationURL: &NSURL, + configuration: &NSWorkspaceOpenConfiguration, + completionHandler: Option<&Block<(*mut NSRunningApplication, *mut NSError), ()>>, + ); + + #[method(selectFile:inFileViewerRootedAtPath:)] + pub unsafe fn selectFile_inFileViewerRootedAtPath( + &self, + fullPath: Option<&NSString>, + rootFullPath: &NSString, + ) -> bool; + + #[method(activateFileViewerSelectingURLs:)] + pub unsafe fn activateFileViewerSelectingURLs(&self, fileURLs: &NSArray); + + #[method(showSearchResultsForQueryString:)] + pub unsafe fn showSearchResultsForQueryString(&self, queryString: &NSString) -> bool; + + #[method(isFilePackageAtPath:)] + pub unsafe fn isFilePackageAtPath(&self, fullPath: &NSString) -> bool; + + #[method_id(@__retain_semantics Other iconForFile:)] + pub unsafe fn iconForFile(&self, fullPath: &NSString) -> Id; + + #[method_id(@__retain_semantics Other iconForFiles:)] + pub unsafe fn iconForFiles( + &self, + fullPaths: &NSArray, + ) -> Option>; + + #[method(setIcon:forFile:options:)] + pub unsafe fn setIcon_forFile_options( + &self, + image: Option<&NSImage>, + fullPath: &NSString, + options: NSWorkspaceIconCreationOptions, + ) -> bool; + + #[method_id(@__retain_semantics Other fileLabels)] + pub unsafe fn fileLabels(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other fileLabelColors)] + pub unsafe fn fileLabelColors(&self) -> Id, Shared>; + + #[method(recycleURLs:completionHandler:)] + pub unsafe fn recycleURLs_completionHandler( + &self, + URLs: &NSArray, + handler: Option<&Block<(NonNull>, *mut NSError), ()>>, + ); + + #[method(duplicateURLs:completionHandler:)] + pub unsafe fn duplicateURLs_completionHandler( + &self, + URLs: &NSArray, + handler: Option<&Block<(NonNull>, *mut NSError), ()>>, + ); + + #[method(getFileSystemInfoForPath:isRemovable:isWritable:isUnmountable:description:type:)] + pub unsafe fn getFileSystemInfoForPath_isRemovable_isWritable_isUnmountable_description_type( + &self, + fullPath: &NSString, + removableFlag: *mut Bool, + writableFlag: *mut Bool, + unmountableFlag: *mut Bool, + description: *mut *mut NSString, + fileSystemType: *mut *mut NSString, + ) -> bool; + + #[method(unmountAndEjectDeviceAtPath:)] + pub unsafe fn unmountAndEjectDeviceAtPath(&self, path: &NSString) -> bool; + + #[method(unmountAndEjectDeviceAtURL:error:)] + pub unsafe fn unmountAndEjectDeviceAtURL_error( + &self, + url: &NSURL, + ) -> Result<(), Id>; + + #[method(extendPowerOffBy:)] + pub unsafe fn extendPowerOffBy(&self, requested: NSInteger) -> NSInteger; + + #[method(hideOtherApplications)] + pub unsafe fn hideOtherApplications(&self); + + #[method_id(@__retain_semantics Other URLForApplicationWithBundleIdentifier:)] + pub unsafe fn URLForApplicationWithBundleIdentifier( + &self, + bundleIdentifier: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLsForApplicationsWithBundleIdentifier:)] + pub unsafe fn URLsForApplicationsWithBundleIdentifier( + &self, + bundleIdentifier: &NSString, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other URLForApplicationToOpenURL:)] + pub unsafe fn URLForApplicationToOpenURL(&self, url: &NSURL) -> Option>; + + #[method_id(@__retain_semantics Other URLsForApplicationsToOpenURL:)] + pub unsafe fn URLsForApplicationsToOpenURL( + &self, + url: &NSURL, + ) -> Id, Shared>; + + #[method(setDefaultApplicationAtURL:toOpenContentTypeOfFileAtURL:completionHandler:)] + pub unsafe fn setDefaultApplicationAtURL_toOpenContentTypeOfFileAtURL_completionHandler( + &self, + applicationURL: &NSURL, + url: &NSURL, + completionHandler: Option<&Block<(*mut NSError,), ()>>, + ); + + #[method(setDefaultApplicationAtURL:toOpenURLsWithScheme:completionHandler:)] + pub unsafe fn setDefaultApplicationAtURL_toOpenURLsWithScheme_completionHandler( + &self, + applicationURL: &NSURL, + urlScheme: &NSString, + completionHandler: Option<&Block<(*mut NSError,), ()>>, + ); + + #[method(setDefaultApplicationAtURL:toOpenFileAtURL:completionHandler:)] + pub unsafe fn setDefaultApplicationAtURL_toOpenFileAtURL_completionHandler( + &self, + applicationURL: &NSURL, + url: &NSURL, + completionHandler: Option<&Block<(*mut NSError,), ()>>, + ); + + #[method_id(@__retain_semantics Other frontmostApplication)] + pub unsafe fn frontmostApplication(&self) -> Option>; + + #[method_id(@__retain_semantics Other menuBarOwningApplication)] + pub unsafe fn menuBarOwningApplication(&self) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSWorkspaceOpenConfiguration; + + unsafe impl ClassType for NSWorkspaceOpenConfiguration { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSWorkspaceOpenConfiguration { + #[method_id(@__retain_semantics Other configuration)] + pub unsafe fn configuration() -> Id; + + #[method(promptsUserIfNeeded)] + pub unsafe fn promptsUserIfNeeded(&self) -> bool; + + #[method(setPromptsUserIfNeeded:)] + pub unsafe fn setPromptsUserIfNeeded(&self, promptsUserIfNeeded: bool); + + #[method(addsToRecentItems)] + pub unsafe fn addsToRecentItems(&self) -> bool; + + #[method(setAddsToRecentItems:)] + pub unsafe fn setAddsToRecentItems(&self, addsToRecentItems: bool); + + #[method(activates)] + pub unsafe fn activates(&self) -> bool; + + #[method(setActivates:)] + pub unsafe fn setActivates(&self, activates: bool); + + #[method(hides)] + pub unsafe fn hides(&self) -> bool; + + #[method(setHides:)] + pub unsafe fn setHides(&self, hides: bool); + + #[method(hidesOthers)] + pub unsafe fn hidesOthers(&self) -> bool; + + #[method(setHidesOthers:)] + pub unsafe fn setHidesOthers(&self, hidesOthers: bool); + + #[method(isForPrinting)] + pub unsafe fn isForPrinting(&self) -> bool; + + #[method(setForPrinting:)] + pub unsafe fn setForPrinting(&self, forPrinting: bool); + + #[method(createsNewApplicationInstance)] + pub unsafe fn createsNewApplicationInstance(&self) -> bool; + + #[method(setCreatesNewApplicationInstance:)] + pub unsafe fn setCreatesNewApplicationInstance(&self, createsNewApplicationInstance: bool); + + #[method(allowsRunningApplicationSubstitution)] + pub unsafe fn allowsRunningApplicationSubstitution(&self) -> bool; + + #[method(setAllowsRunningApplicationSubstitution:)] + pub unsafe fn setAllowsRunningApplicationSubstitution( + &self, + allowsRunningApplicationSubstitution: bool, + ); + + #[method_id(@__retain_semantics Other arguments)] + pub unsafe fn arguments(&self) -> Id, Shared>; + + #[method(setArguments:)] + pub unsafe fn setArguments(&self, arguments: &NSArray); + + #[method_id(@__retain_semantics Other environment)] + pub unsafe fn environment(&self) -> Id, Shared>; + + #[method(setEnvironment:)] + pub unsafe fn setEnvironment(&self, environment: &NSDictionary); + + #[method_id(@__retain_semantics Other appleEvent)] + pub unsafe fn appleEvent(&self) -> Option>; + + #[method(setAppleEvent:)] + pub unsafe fn setAppleEvent(&self, appleEvent: Option<&NSAppleEventDescriptor>); + + #[method(requiresUniversalLinks)] + pub unsafe fn requiresUniversalLinks(&self) -> bool; + + #[method(setRequiresUniversalLinks:)] + pub unsafe fn setRequiresUniversalLinks(&self, requiresUniversalLinks: bool); + } +); + +pub type NSWorkspaceDesktopImageOptionKey = NSString; + +extern_static!(NSWorkspaceDesktopImageScalingKey: &'static NSWorkspaceDesktopImageOptionKey); + +extern_static!(NSWorkspaceDesktopImageAllowClippingKey: &'static NSWorkspaceDesktopImageOptionKey); + +extern_static!(NSWorkspaceDesktopImageFillColorKey: &'static NSWorkspaceDesktopImageOptionKey); + +extern_methods!( + /// NSDesktopImages + unsafe impl NSWorkspace { + #[method(setDesktopImageURL:forScreen:options:error:)] + pub unsafe fn setDesktopImageURL_forScreen_options_error( + &self, + url: &NSURL, + screen: &NSScreen, + options: &NSDictionary, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other desktopImageURLForScreen:)] + pub unsafe fn desktopImageURLForScreen( + &self, + screen: &NSScreen, + ) -> Option>; + + #[method_id(@__retain_semantics Other desktopImageOptionsForScreen:)] + pub unsafe fn desktopImageOptionsForScreen( + &self, + screen: &NSScreen, + ) -> Option, Shared>>; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSWorkspaceAuthorizationType { + NSWorkspaceAuthorizationTypeCreateSymbolicLink = 0, + NSWorkspaceAuthorizationTypeSetAttributes = 1, + NSWorkspaceAuthorizationTypeReplaceFile = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSWorkspaceAuthorization; + + unsafe impl ClassType for NSWorkspaceAuthorization { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSWorkspaceAuthorization {} +); + +extern_methods!( + /// NSWorkspaceAuthorization + unsafe impl NSWorkspace { + #[method(requestAuthorizationOfType:completionHandler:)] + pub unsafe fn requestAuthorizationOfType_completionHandler( + &self, + type_: NSWorkspaceAuthorizationType, + completionHandler: &Block<(*mut NSWorkspaceAuthorization, *mut NSError), ()>, + ); + } +); + +extern_methods!( + /// NSWorkspaceAuthorization + unsafe impl NSFileManager { + #[method_id(@__retain_semantics Other fileManagerWithAuthorization:)] + pub unsafe fn fileManagerWithAuthorization( + authorization: &NSWorkspaceAuthorization, + ) -> Id; + } +); + +extern_static!(NSWorkspaceApplicationKey: &'static NSString); + +extern_static!(NSWorkspaceWillLaunchApplicationNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceDidLaunchApplicationNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceDidTerminateApplicationNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceDidHideApplicationNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceDidUnhideApplicationNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceDidActivateApplicationNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceDidDeactivateApplicationNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceVolumeLocalizedNameKey: &'static NSString); + +extern_static!(NSWorkspaceVolumeURLKey: &'static NSString); + +extern_static!(NSWorkspaceVolumeOldLocalizedNameKey: &'static NSString); + +extern_static!(NSWorkspaceVolumeOldURLKey: &'static NSString); + +extern_static!(NSWorkspaceDidMountNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceDidUnmountNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceWillUnmountNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceDidRenameVolumeNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceWillPowerOffNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceWillSleepNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceDidWakeNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceScreensDidSleepNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceScreensDidWakeNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceSessionDidBecomeActiveNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceSessionDidResignActiveNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceDidChangeFileLabelsNotification: &'static NSNotificationName); + +extern_static!(NSWorkspaceActiveSpaceDidChangeNotification: &'static NSNotificationName); + +pub type NSWorkspaceFileOperationName = NSString; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSWorkspaceLaunchOptions { + NSWorkspaceLaunchAndPrint = 0x00000002, + NSWorkspaceLaunchWithErrorPresentation = 0x00000040, + NSWorkspaceLaunchInhibitingBackgroundOnly = 0x00000080, + NSWorkspaceLaunchWithoutAddingToRecents = 0x00000100, + NSWorkspaceLaunchWithoutActivation = 0x00000200, + NSWorkspaceLaunchAsync = 0x00010000, + NSWorkspaceLaunchNewInstance = 0x00080000, + NSWorkspaceLaunchAndHide = 0x00100000, + NSWorkspaceLaunchAndHideOthers = 0x00200000, + NSWorkspaceLaunchDefault = NSWorkspaceLaunchAsync, + NSWorkspaceLaunchAllowingClassicStartup = 0x00020000, + NSWorkspaceLaunchPreferringClassic = 0x00040000, + } +); + +pub type NSWorkspaceLaunchConfigurationKey = NSString; + +extern_static!( + NSWorkspaceLaunchConfigurationAppleEvent: &'static NSWorkspaceLaunchConfigurationKey +); + +extern_static!(NSWorkspaceLaunchConfigurationArguments: &'static NSWorkspaceLaunchConfigurationKey); + +extern_static!( + NSWorkspaceLaunchConfigurationEnvironment: &'static NSWorkspaceLaunchConfigurationKey +); + +extern_static!( + NSWorkspaceLaunchConfigurationArchitecture: &'static NSWorkspaceLaunchConfigurationKey +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSWorkspace { + #[method(openFile:)] + pub unsafe fn openFile(&self, fullPath: &NSString) -> bool; + + #[method(openFile:withApplication:)] + pub unsafe fn openFile_withApplication( + &self, + fullPath: &NSString, + appName: Option<&NSString>, + ) -> bool; + + #[method(openFile:withApplication:andDeactivate:)] + pub unsafe fn openFile_withApplication_andDeactivate( + &self, + fullPath: &NSString, + appName: Option<&NSString>, + flag: bool, + ) -> bool; + + #[method(launchApplication:)] + pub unsafe fn launchApplication(&self, appName: &NSString) -> bool; + + #[method_id(@__retain_semantics Other launchApplicationAtURL:options:configuration:error:)] + pub unsafe fn launchApplicationAtURL_options_configuration_error( + &self, + url: &NSURL, + options: NSWorkspaceLaunchOptions, + configuration: &NSDictionary, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other openURL:options:configuration:error:)] + pub unsafe fn openURL_options_configuration_error( + &self, + url: &NSURL, + options: NSWorkspaceLaunchOptions, + configuration: &NSDictionary, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other openURLs:withApplicationAtURL:options:configuration:error:)] + pub unsafe fn openURLs_withApplicationAtURL_options_configuration_error( + &self, + urls: &NSArray, + applicationURL: &NSURL, + options: NSWorkspaceLaunchOptions, + configuration: &NSDictionary, + ) -> Result, Id>; + + #[method(launchApplication:showIcon:autolaunch:)] + pub unsafe fn launchApplication_showIcon_autolaunch( + &self, + appName: &NSString, + showIcon: bool, + autolaunch: bool, + ) -> bool; + + #[method_id(@__retain_semantics Other fullPathForApplication:)] + pub unsafe fn fullPathForApplication( + &self, + appName: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other absolutePathForAppBundleWithIdentifier:)] + pub unsafe fn absolutePathForAppBundleWithIdentifier( + &self, + bundleIdentifier: &NSString, + ) -> Option>; + + #[method(launchAppWithBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifier:)] + pub unsafe fn launchAppWithBundleIdentifier_options_additionalEventParamDescriptor_launchIdentifier( + &self, + bundleIdentifier: &NSString, + options: NSWorkspaceLaunchOptions, + descriptor: Option<&NSAppleEventDescriptor>, + identifier: *mut *mut NSNumber, + ) -> bool; + + #[method(openURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:)] + pub unsafe fn openURLs_withAppBundleIdentifier_options_additionalEventParamDescriptor_launchIdentifiers( + &self, + urls: &NSArray, + bundleIdentifier: Option<&NSString>, + options: NSWorkspaceLaunchOptions, + descriptor: Option<&NSAppleEventDescriptor>, + identifiers: *mut *mut NSArray, + ) -> bool; + + #[method(openTempFile:)] + pub unsafe fn openTempFile(&self, fullPath: &NSString) -> bool; + + #[method(findApplications)] + pub unsafe fn findApplications(&self); + + #[method(noteUserDefaultsChanged)] + pub unsafe fn noteUserDefaultsChanged(&self); + + #[method(slideImage:from:to:)] + pub unsafe fn slideImage_from_to( + &self, + image: &NSImage, + fromPoint: NSPoint, + toPoint: NSPoint, + ); + + #[method(checkForRemovableMedia)] + pub unsafe fn checkForRemovableMedia(&self); + + #[method(fileSystemChanged)] + pub unsafe fn fileSystemChanged(&self) -> bool; + + #[method(userDefaultsChanged)] + pub unsafe fn userDefaultsChanged(&self) -> bool; + + #[method_id(@__retain_semantics Other mountNewRemovableMedia)] + pub unsafe fn mountNewRemovableMedia(&self) -> Option>; + + #[method_id(@__retain_semantics Other activeApplication)] + pub unsafe fn activeApplication(&self) -> Option>; + + #[method_id(@__retain_semantics Other mountedLocalVolumePaths)] + pub unsafe fn mountedLocalVolumePaths(&self) -> Option>; + + #[method_id(@__retain_semantics Other mountedRemovableMedia)] + pub unsafe fn mountedRemovableMedia(&self) -> Option>; + + #[method_id(@__retain_semantics Other launchedApplications)] + pub unsafe fn launchedApplications(&self) -> Option>; + + #[method(openFile:fromImage:at:inView:)] + pub unsafe fn openFile_fromImage_at_inView( + &self, + fullPath: &NSString, + image: Option<&NSImage>, + point: NSPoint, + view: Option<&NSView>, + ) -> bool; + + #[method(performFileOperation:source:destination:files:tag:)] + pub unsafe fn performFileOperation_source_destination_files_tag( + &self, + operation: &NSWorkspaceFileOperationName, + source: &NSString, + destination: &NSString, + files: &NSArray, + tag: *mut NSInteger, + ) -> bool; + + #[method(getInfoForFile:application:type:)] + pub unsafe fn getInfoForFile_application_type( + &self, + fullPath: &NSString, + appName: *mut *mut NSString, + type_: *mut *mut NSString, + ) -> bool; + + #[method_id(@__retain_semantics Other iconForFileType:)] + pub unsafe fn iconForFileType(&self, fileType: &NSString) -> Id; + + #[method_id(@__retain_semantics Other typeOfFile:error:)] + pub unsafe fn typeOfFile_error( + &self, + absoluteFilePath: &NSString, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other localizedDescriptionForType:)] + pub unsafe fn localizedDescriptionForType( + &self, + typeName: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other preferredFilenameExtensionForType:)] + pub unsafe fn preferredFilenameExtensionForType( + &self, + typeName: &NSString, + ) -> Option>; + + #[method(filenameExtension:isValidForType:)] + pub unsafe fn filenameExtension_isValidForType( + &self, + filenameExtension: &NSString, + typeName: &NSString, + ) -> bool; + + #[method(type:conformsToType:)] + pub unsafe fn type_conformsToType( + &self, + firstTypeName: &NSString, + secondTypeName: &NSString, + ) -> bool; + } +); + +extern_static!(NSWorkspaceMoveOperation: &'static NSWorkspaceFileOperationName); + +extern_static!(NSWorkspaceCopyOperation: &'static NSWorkspaceFileOperationName); + +extern_static!(NSWorkspaceLinkOperation: &'static NSWorkspaceFileOperationName); + +extern_static!(NSWorkspaceCompressOperation: &'static NSWorkspaceFileOperationName); + +extern_static!(NSWorkspaceDecompressOperation: &'static NSWorkspaceFileOperationName); + +extern_static!(NSWorkspaceEncryptOperation: &'static NSWorkspaceFileOperationName); + +extern_static!(NSWorkspaceDecryptOperation: &'static NSWorkspaceFileOperationName); + +extern_static!(NSWorkspaceDestroyOperation: &'static NSWorkspaceFileOperationName); + +extern_static!(NSWorkspaceRecycleOperation: &'static NSWorkspaceFileOperationName); + +extern_static!(NSWorkspaceDuplicateOperation: &'static NSWorkspaceFileOperationName); + +extern_static!(NSWorkspaceDidPerformFileOperationNotification: &'static NSNotificationName); + +extern_static!(NSPlainFileType: &'static NSString); + +extern_static!(NSDirectoryFileType: &'static NSString); + +extern_static!(NSApplicationFileType: &'static NSString); + +extern_static!(NSFilesystemFileType: &'static NSString); + +extern_static!(NSShellCommandFileType: &'static NSString); diff --git a/crates/icrate/src/generated/AppKit/mod.rs b/crates/icrate/src/generated/AppKit/mod.rs new file mode 100644 index 000000000..48634c8d4 --- /dev/null +++ b/crates/icrate/src/generated/AppKit/mod.rs @@ -0,0 +1,2453 @@ +#[path = "AppKitDefines.rs"] +mod __AppKitDefines; +#[path = "AppKitErrors.rs"] +mod __AppKitErrors; +#[path = "NSATSTypesetter.rs"] +mod __NSATSTypesetter; +#[path = "NSAccessibility.rs"] +mod __NSAccessibility; +#[path = "NSAccessibilityConstants.rs"] +mod __NSAccessibilityConstants; +#[path = "NSAccessibilityCustomAction.rs"] +mod __NSAccessibilityCustomAction; +#[path = "NSAccessibilityCustomRotor.rs"] +mod __NSAccessibilityCustomRotor; +#[path = "NSAccessibilityElement.rs"] +mod __NSAccessibilityElement; +#[path = "NSAccessibilityProtocols.rs"] +mod __NSAccessibilityProtocols; +#[path = "NSActionCell.rs"] +mod __NSActionCell; +#[path = "NSAffineTransform.rs"] +mod __NSAffineTransform; +#[path = "NSAlert.rs"] +mod __NSAlert; +#[path = "NSAlignmentFeedbackFilter.rs"] +mod __NSAlignmentFeedbackFilter; +#[path = "NSAnimation.rs"] +mod __NSAnimation; +#[path = "NSAnimationContext.rs"] +mod __NSAnimationContext; +#[path = "NSAppearance.rs"] +mod __NSAppearance; +#[path = "NSAppleScriptExtensions.rs"] +mod __NSAppleScriptExtensions; +#[path = "NSApplication.rs"] +mod __NSApplication; +#[path = "NSApplicationScripting.rs"] +mod __NSApplicationScripting; +#[path = "NSArrayController.rs"] +mod __NSArrayController; +#[path = "NSAttributedString.rs"] +mod __NSAttributedString; +#[path = "NSBezierPath.rs"] +mod __NSBezierPath; +#[path = "NSBitmapImageRep.rs"] +mod __NSBitmapImageRep; +#[path = "NSBox.rs"] +mod __NSBox; +#[path = "NSBrowser.rs"] +mod __NSBrowser; +#[path = "NSBrowserCell.rs"] +mod __NSBrowserCell; +#[path = "NSButton.rs"] +mod __NSButton; +#[path = "NSButtonCell.rs"] +mod __NSButtonCell; +#[path = "NSButtonTouchBarItem.rs"] +mod __NSButtonTouchBarItem; +#[path = "NSCIImageRep.rs"] +mod __NSCIImageRep; +#[path = "NSCachedImageRep.rs"] +mod __NSCachedImageRep; +#[path = "NSCandidateListTouchBarItem.rs"] +mod __NSCandidateListTouchBarItem; +#[path = "NSCell.rs"] +mod __NSCell; +#[path = "NSClickGestureRecognizer.rs"] +mod __NSClickGestureRecognizer; +#[path = "NSClipView.rs"] +mod __NSClipView; +#[path = "NSCollectionView.rs"] +mod __NSCollectionView; +#[path = "NSCollectionViewCompositionalLayout.rs"] +mod __NSCollectionViewCompositionalLayout; +#[path = "NSCollectionViewFlowLayout.rs"] +mod __NSCollectionViewFlowLayout; +#[path = "NSCollectionViewGridLayout.rs"] +mod __NSCollectionViewGridLayout; +#[path = "NSCollectionViewLayout.rs"] +mod __NSCollectionViewLayout; +#[path = "NSCollectionViewTransitionLayout.rs"] +mod __NSCollectionViewTransitionLayout; +#[path = "NSColor.rs"] +mod __NSColor; +#[path = "NSColorList.rs"] +mod __NSColorList; +#[path = "NSColorPanel.rs"] +mod __NSColorPanel; +#[path = "NSColorPicker.rs"] +mod __NSColorPicker; +#[path = "NSColorPickerTouchBarItem.rs"] +mod __NSColorPickerTouchBarItem; +#[path = "NSColorPicking.rs"] +mod __NSColorPicking; +#[path = "NSColorSampler.rs"] +mod __NSColorSampler; +#[path = "NSColorSpace.rs"] +mod __NSColorSpace; +#[path = "NSColorWell.rs"] +mod __NSColorWell; +#[path = "NSComboBox.rs"] +mod __NSComboBox; +#[path = "NSComboBoxCell.rs"] +mod __NSComboBoxCell; +#[path = "NSControl.rs"] +mod __NSControl; +#[path = "NSController.rs"] +mod __NSController; +#[path = "NSCursor.rs"] +mod __NSCursor; +#[path = "NSCustomImageRep.rs"] +mod __NSCustomImageRep; +#[path = "NSCustomTouchBarItem.rs"] +mod __NSCustomTouchBarItem; +#[path = "NSDataAsset.rs"] +mod __NSDataAsset; +#[path = "NSDatePicker.rs"] +mod __NSDatePicker; +#[path = "NSDatePickerCell.rs"] +mod __NSDatePickerCell; +#[path = "NSDictionaryController.rs"] +mod __NSDictionaryController; +#[path = "NSDiffableDataSource.rs"] +mod __NSDiffableDataSource; +#[path = "NSDockTile.rs"] +mod __NSDockTile; +#[path = "NSDocument.rs"] +mod __NSDocument; +#[path = "NSDocumentController.rs"] +mod __NSDocumentController; +#[path = "NSDocumentScripting.rs"] +mod __NSDocumentScripting; +#[path = "NSDragging.rs"] +mod __NSDragging; +#[path = "NSDraggingItem.rs"] +mod __NSDraggingItem; +#[path = "NSDraggingSession.rs"] +mod __NSDraggingSession; +#[path = "NSDrawer.rs"] +mod __NSDrawer; +#[path = "NSEPSImageRep.rs"] +mod __NSEPSImageRep; +#[path = "NSErrors.rs"] +mod __NSErrors; +#[path = "NSEvent.rs"] +mod __NSEvent; +#[path = "NSFilePromiseProvider.rs"] +mod __NSFilePromiseProvider; +#[path = "NSFilePromiseReceiver.rs"] +mod __NSFilePromiseReceiver; +#[path = "NSFileWrapperExtensions.rs"] +mod __NSFileWrapperExtensions; +#[path = "NSFont.rs"] +mod __NSFont; +#[path = "NSFontAssetRequest.rs"] +mod __NSFontAssetRequest; +#[path = "NSFontCollection.rs"] +mod __NSFontCollection; +#[path = "NSFontDescriptor.rs"] +mod __NSFontDescriptor; +#[path = "NSFontManager.rs"] +mod __NSFontManager; +#[path = "NSFontPanel.rs"] +mod __NSFontPanel; +#[path = "NSForm.rs"] +mod __NSForm; +#[path = "NSFormCell.rs"] +mod __NSFormCell; +#[path = "NSGestureRecognizer.rs"] +mod __NSGestureRecognizer; +#[path = "NSGlyphGenerator.rs"] +mod __NSGlyphGenerator; +#[path = "NSGlyphInfo.rs"] +mod __NSGlyphInfo; +#[path = "NSGradient.rs"] +mod __NSGradient; +#[path = "NSGraphics.rs"] +mod __NSGraphics; +#[path = "NSGraphicsContext.rs"] +mod __NSGraphicsContext; +#[path = "NSGridView.rs"] +mod __NSGridView; +#[path = "NSGroupTouchBarItem.rs"] +mod __NSGroupTouchBarItem; +#[path = "NSHapticFeedback.rs"] +mod __NSHapticFeedback; +#[path = "NSHelpManager.rs"] +mod __NSHelpManager; +#[path = "NSImage.rs"] +mod __NSImage; +#[path = "NSImageCell.rs"] +mod __NSImageCell; +#[path = "NSImageRep.rs"] +mod __NSImageRep; +#[path = "NSImageView.rs"] +mod __NSImageView; +#[path = "NSInputManager.rs"] +mod __NSInputManager; +#[path = "NSInputServer.rs"] +mod __NSInputServer; +#[path = "NSInterfaceStyle.rs"] +mod __NSInterfaceStyle; +#[path = "NSItemProvider.rs"] +mod __NSItemProvider; +#[path = "NSKeyValueBinding.rs"] +mod __NSKeyValueBinding; +#[path = "NSLayoutAnchor.rs"] +mod __NSLayoutAnchor; +#[path = "NSLayoutConstraint.rs"] +mod __NSLayoutConstraint; +#[path = "NSLayoutGuide.rs"] +mod __NSLayoutGuide; +#[path = "NSLayoutManager.rs"] +mod __NSLayoutManager; +#[path = "NSLevelIndicator.rs"] +mod __NSLevelIndicator; +#[path = "NSLevelIndicatorCell.rs"] +mod __NSLevelIndicatorCell; +#[path = "NSMagnificationGestureRecognizer.rs"] +mod __NSMagnificationGestureRecognizer; +#[path = "NSMatrix.rs"] +mod __NSMatrix; +#[path = "NSMediaLibraryBrowserController.rs"] +mod __NSMediaLibraryBrowserController; +#[path = "NSMenu.rs"] +mod __NSMenu; +#[path = "NSMenuItem.rs"] +mod __NSMenuItem; +#[path = "NSMenuItemCell.rs"] +mod __NSMenuItemCell; +#[path = "NSMenuToolbarItem.rs"] +mod __NSMenuToolbarItem; +#[path = "NSMovie.rs"] +mod __NSMovie; +#[path = "NSNib.rs"] +mod __NSNib; +#[path = "NSNibDeclarations.rs"] +mod __NSNibDeclarations; +#[path = "NSNibLoading.rs"] +mod __NSNibLoading; +#[path = "NSObjectController.rs"] +mod __NSObjectController; +#[path = "NSOpenGL.rs"] +mod __NSOpenGL; +#[path = "NSOpenGLLayer.rs"] +mod __NSOpenGLLayer; +#[path = "NSOpenGLView.rs"] +mod __NSOpenGLView; +#[path = "NSOpenPanel.rs"] +mod __NSOpenPanel; +#[path = "NSOutlineView.rs"] +mod __NSOutlineView; +#[path = "NSPDFImageRep.rs"] +mod __NSPDFImageRep; +#[path = "NSPDFInfo.rs"] +mod __NSPDFInfo; +#[path = "NSPDFPanel.rs"] +mod __NSPDFPanel; +#[path = "NSPICTImageRep.rs"] +mod __NSPICTImageRep; +#[path = "NSPageController.rs"] +mod __NSPageController; +#[path = "NSPageLayout.rs"] +mod __NSPageLayout; +#[path = "NSPanGestureRecognizer.rs"] +mod __NSPanGestureRecognizer; +#[path = "NSPanel.rs"] +mod __NSPanel; +#[path = "NSParagraphStyle.rs"] +mod __NSParagraphStyle; +#[path = "NSPasteboard.rs"] +mod __NSPasteboard; +#[path = "NSPasteboardItem.rs"] +mod __NSPasteboardItem; +#[path = "NSPathCell.rs"] +mod __NSPathCell; +#[path = "NSPathComponentCell.rs"] +mod __NSPathComponentCell; +#[path = "NSPathControl.rs"] +mod __NSPathControl; +#[path = "NSPathControlItem.rs"] +mod __NSPathControlItem; +#[path = "NSPersistentDocument.rs"] +mod __NSPersistentDocument; +#[path = "NSPickerTouchBarItem.rs"] +mod __NSPickerTouchBarItem; +#[path = "NSPopUpButton.rs"] +mod __NSPopUpButton; +#[path = "NSPopUpButtonCell.rs"] +mod __NSPopUpButtonCell; +#[path = "NSPopover.rs"] +mod __NSPopover; +#[path = "NSPopoverTouchBarItem.rs"] +mod __NSPopoverTouchBarItem; +#[path = "NSPredicateEditor.rs"] +mod __NSPredicateEditor; +#[path = "NSPredicateEditorRowTemplate.rs"] +mod __NSPredicateEditorRowTemplate; +#[path = "NSPressGestureRecognizer.rs"] +mod __NSPressGestureRecognizer; +#[path = "NSPressureConfiguration.rs"] +mod __NSPressureConfiguration; +#[path = "NSPrintInfo.rs"] +mod __NSPrintInfo; +#[path = "NSPrintOperation.rs"] +mod __NSPrintOperation; +#[path = "NSPrintPanel.rs"] +mod __NSPrintPanel; +#[path = "NSPrinter.rs"] +mod __NSPrinter; +#[path = "NSProgressIndicator.rs"] +mod __NSProgressIndicator; +#[path = "NSResponder.rs"] +mod __NSResponder; +#[path = "NSRotationGestureRecognizer.rs"] +mod __NSRotationGestureRecognizer; +#[path = "NSRuleEditor.rs"] +mod __NSRuleEditor; +#[path = "NSRulerMarker.rs"] +mod __NSRulerMarker; +#[path = "NSRulerView.rs"] +mod __NSRulerView; +#[path = "NSRunningApplication.rs"] +mod __NSRunningApplication; +#[path = "NSSavePanel.rs"] +mod __NSSavePanel; +#[path = "NSScreen.rs"] +mod __NSScreen; +#[path = "NSScrollView.rs"] +mod __NSScrollView; +#[path = "NSScroller.rs"] +mod __NSScroller; +#[path = "NSScrubber.rs"] +mod __NSScrubber; +#[path = "NSScrubberItemView.rs"] +mod __NSScrubberItemView; +#[path = "NSScrubberLayout.rs"] +mod __NSScrubberLayout; +#[path = "NSSearchField.rs"] +mod __NSSearchField; +#[path = "NSSearchFieldCell.rs"] +mod __NSSearchFieldCell; +#[path = "NSSearchToolbarItem.rs"] +mod __NSSearchToolbarItem; +#[path = "NSSecureTextField.rs"] +mod __NSSecureTextField; +#[path = "NSSegmentedCell.rs"] +mod __NSSegmentedCell; +#[path = "NSSegmentedControl.rs"] +mod __NSSegmentedControl; +#[path = "NSShadow.rs"] +mod __NSShadow; +#[path = "NSSharingService.rs"] +mod __NSSharingService; +#[path = "NSSharingServicePickerToolbarItem.rs"] +mod __NSSharingServicePickerToolbarItem; +#[path = "NSSharingServicePickerTouchBarItem.rs"] +mod __NSSharingServicePickerTouchBarItem; +#[path = "NSSlider.rs"] +mod __NSSlider; +#[path = "NSSliderAccessory.rs"] +mod __NSSliderAccessory; +#[path = "NSSliderCell.rs"] +mod __NSSliderCell; +#[path = "NSSliderTouchBarItem.rs"] +mod __NSSliderTouchBarItem; +#[path = "NSSound.rs"] +mod __NSSound; +#[path = "NSSpeechRecognizer.rs"] +mod __NSSpeechRecognizer; +#[path = "NSSpeechSynthesizer.rs"] +mod __NSSpeechSynthesizer; +#[path = "NSSpellChecker.rs"] +mod __NSSpellChecker; +#[path = "NSSpellProtocol.rs"] +mod __NSSpellProtocol; +#[path = "NSSplitView.rs"] +mod __NSSplitView; +#[path = "NSSplitViewController.rs"] +mod __NSSplitViewController; +#[path = "NSSplitViewItem.rs"] +mod __NSSplitViewItem; +#[path = "NSStackView.rs"] +mod __NSStackView; +#[path = "NSStatusBar.rs"] +mod __NSStatusBar; +#[path = "NSStatusBarButton.rs"] +mod __NSStatusBarButton; +#[path = "NSStatusItem.rs"] +mod __NSStatusItem; +#[path = "NSStepper.rs"] +mod __NSStepper; +#[path = "NSStepperCell.rs"] +mod __NSStepperCell; +#[path = "NSStepperTouchBarItem.rs"] +mod __NSStepperTouchBarItem; +#[path = "NSStoryboard.rs"] +mod __NSStoryboard; +#[path = "NSStoryboardSegue.rs"] +mod __NSStoryboardSegue; +#[path = "NSStringDrawing.rs"] +mod __NSStringDrawing; +#[path = "NSSwitch.rs"] +mod __NSSwitch; +#[path = "NSTabView.rs"] +mod __NSTabView; +#[path = "NSTabViewController.rs"] +mod __NSTabViewController; +#[path = "NSTabViewItem.rs"] +mod __NSTabViewItem; +#[path = "NSTableCellView.rs"] +mod __NSTableCellView; +#[path = "NSTableColumn.rs"] +mod __NSTableColumn; +#[path = "NSTableHeaderCell.rs"] +mod __NSTableHeaderCell; +#[path = "NSTableHeaderView.rs"] +mod __NSTableHeaderView; +#[path = "NSTableRowView.rs"] +mod __NSTableRowView; +#[path = "NSTableView.rs"] +mod __NSTableView; +#[path = "NSTableViewDiffableDataSource.rs"] +mod __NSTableViewDiffableDataSource; +#[path = "NSTableViewRowAction.rs"] +mod __NSTableViewRowAction; +#[path = "NSText.rs"] +mod __NSText; +#[path = "NSTextAlternatives.rs"] +mod __NSTextAlternatives; +#[path = "NSTextAttachment.rs"] +mod __NSTextAttachment; +#[path = "NSTextAttachmentCell.rs"] +mod __NSTextAttachmentCell; +#[path = "NSTextCheckingClient.rs"] +mod __NSTextCheckingClient; +#[path = "NSTextCheckingController.rs"] +mod __NSTextCheckingController; +#[path = "NSTextContainer.rs"] +mod __NSTextContainer; +#[path = "NSTextContent.rs"] +mod __NSTextContent; +#[path = "NSTextContentManager.rs"] +mod __NSTextContentManager; +#[path = "NSTextElement.rs"] +mod __NSTextElement; +#[path = "NSTextField.rs"] +mod __NSTextField; +#[path = "NSTextFieldCell.rs"] +mod __NSTextFieldCell; +#[path = "NSTextFinder.rs"] +mod __NSTextFinder; +#[path = "NSTextInputClient.rs"] +mod __NSTextInputClient; +#[path = "NSTextInputContext.rs"] +mod __NSTextInputContext; +#[path = "NSTextLayoutFragment.rs"] +mod __NSTextLayoutFragment; +#[path = "NSTextLayoutManager.rs"] +mod __NSTextLayoutManager; +#[path = "NSTextLineFragment.rs"] +mod __NSTextLineFragment; +#[path = "NSTextList.rs"] +mod __NSTextList; +#[path = "NSTextRange.rs"] +mod __NSTextRange; +#[path = "NSTextSelection.rs"] +mod __NSTextSelection; +#[path = "NSTextSelectionNavigation.rs"] +mod __NSTextSelectionNavigation; +#[path = "NSTextStorage.rs"] +mod __NSTextStorage; +#[path = "NSTextStorageScripting.rs"] +mod __NSTextStorageScripting; +#[path = "NSTextTable.rs"] +mod __NSTextTable; +#[path = "NSTextView.rs"] +mod __NSTextView; +#[path = "NSTextViewportLayoutController.rs"] +mod __NSTextViewportLayoutController; +#[path = "NSTintConfiguration.rs"] +mod __NSTintConfiguration; +#[path = "NSTitlebarAccessoryViewController.rs"] +mod __NSTitlebarAccessoryViewController; +#[path = "NSTokenField.rs"] +mod __NSTokenField; +#[path = "NSTokenFieldCell.rs"] +mod __NSTokenFieldCell; +#[path = "NSToolbar.rs"] +mod __NSToolbar; +#[path = "NSToolbarItem.rs"] +mod __NSToolbarItem; +#[path = "NSToolbarItemGroup.rs"] +mod __NSToolbarItemGroup; +#[path = "NSTouch.rs"] +mod __NSTouch; +#[path = "NSTouchBar.rs"] +mod __NSTouchBar; +#[path = "NSTouchBarItem.rs"] +mod __NSTouchBarItem; +#[path = "NSTrackingArea.rs"] +mod __NSTrackingArea; +#[path = "NSTrackingSeparatorToolbarItem.rs"] +mod __NSTrackingSeparatorToolbarItem; +#[path = "NSTreeController.rs"] +mod __NSTreeController; +#[path = "NSTreeNode.rs"] +mod __NSTreeNode; +#[path = "NSTypesetter.rs"] +mod __NSTypesetter; +#[path = "NSUserActivity.rs"] +mod __NSUserActivity; +#[path = "NSUserDefaultsController.rs"] +mod __NSUserDefaultsController; +#[path = "NSUserInterfaceCompression.rs"] +mod __NSUserInterfaceCompression; +#[path = "NSUserInterfaceItemIdentification.rs"] +mod __NSUserInterfaceItemIdentification; +#[path = "NSUserInterfaceItemSearching.rs"] +mod __NSUserInterfaceItemSearching; +#[path = "NSUserInterfaceLayout.rs"] +mod __NSUserInterfaceLayout; +#[path = "NSUserInterfaceValidation.rs"] +mod __NSUserInterfaceValidation; +#[path = "NSView.rs"] +mod __NSView; +#[path = "NSViewController.rs"] +mod __NSViewController; +#[path = "NSVisualEffectView.rs"] +mod __NSVisualEffectView; +#[path = "NSWindow.rs"] +mod __NSWindow; +#[path = "NSWindowController.rs"] +mod __NSWindowController; +#[path = "NSWindowRestoration.rs"] +mod __NSWindowRestoration; +#[path = "NSWindowScripting.rs"] +mod __NSWindowScripting; +#[path = "NSWindowTab.rs"] +mod __NSWindowTab; +#[path = "NSWindowTabGroup.rs"] +mod __NSWindowTabGroup; +#[path = "NSWorkspace.rs"] +mod __NSWorkspace; + +pub use self::__AppKitErrors::{ + NSFontAssetDownloadError, NSFontErrorMaximum, NSFontErrorMinimum, + NSServiceApplicationLaunchFailedError, NSServiceApplicationNotFoundError, + NSServiceErrorMaximum, NSServiceErrorMinimum, NSServiceInvalidPasteboardDataError, + NSServiceMalformedServiceDictionaryError, NSServiceMiscellaneousError, + NSServiceRequestTimedOutError, NSSharingServiceErrorMaximum, NSSharingServiceErrorMinimum, + NSSharingServiceNotConfiguredError, NSTextReadInapplicableDocumentTypeError, + NSTextReadWriteErrorMaximum, NSTextReadWriteErrorMinimum, + NSTextWriteInapplicableDocumentTypeError, NSWorkspaceAuthorizationInvalidError, + NSWorkspaceErrorMaximum, NSWorkspaceErrorMinimum, +}; +pub use self::__NSATSTypesetter::NSATSTypesetter; +pub use self::__NSAccessibility::{ + NSAccessibilityActionDescription, NSAccessibilityFrameInView, NSAccessibilityPointInView, + NSAccessibilityPostNotification, NSAccessibilityRaiseBadArgumentException, + NSAccessibilityRoleDescription, NSAccessibilityRoleDescriptionForUIElement, + NSAccessibilitySetMayContainProtectedContent, NSAccessibilityUnignoredAncestor, + NSAccessibilityUnignoredChildren, NSAccessibilityUnignoredChildrenForOnlyChild, + NSAccessibilityUnignoredDescendant, + NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification, +}; +pub use self::__NSAccessibilityConstants::{ + NSAccessibilityActionName, NSAccessibilityActivationPointAttribute, + NSAccessibilityAllowedValuesAttribute, NSAccessibilityAlternateUIVisibleAttribute, + NSAccessibilityAnnotationAttributeKey, NSAccessibilityAnnotationElement, + NSAccessibilityAnnotationLabel, NSAccessibilityAnnotationLocation, + NSAccessibilityAnnotationPosition, NSAccessibilityAnnotationPositionEnd, + NSAccessibilityAnnotationPositionFullRange, NSAccessibilityAnnotationPositionStart, + NSAccessibilityAnnotationTextAttribute, NSAccessibilityAnnouncementKey, + NSAccessibilityAnnouncementRequestedNotification, + NSAccessibilityApplicationActivatedNotification, + NSAccessibilityApplicationDeactivatedNotification, + NSAccessibilityApplicationHiddenNotification, NSAccessibilityApplicationRole, + NSAccessibilityApplicationShownNotification, NSAccessibilityAscendingSortDirectionValue, + NSAccessibilityAttachmentTextAttribute, NSAccessibilityAttributeName, + NSAccessibilityAttributedStringForRangeParameterizedAttribute, + NSAccessibilityAutocorrectedTextAttribute, NSAccessibilityBackgroundColorTextAttribute, + NSAccessibilityBoundsForRangeParameterizedAttribute, NSAccessibilityBrowserRole, + NSAccessibilityBusyIndicatorRole, NSAccessibilityButtonRole, NSAccessibilityCancelAction, + NSAccessibilityCancelButtonAttribute, NSAccessibilityCellForColumnAndRowParameterizedAttribute, + NSAccessibilityCellRole, NSAccessibilityCenterTabStopMarkerTypeValue, + NSAccessibilityCentimetersUnitValue, NSAccessibilityCheckBoxRole, + NSAccessibilityChildrenAttribute, NSAccessibilityClearButtonAttribute, + NSAccessibilityCloseButtonAttribute, NSAccessibilityCloseButtonSubrole, + NSAccessibilityCollectionListSubrole, NSAccessibilityColorWellRole, + NSAccessibilityColumnCountAttribute, NSAccessibilityColumnHeaderUIElementsAttribute, + NSAccessibilityColumnIndexRangeAttribute, NSAccessibilityColumnRole, + NSAccessibilityColumnTitlesAttribute, NSAccessibilityColumnsAttribute, + NSAccessibilityComboBoxRole, NSAccessibilityConfirmAction, + NSAccessibilityContainsProtectedContentAttribute, NSAccessibilityContentListSubrole, + NSAccessibilityContentsAttribute, NSAccessibilityCreatedNotification, + NSAccessibilityCriticalValueAttribute, NSAccessibilityCustomTextAttribute, + NSAccessibilityDecimalTabStopMarkerTypeValue, NSAccessibilityDecrementAction, + NSAccessibilityDecrementArrowSubrole, NSAccessibilityDecrementButtonAttribute, + NSAccessibilityDecrementPageSubrole, NSAccessibilityDefaultButtonAttribute, + NSAccessibilityDefinitionListSubrole, NSAccessibilityDeleteAction, + NSAccessibilityDescendingSortDirectionValue, NSAccessibilityDescriptionAttribute, + NSAccessibilityDescriptionListSubrole, NSAccessibilityDialogSubrole, + NSAccessibilityDisclosedByRowAttribute, NSAccessibilityDisclosedRowsAttribute, + NSAccessibilityDisclosingAttribute, NSAccessibilityDisclosureLevelAttribute, + NSAccessibilityDisclosureTriangleRole, NSAccessibilityDocumentAttribute, + NSAccessibilityDrawerCreatedNotification, NSAccessibilityDrawerRole, + NSAccessibilityEditedAttribute, NSAccessibilityEnabledAttribute, + NSAccessibilityErrorCodeExceptionInfo, NSAccessibilityExpandedAttribute, + NSAccessibilityExtrasMenuBarAttribute, NSAccessibilityFilenameAttribute, + NSAccessibilityFirstLineIndentMarkerTypeValue, NSAccessibilityFloatingWindowSubrole, + NSAccessibilityFocusedAttribute, NSAccessibilityFocusedUIElementAttribute, + NSAccessibilityFocusedUIElementChangedNotification, NSAccessibilityFocusedWindowAttribute, + NSAccessibilityFocusedWindowChangedNotification, NSAccessibilityFontAttributeKey, + NSAccessibilityFontFamilyKey, NSAccessibilityFontNameKey, NSAccessibilityFontSizeKey, + NSAccessibilityFontTextAttribute, NSAccessibilityForegroundColorTextAttribute, + NSAccessibilityFrontmostAttribute, NSAccessibilityFullScreenButtonAttribute, + NSAccessibilityFullScreenButtonSubrole, NSAccessibilityGridRole, NSAccessibilityGroupRole, + NSAccessibilityGrowAreaAttribute, NSAccessibilityGrowAreaRole, NSAccessibilityHandleRole, + NSAccessibilityHandlesAttribute, NSAccessibilityHeadIndentMarkerTypeValue, + NSAccessibilityHeaderAttribute, NSAccessibilityHelpAttribute, + NSAccessibilityHelpTagCreatedNotification, NSAccessibilityHelpTagRole, + NSAccessibilityHiddenAttribute, NSAccessibilityHorizontalOrientationValue, + NSAccessibilityHorizontalScrollBarAttribute, NSAccessibilityHorizontalUnitDescriptionAttribute, + NSAccessibilityHorizontalUnitsAttribute, NSAccessibilityIdentifierAttribute, + NSAccessibilityImageRole, NSAccessibilityInchesUnitValue, NSAccessibilityIncrementAction, + NSAccessibilityIncrementArrowSubrole, NSAccessibilityIncrementButtonAttribute, + NSAccessibilityIncrementPageSubrole, NSAccessibilityIncrementorRole, + NSAccessibilityIndexAttribute, NSAccessibilityInsertionPointLineNumberAttribute, + NSAccessibilityLabelUIElementsAttribute, NSAccessibilityLabelValueAttribute, + NSAccessibilityLanguageTextAttribute, NSAccessibilityLayoutAreaRole, + NSAccessibilityLayoutChangedNotification, NSAccessibilityLayoutItemRole, + NSAccessibilityLayoutPointForScreenPointParameterizedAttribute, + NSAccessibilityLayoutSizeForScreenSizeParameterizedAttribute, + NSAccessibilityLeftTabStopMarkerTypeValue, NSAccessibilityLevelIndicatorRole, + NSAccessibilityLineForIndexParameterizedAttribute, NSAccessibilityLinkRole, + NSAccessibilityLinkTextAttribute, NSAccessibilityLinkedUIElementsAttribute, + NSAccessibilityListItemIndexTextAttribute, NSAccessibilityListItemLevelTextAttribute, + NSAccessibilityListItemPrefixTextAttribute, NSAccessibilityListRole, + NSAccessibilityLoadingToken, NSAccessibilityMainAttribute, NSAccessibilityMainWindowAttribute, + NSAccessibilityMainWindowChangedNotification, NSAccessibilityMarkedMisspelledTextAttribute, + NSAccessibilityMarkerGroupUIElementAttribute, NSAccessibilityMarkerTypeAttribute, + NSAccessibilityMarkerTypeDescriptionAttribute, NSAccessibilityMarkerUIElementsAttribute, + NSAccessibilityMarkerValuesAttribute, NSAccessibilityMatteContentUIElementAttribute, + NSAccessibilityMatteHoleAttribute, NSAccessibilityMatteRole, NSAccessibilityMaxValueAttribute, + NSAccessibilityMenuBarAttribute, NSAccessibilityMenuBarItemRole, NSAccessibilityMenuBarRole, + NSAccessibilityMenuButtonRole, NSAccessibilityMenuItemRole, NSAccessibilityMenuRole, + NSAccessibilityMinValueAttribute, NSAccessibilityMinimizeButtonAttribute, + NSAccessibilityMinimizeButtonSubrole, NSAccessibilityMinimizedAttribute, + NSAccessibilityMisspelledTextAttribute, NSAccessibilityModalAttribute, + NSAccessibilityMovedNotification, NSAccessibilityNextContentsAttribute, + NSAccessibilityNotificationName, NSAccessibilityNotificationUserInfoKey, + NSAccessibilityNumberOfCharactersAttribute, NSAccessibilityOrderedByRowAttribute, + NSAccessibilityOrientation, NSAccessibilityOrientationAttribute, + NSAccessibilityOrientationHorizontal, NSAccessibilityOrientationUnknown, + NSAccessibilityOrientationValue, NSAccessibilityOrientationVertical, + NSAccessibilityOutlineRole, NSAccessibilityOutlineRowSubrole, + NSAccessibilityOverflowButtonAttribute, NSAccessibilityPageRole, + NSAccessibilityParameterizedAttributeName, NSAccessibilityParentAttribute, + NSAccessibilityPicasUnitValue, NSAccessibilityPickAction, + NSAccessibilityPlaceholderValueAttribute, NSAccessibilityPointsUnitValue, + NSAccessibilityPopUpButtonRole, NSAccessibilityPopoverRole, NSAccessibilityPositionAttribute, + NSAccessibilityPostNotificationWithUserInfo, NSAccessibilityPressAction, + NSAccessibilityPreviousContentsAttribute, NSAccessibilityPriorityHigh, + NSAccessibilityPriorityKey, NSAccessibilityPriorityLevel, NSAccessibilityPriorityLow, + NSAccessibilityPriorityMedium, NSAccessibilityProgressIndicatorRole, + NSAccessibilityProxyAttribute, NSAccessibilityRTFForRangeParameterizedAttribute, + NSAccessibilityRadioButtonRole, NSAccessibilityRadioGroupRole, NSAccessibilityRaiseAction, + NSAccessibilityRangeForIndexParameterizedAttribute, + NSAccessibilityRangeForLineParameterizedAttribute, + NSAccessibilityRangeForPositionParameterizedAttribute, NSAccessibilityRatingIndicatorSubrole, + NSAccessibilityRelevanceIndicatorRole, NSAccessibilityRequiredAttribute, + NSAccessibilityResizedNotification, NSAccessibilityRightTabStopMarkerTypeValue, + NSAccessibilityRole, NSAccessibilityRoleAttribute, NSAccessibilityRoleDescriptionAttribute, + NSAccessibilityRowCollapsedNotification, NSAccessibilityRowCountAttribute, + NSAccessibilityRowCountChangedNotification, NSAccessibilityRowExpandedNotification, + NSAccessibilityRowHeaderUIElementsAttribute, NSAccessibilityRowIndexRangeAttribute, + NSAccessibilityRowRole, NSAccessibilityRowsAttribute, NSAccessibilityRulerMarkerRole, + NSAccessibilityRulerMarkerType, NSAccessibilityRulerMarkerTypeIndentFirstLine, + NSAccessibilityRulerMarkerTypeIndentHead, NSAccessibilityRulerMarkerTypeIndentTail, + NSAccessibilityRulerMarkerTypeTabStopCenter, NSAccessibilityRulerMarkerTypeTabStopDecimal, + NSAccessibilityRulerMarkerTypeTabStopLeft, NSAccessibilityRulerMarkerTypeTabStopRight, + NSAccessibilityRulerMarkerTypeUnknown, NSAccessibilityRulerMarkerTypeValue, + NSAccessibilityRulerRole, NSAccessibilityRulerUnitValue, + NSAccessibilityScreenPointForLayoutPointParameterizedAttribute, + NSAccessibilityScreenSizeForLayoutSizeParameterizedAttribute, NSAccessibilityScrollAreaRole, + NSAccessibilityScrollBarRole, NSAccessibilitySearchButtonAttribute, + NSAccessibilitySearchFieldSubrole, NSAccessibilitySearchMenuAttribute, + NSAccessibilitySectionListSubrole, NSAccessibilitySecureTextFieldSubrole, + NSAccessibilitySelectedAttribute, NSAccessibilitySelectedCellsAttribute, + NSAccessibilitySelectedCellsChangedNotification, NSAccessibilitySelectedChildrenAttribute, + NSAccessibilitySelectedChildrenChangedNotification, + NSAccessibilitySelectedChildrenMovedNotification, NSAccessibilitySelectedColumnsAttribute, + NSAccessibilitySelectedColumnsChangedNotification, NSAccessibilitySelectedRowsAttribute, + NSAccessibilitySelectedRowsChangedNotification, NSAccessibilitySelectedTextAttribute, + NSAccessibilitySelectedTextChangedNotification, NSAccessibilitySelectedTextRangeAttribute, + NSAccessibilitySelectedTextRangesAttribute, NSAccessibilityServesAsTitleForUIElementsAttribute, + NSAccessibilityShadowTextAttribute, NSAccessibilitySharedCharacterRangeAttribute, + NSAccessibilitySharedFocusElementsAttribute, NSAccessibilitySharedTextUIElementsAttribute, + NSAccessibilitySheetCreatedNotification, NSAccessibilitySheetRole, + NSAccessibilityShowAlternateUIAction, NSAccessibilityShowDefaultUIAction, + NSAccessibilityShowMenuAction, NSAccessibilityShownMenuAttribute, NSAccessibilitySizeAttribute, + NSAccessibilitySliderRole, NSAccessibilitySortButtonRole, NSAccessibilitySortButtonSubrole, + NSAccessibilitySortDirection, NSAccessibilitySortDirectionAscending, + NSAccessibilitySortDirectionAttribute, NSAccessibilitySortDirectionDescending, + NSAccessibilitySortDirectionUnknown, NSAccessibilitySortDirectionValue, + NSAccessibilitySplitGroupRole, NSAccessibilitySplitterRole, NSAccessibilitySplittersAttribute, + NSAccessibilityStandardWindowSubrole, NSAccessibilityStaticTextRole, + NSAccessibilityStrikethroughColorTextAttribute, NSAccessibilityStrikethroughTextAttribute, + NSAccessibilityStringForRangeParameterizedAttribute, + NSAccessibilityStyleRangeForIndexParameterizedAttribute, NSAccessibilitySubrole, + NSAccessibilitySubroleAttribute, NSAccessibilitySuperscriptTextAttribute, + NSAccessibilitySwitchSubrole, NSAccessibilitySystemDialogSubrole, + NSAccessibilitySystemFloatingWindowSubrole, NSAccessibilitySystemWideRole, + NSAccessibilityTabButtonSubrole, NSAccessibilityTabGroupRole, NSAccessibilityTableRole, + NSAccessibilityTableRowSubrole, NSAccessibilityTabsAttribute, + NSAccessibilityTailIndentMarkerTypeValue, NSAccessibilityTextAlignmentAttribute, + NSAccessibilityTextAreaRole, NSAccessibilityTextAttachmentSubrole, + NSAccessibilityTextFieldRole, NSAccessibilityTextLinkSubrole, NSAccessibilityTimelineSubrole, + NSAccessibilityTitleAttribute, NSAccessibilityTitleChangedNotification, + NSAccessibilityTitleUIElementAttribute, NSAccessibilityToggleSubrole, + NSAccessibilityToolbarButtonAttribute, NSAccessibilityToolbarButtonSubrole, + NSAccessibilityToolbarRole, NSAccessibilityTopLevelUIElementAttribute, + NSAccessibilityUIElementDestroyedNotification, NSAccessibilityUIElementsKey, + NSAccessibilityURLAttribute, NSAccessibilityUnderlineColorTextAttribute, + NSAccessibilityUnderlineTextAttribute, NSAccessibilityUnitDescriptionAttribute, + NSAccessibilityUnits, NSAccessibilityUnitsAttribute, NSAccessibilityUnitsCentimeters, + NSAccessibilityUnitsChangedNotification, NSAccessibilityUnitsInches, NSAccessibilityUnitsPicas, + NSAccessibilityUnitsPoints, NSAccessibilityUnitsUnknown, NSAccessibilityUnknownMarkerTypeValue, + NSAccessibilityUnknownOrientationValue, NSAccessibilityUnknownRole, + NSAccessibilityUnknownSortDirectionValue, NSAccessibilityUnknownSubrole, + NSAccessibilityUnknownUnitValue, NSAccessibilityValueAttribute, + NSAccessibilityValueChangedNotification, NSAccessibilityValueDescriptionAttribute, + NSAccessibilityValueIndicatorRole, NSAccessibilityVerticalOrientationValue, + NSAccessibilityVerticalScrollBarAttribute, NSAccessibilityVerticalUnitDescriptionAttribute, + NSAccessibilityVerticalUnitsAttribute, NSAccessibilityVisibleCellsAttribute, + NSAccessibilityVisibleCharacterRangeAttribute, NSAccessibilityVisibleChildrenAttribute, + NSAccessibilityVisibleColumnsAttribute, NSAccessibilityVisibleNameKey, + NSAccessibilityVisibleRowsAttribute, NSAccessibilityWarningValueAttribute, + NSAccessibilityWindowAttribute, NSAccessibilityWindowCreatedNotification, + NSAccessibilityWindowDeminiaturizedNotification, NSAccessibilityWindowMiniaturizedNotification, + NSAccessibilityWindowMovedNotification, NSAccessibilityWindowResizedNotification, + NSAccessibilityWindowRole, NSAccessibilityWindowsAttribute, NSAccessibilityZoomButtonAttribute, + NSAccessibilityZoomButtonSubrole, +}; +pub use self::__NSAccessibilityCustomAction::NSAccessibilityCustomAction; +pub use self::__NSAccessibilityCustomRotor::{ + NSAccessibilityCustomRotor, NSAccessibilityCustomRotorItemResult, + NSAccessibilityCustomRotorItemSearchDelegate, NSAccessibilityCustomRotorSearchDirection, + NSAccessibilityCustomRotorSearchDirectionNext, + NSAccessibilityCustomRotorSearchDirectionPrevious, NSAccessibilityCustomRotorSearchParameters, + NSAccessibilityCustomRotorType, NSAccessibilityCustomRotorTypeAnnotation, + NSAccessibilityCustomRotorTypeAny, NSAccessibilityCustomRotorTypeAudiograph, + NSAccessibilityCustomRotorTypeBoldText, NSAccessibilityCustomRotorTypeCustom, + NSAccessibilityCustomRotorTypeHeading, NSAccessibilityCustomRotorTypeHeadingLevel1, + NSAccessibilityCustomRotorTypeHeadingLevel2, NSAccessibilityCustomRotorTypeHeadingLevel3, + NSAccessibilityCustomRotorTypeHeadingLevel4, NSAccessibilityCustomRotorTypeHeadingLevel5, + NSAccessibilityCustomRotorTypeHeadingLevel6, NSAccessibilityCustomRotorTypeImage, + NSAccessibilityCustomRotorTypeItalicText, NSAccessibilityCustomRotorTypeLandmark, + NSAccessibilityCustomRotorTypeLink, NSAccessibilityCustomRotorTypeList, + NSAccessibilityCustomRotorTypeMisspelledWord, NSAccessibilityCustomRotorTypeTable, + NSAccessibilityCustomRotorTypeTextField, NSAccessibilityCustomRotorTypeUnderlinedText, + NSAccessibilityCustomRotorTypeVisitedLink, +}; +pub use self::__NSAccessibilityElement::NSAccessibilityElement; +pub use self::__NSAccessibilityProtocols::{ + NSAccessibility, NSAccessibilityButton, NSAccessibilityCheckBox, + NSAccessibilityContainsTransientUI, NSAccessibilityElementLoading, NSAccessibilityGroup, + NSAccessibilityImage, NSAccessibilityLayoutArea, NSAccessibilityLayoutItem, + NSAccessibilityList, NSAccessibilityNavigableStaticText, NSAccessibilityOutline, + NSAccessibilityProgressIndicator, NSAccessibilityRadioButton, NSAccessibilityRow, + NSAccessibilitySlider, NSAccessibilityStaticText, NSAccessibilityStepper, + NSAccessibilitySwitch, NSAccessibilityTable, +}; +pub use self::__NSActionCell::NSActionCell; +pub use self::__NSAlert::{ + NSAlert, NSAlertDelegate, NSAlertFirstButtonReturn, NSAlertSecondButtonReturn, NSAlertStyle, + NSAlertStyleCritical, NSAlertStyleInformational, NSAlertStyleWarning, NSAlertThirdButtonReturn, + NSCriticalAlertStyle, NSInformationalAlertStyle, NSWarningAlertStyle, +}; +pub use self::__NSAlignmentFeedbackFilter::{NSAlignmentFeedbackFilter, NSAlignmentFeedbackToken}; +pub use self::__NSAnimation::{ + NSAnimatablePropertyContainer, NSAnimatablePropertyKey, NSAnimation, NSAnimationBlocking, + NSAnimationBlockingMode, NSAnimationCurve, NSAnimationDelegate, NSAnimationEaseIn, + NSAnimationEaseInOut, NSAnimationEaseOut, NSAnimationLinear, NSAnimationNonblocking, + NSAnimationNonblockingThreaded, NSAnimationProgress, NSAnimationProgressMark, + NSAnimationProgressMarkNotification, NSAnimationTriggerOrderIn, NSAnimationTriggerOrderOut, + NSViewAnimation, NSViewAnimationEffectKey, NSViewAnimationEffectName, + NSViewAnimationEndFrameKey, NSViewAnimationFadeInEffect, NSViewAnimationFadeOutEffect, + NSViewAnimationKey, NSViewAnimationStartFrameKey, NSViewAnimationTargetKey, +}; +pub use self::__NSAnimationContext::NSAnimationContext; +pub use self::__NSAppearance::{ + NSAppearance, NSAppearanceCustomization, NSAppearanceName, + NSAppearanceNameAccessibilityHighContrastAqua, + NSAppearanceNameAccessibilityHighContrastDarkAqua, + NSAppearanceNameAccessibilityHighContrastVibrantDark, + NSAppearanceNameAccessibilityHighContrastVibrantLight, NSAppearanceNameAqua, + NSAppearanceNameDarkAqua, NSAppearanceNameLightContent, NSAppearanceNameVibrantDark, + NSAppearanceNameVibrantLight, +}; +pub use self::__NSApplication::{ + NSAboutPanelOptionApplicationIcon, NSAboutPanelOptionApplicationName, + NSAboutPanelOptionApplicationVersion, NSAboutPanelOptionCredits, NSAboutPanelOptionKey, + NSAboutPanelOptionVersion, NSApp, NSAppKitVersion, NSAppKitVersionNumber, + NSAppKitVersionNumber10_0, NSAppKitVersionNumber10_1, NSAppKitVersionNumber10_10, + NSAppKitVersionNumber10_10_2, NSAppKitVersionNumber10_10_3, NSAppKitVersionNumber10_10_4, + NSAppKitVersionNumber10_10_5, NSAppKitVersionNumber10_10_Max, NSAppKitVersionNumber10_11, + NSAppKitVersionNumber10_11_1, NSAppKitVersionNumber10_11_2, NSAppKitVersionNumber10_11_3, + NSAppKitVersionNumber10_12, NSAppKitVersionNumber10_12_1, NSAppKitVersionNumber10_12_2, + NSAppKitVersionNumber10_13, NSAppKitVersionNumber10_13_1, NSAppKitVersionNumber10_13_2, + NSAppKitVersionNumber10_13_4, NSAppKitVersionNumber10_14, NSAppKitVersionNumber10_14_1, + NSAppKitVersionNumber10_14_2, NSAppKitVersionNumber10_14_3, NSAppKitVersionNumber10_14_4, + NSAppKitVersionNumber10_14_5, NSAppKitVersionNumber10_15, NSAppKitVersionNumber10_15_1, + NSAppKitVersionNumber10_15_2, NSAppKitVersionNumber10_15_3, NSAppKitVersionNumber10_15_4, + NSAppKitVersionNumber10_15_5, NSAppKitVersionNumber10_15_6, NSAppKitVersionNumber10_2, + NSAppKitVersionNumber10_2_3, NSAppKitVersionNumber10_3, NSAppKitVersionNumber10_3_2, + NSAppKitVersionNumber10_3_3, NSAppKitVersionNumber10_3_5, NSAppKitVersionNumber10_3_7, + NSAppKitVersionNumber10_3_9, NSAppKitVersionNumber10_4, NSAppKitVersionNumber10_4_1, + NSAppKitVersionNumber10_4_3, NSAppKitVersionNumber10_4_4, NSAppKitVersionNumber10_4_7, + NSAppKitVersionNumber10_5, NSAppKitVersionNumber10_5_2, NSAppKitVersionNumber10_5_3, + NSAppKitVersionNumber10_6, NSAppKitVersionNumber10_7, NSAppKitVersionNumber10_7_2, + NSAppKitVersionNumber10_7_3, NSAppKitVersionNumber10_7_4, NSAppKitVersionNumber10_8, + NSAppKitVersionNumber10_9, NSAppKitVersionNumber11_0, NSAppKitVersionNumber11_1, + NSAppKitVersionNumber11_2, NSAppKitVersionNumber11_3, NSAppKitVersionNumber11_4, NSApplication, + NSApplicationDelegate, NSApplicationDelegateReply, NSApplicationDelegateReplyCancel, + NSApplicationDelegateReplyFailure, NSApplicationDelegateReplySuccess, + NSApplicationDidBecomeActiveNotification, NSApplicationDidChangeOcclusionStateNotification, + NSApplicationDidChangeScreenParametersNotification, + NSApplicationDidFinishLaunchingNotification, NSApplicationDidHideNotification, + NSApplicationDidResignActiveNotification, NSApplicationDidUnhideNotification, + NSApplicationDidUpdateNotification, NSApplicationLaunchIsDefaultLaunchKey, + NSApplicationLaunchRemoteNotificationKey, NSApplicationLaunchUserNotificationKey, + NSApplicationLoad, NSApplicationMain, NSApplicationOcclusionState, + NSApplicationOcclusionStateVisible, NSApplicationPresentationAutoHideDock, + NSApplicationPresentationAutoHideMenuBar, NSApplicationPresentationAutoHideToolbar, + NSApplicationPresentationDefault, NSApplicationPresentationDisableAppleMenu, + NSApplicationPresentationDisableCursorLocationAssistance, + NSApplicationPresentationDisableForceQuit, NSApplicationPresentationDisableHideApplication, + NSApplicationPresentationDisableMenuBarTransparency, + NSApplicationPresentationDisableProcessSwitching, + NSApplicationPresentationDisableSessionTermination, NSApplicationPresentationFullScreen, + NSApplicationPresentationHideDock, NSApplicationPresentationHideMenuBar, + NSApplicationPresentationOptions, NSApplicationPrintReply, + NSApplicationProtectedDataDidBecomeAvailableNotification, + NSApplicationProtectedDataWillBecomeUnavailableNotification, NSApplicationTerminateReply, + NSApplicationWillBecomeActiveNotification, NSApplicationWillFinishLaunchingNotification, + NSApplicationWillHideNotification, NSApplicationWillResignActiveNotification, + NSApplicationWillTerminateNotification, NSApplicationWillUnhideNotification, + NSApplicationWillUpdateNotification, NSCriticalRequest, NSEventTrackingRunLoopMode, + NSInformationalRequest, NSModalPanelRunLoopMode, NSModalResponse, NSModalResponseAbort, + NSModalResponseContinue, NSModalResponseStop, NSModalSession, NSPerformService, + NSPrintingCancelled, NSPrintingFailure, NSPrintingReplyLater, NSPrintingSuccess, + NSRegisterServicesProvider, NSRemoteNotificationType, NSRemoteNotificationTypeAlert, + NSRemoteNotificationTypeBadge, NSRemoteNotificationTypeNone, NSRemoteNotificationTypeSound, + NSRequestUserAttentionType, NSRunAbortedResponse, NSRunContinuesResponse, NSRunStoppedResponse, + NSServiceProviderName, NSServicesMenuRequestor, NSSetShowsServicesMenuItem, + NSShowsServicesMenuItem, NSTerminateCancel, NSTerminateLater, NSTerminateNow, + NSUnregisterServicesProvider, NSUpdateDynamicServices, NSUpdateWindowsRunLoopOrdering, + NSWindowListOptions, NSWindowListOrderedFrontToBack, +}; +pub use self::__NSArrayController::NSArrayController; +pub use self::__NSAttributedString::{ + NSAppearanceDocumentAttribute, NSAttachmentAttributeName, + NSAttributedStringDocumentAttributeKey, NSAttributedStringDocumentReadingOptionKey, + NSAttributedStringDocumentType, NSAuthorDocumentAttribute, NSBackgroundColorAttributeName, + NSBackgroundColorDocumentAttribute, NSBaseURLDocumentOption, NSBaselineOffsetAttributeName, + NSBottomMarginDocumentAttribute, NSCategoryDocumentAttribute, + NSCharacterEncodingDocumentAttribute, NSCharacterEncodingDocumentOption, + NSCharacterShapeAttributeName, NSCocoaVersionDocumentAttribute, NSCommentDocumentAttribute, + NSCompanyDocumentAttribute, NSConvertedDocumentAttribute, NSCopyrightDocumentAttribute, + NSCreationTimeDocumentAttribute, NSCursorAttributeName, NSDefaultAttributesDocumentAttribute, + NSDefaultAttributesDocumentOption, NSDefaultTabIntervalDocumentAttribute, + NSDocFormatTextDocumentType, NSDocumentTypeDocumentAttribute, NSDocumentTypeDocumentOption, + NSEditorDocumentAttribute, NSExcludedElementsDocumentAttribute, NSExpansionAttributeName, + NSFileTypeDocumentAttribute, NSFileTypeDocumentOption, NSFontAttributeName, + NSForegroundColorAttributeName, NSGlyphInfoAttributeName, NSHTMLTextDocumentType, + NSHyphenationFactorDocumentAttribute, NSKernAttributeName, NSKeywordsDocumentAttribute, + NSLeftMarginDocumentAttribute, NSLigatureAttributeName, NSLinkAttributeName, + NSMacSimpleTextDocumentType, NSManagerDocumentAttribute, NSMarkedClauseSegmentAttributeName, + NSModificationTimeDocumentAttribute, NSNoUnderlineStyle, NSObliquenessAttributeName, + NSOfficeOpenXMLTextDocumentType, NSOpenDocumentTextDocumentType, NSPaperSizeDocumentAttribute, + NSParagraphStyleAttributeName, NSPlainTextDocumentType, NSPrefixSpacesDocumentAttribute, + NSRTFDTextDocumentType, NSRTFTextDocumentType, NSReadOnlyDocumentAttribute, + NSRightMarginDocumentAttribute, NSShadowAttributeName, NSSingleUnderlineStyle, + NSSourceTextScalingDocumentAttribute, NSSourceTextScalingDocumentOption, NSSpellingState, + NSSpellingStateAttributeName, NSSpellingStateGrammarFlag, NSSpellingStateSpellingFlag, + NSStrikethroughColorAttributeName, NSStrikethroughStyleAttributeName, + NSStrokeColorAttributeName, NSStrokeWidthAttributeName, NSSubjectDocumentAttribute, + NSSuperscriptAttributeName, NSTargetTextScalingDocumentOption, NSTextAlternativesAttributeName, + NSTextEffectAttributeName, NSTextEffectLetterpressStyle, NSTextEffectStyle, + NSTextEncodingNameDocumentAttribute, NSTextEncodingNameDocumentOption, NSTextLayoutSectionKey, + NSTextLayoutSectionOrientation, NSTextLayoutSectionRange, NSTextLayoutSectionsAttribute, + NSTextScalingDocumentAttribute, NSTextScalingStandard, NSTextScalingType, NSTextScalingiOS, + NSTextSizeMultiplierDocumentOption, NSTimeoutDocumentOption, NSTitleDocumentAttribute, + NSToolTipAttributeName, NSTopMarginDocumentAttribute, NSTrackingAttributeName, + NSUnderlineByWord, NSUnderlineByWordMask, NSUnderlineColorAttributeName, + NSUnderlinePatternDash, NSUnderlinePatternDashDot, NSUnderlinePatternDashDotDot, + NSUnderlinePatternDot, NSUnderlinePatternSolid, NSUnderlineStrikethroughMask, NSUnderlineStyle, + NSUnderlineStyleAttributeName, NSUnderlineStyleByWord, NSUnderlineStyleDouble, + NSUnderlineStyleNone, NSUnderlineStylePatternDash, NSUnderlineStylePatternDashDot, + NSUnderlineStylePatternDashDotDot, NSUnderlineStylePatternDot, NSUnderlineStylePatternSolid, + NSUnderlineStyleSingle, NSUnderlineStyleThick, NSUsesScreenFontsDocumentAttribute, + NSVerticalGlyphFormAttributeName, NSViewModeDocumentAttribute, NSViewSizeDocumentAttribute, + NSViewZoomDocumentAttribute, NSWebArchiveTextDocumentType, NSWebPreferencesDocumentOption, + NSWebResourceLoadDelegateDocumentOption, NSWordMLTextDocumentType, + NSWritingDirectionAttributeName, NSWritingDirectionEmbedding, NSWritingDirectionFormatType, + NSWritingDirectionOverride, +}; +pub use self::__NSBezierPath::{ + NSBevelLineJoinStyle, NSBezierPath, NSBezierPathElement, NSBezierPathElementClosePath, + NSBezierPathElementCurveTo, NSBezierPathElementLineTo, NSBezierPathElementMoveTo, + NSButtLineCapStyle, NSClosePathBezierPathElement, NSCurveToBezierPathElement, + NSEvenOddWindingRule, NSLineCapStyle, NSLineCapStyleButt, NSLineCapStyleRound, + NSLineCapStyleSquare, NSLineJoinStyle, NSLineJoinStyleBevel, NSLineJoinStyleMiter, + NSLineJoinStyleRound, NSLineToBezierPathElement, NSMiterLineJoinStyle, + NSMoveToBezierPathElement, NSNonZeroWindingRule, NSRoundLineCapStyle, NSRoundLineJoinStyle, + NSSquareLineCapStyle, NSWindingRule, NSWindingRuleEvenOdd, NSWindingRuleNonZero, +}; +pub use self::__NSBitmapImageRep::{ + NS16BitBigEndianBitmapFormat, NS16BitLittleEndianBitmapFormat, NS32BitBigEndianBitmapFormat, + NS32BitLittleEndianBitmapFormat, NSAlphaFirstBitmapFormat, NSAlphaNonpremultipliedBitmapFormat, + NSBMPFileType, NSBitmapFormat, NSBitmapFormatAlphaFirst, NSBitmapFormatAlphaNonpremultiplied, + NSBitmapFormatFloatingPointSamples, NSBitmapFormatSixteenBitBigEndian, + NSBitmapFormatSixteenBitLittleEndian, NSBitmapFormatThirtyTwoBitBigEndian, + NSBitmapFormatThirtyTwoBitLittleEndian, NSBitmapImageFileType, NSBitmapImageFileTypeBMP, + NSBitmapImageFileTypeGIF, NSBitmapImageFileTypeJPEG, NSBitmapImageFileTypeJPEG2000, + NSBitmapImageFileTypePNG, NSBitmapImageFileTypeTIFF, NSBitmapImageRep, + NSBitmapImageRepPropertyKey, NSFloatingPointSamplesBitmapFormat, NSGIFFileType, + NSImageColorSyncProfileData, NSImageCompressionFactor, NSImageCompressionMethod, + NSImageCurrentFrame, NSImageCurrentFrameDuration, NSImageDitherTransparency, NSImageEXIFData, + NSImageFallbackBackgroundColor, NSImageFrameCount, NSImageGamma, NSImageIPTCData, + NSImageInterlaced, NSImageLoopCount, NSImageProgressive, NSImageRGBColorTable, + NSImageRepLoadStatus, NSImageRepLoadStatusCompleted, NSImageRepLoadStatusInvalidData, + NSImageRepLoadStatusReadingHeader, NSImageRepLoadStatusUnexpectedEOF, + NSImageRepLoadStatusUnknownType, NSImageRepLoadStatusWillNeedAllData, NSJPEG2000FileType, + NSJPEGFileType, NSPNGFileType, NSTIFFCompression, NSTIFFCompressionCCITTFAX3, + NSTIFFCompressionCCITTFAX4, NSTIFFCompressionJPEG, NSTIFFCompressionLZW, NSTIFFCompressionNEXT, + NSTIFFCompressionNone, NSTIFFCompressionOldJPEG, NSTIFFCompressionPackBits, NSTIFFFileType, +}; +pub use self::__NSBox::{ + NSAboveBottom, NSAboveTop, NSAtBottom, NSAtTop, NSBelowBottom, NSBelowTop, NSBox, NSBoxCustom, + NSBoxOldStyle, NSBoxPrimary, NSBoxSecondary, NSBoxSeparator, NSBoxType, NSNoTitle, + NSTitlePosition, +}; +pub use self::__NSBrowser::{ + NSAppKitVersionNumberWithColumnResizingBrowser, + NSAppKitVersionNumberWithContinuousScrollingBrowser, NSBrowser, NSBrowserAutoColumnResizing, + NSBrowserColumnConfigurationDidChangeNotification, NSBrowserColumnResizingType, + NSBrowserColumnsAutosaveName, NSBrowserDelegate, NSBrowserDropAbove, NSBrowserDropOn, + NSBrowserDropOperation, NSBrowserNoColumnResizing, NSBrowserUserColumnResizing, +}; +pub use self::__NSBrowserCell::NSBrowserCell; +pub use self::__NSButton::NSButton; +pub use self::__NSButtonCell::{ + NSAcceleratorButton, NSBezelStyle, NSBezelStyleCircular, NSBezelStyleDisclosure, + NSBezelStyleHelpButton, NSBezelStyleInline, NSBezelStyleRecessed, NSBezelStyleRegularSquare, + NSBezelStyleRoundRect, NSBezelStyleRounded, NSBezelStyleRoundedDisclosure, + NSBezelStyleShadowlessSquare, NSBezelStyleSmallSquare, NSBezelStyleTexturedRounded, + NSBezelStyleTexturedSquare, NSButtonCell, NSButtonType, NSButtonTypeAccelerator, + NSButtonTypeMomentaryChange, NSButtonTypeMomentaryLight, NSButtonTypeMomentaryPushIn, + NSButtonTypeMultiLevelAccelerator, NSButtonTypeOnOff, NSButtonTypePushOnPushOff, + NSButtonTypeRadio, NSButtonTypeSwitch, NSButtonTypeToggle, NSCircularBezelStyle, + NSDisclosureBezelStyle, NSGradientConcaveStrong, NSGradientConcaveWeak, NSGradientConvexStrong, + NSGradientConvexWeak, NSGradientNone, NSGradientType, NSHelpButtonBezelStyle, + NSInlineBezelStyle, NSMomentaryChangeButton, NSMomentaryLight, NSMomentaryLightButton, + NSMomentaryPushButton, NSMomentaryPushInButton, NSMultiLevelAcceleratorButton, NSOnOffButton, + NSPushOnPushOffButton, NSRadioButton, NSRecessedBezelStyle, NSRegularSquareBezelStyle, + NSRoundRectBezelStyle, NSRoundedBezelStyle, NSRoundedDisclosureBezelStyle, + NSShadowlessSquareBezelStyle, NSSmallIconButtonBezelStyle, NSSmallSquareBezelStyle, + NSSwitchButton, NSTexturedRoundedBezelStyle, NSTexturedSquareBezelStyle, + NSThickSquareBezelStyle, NSThickerSquareBezelStyle, NSToggleButton, +}; +pub use self::__NSButtonTouchBarItem::NSButtonTouchBarItem; +pub use self::__NSCachedImageRep::NSCachedImageRep; +pub use self::__NSCandidateListTouchBarItem::{ + NSCandidateListTouchBarItem, NSCandidateListTouchBarItemDelegate, + NSTouchBarItemIdentifierCandidateList, +}; +pub use self::__NSCell::{ + NSAnyType, NSBackgroundStyle, NSBackgroundStyleDark, NSBackgroundStyleEmphasized, + NSBackgroundStyleLight, NSBackgroundStyleLowered, NSBackgroundStyleNormal, + NSBackgroundStyleRaised, NSBlueControlTint, NSCell, NSCellAllowsMixedState, NSCellAttribute, + NSCellChangesContents, NSCellDisabled, NSCellEditable, NSCellHasImageHorizontal, + NSCellHasImageOnLeftOrBottom, NSCellHasOverlappingImage, NSCellHighlighted, + NSCellHitContentArea, NSCellHitEditableTextArea, NSCellHitNone, NSCellHitResult, + NSCellHitTrackableArea, NSCellImagePosition, NSCellIsBordered, NSCellIsInsetButton, + NSCellLightsByBackground, NSCellLightsByContents, NSCellLightsByGray, NSCellState, + NSCellStateValue, NSCellStyleMask, NSCellType, NSChangeBackgroundCell, + NSChangeBackgroundCellMask, NSChangeGrayCell, NSChangeGrayCellMask, NSClearControlTint, + NSContentsCellMask, NSControlSize, NSControlSizeLarge, NSControlSizeMini, NSControlSizeRegular, + NSControlSizeSmall, NSControlStateValue, NSControlStateValueMixed, NSControlStateValueOff, + NSControlStateValueOn, NSControlTint, NSControlTintDidChangeNotification, NSDefaultControlTint, + NSDoubleType, NSDrawNinePartImage, NSDrawThreePartImage, NSFloatType, NSGraphiteControlTint, + NSImageAbove, NSImageBelow, NSImageCellType, NSImageLeading, NSImageLeft, NSImageOnly, + NSImageOverlaps, NSImageRight, NSImageScaleAxesIndependently, NSImageScaleNone, + NSImageScaleProportionallyDown, NSImageScaleProportionallyUpOrDown, NSImageScaling, + NSImageTrailing, NSIntType, NSMiniControlSize, NSMixedState, NSNoCellMask, NSNoImage, + NSNullCellType, NSOffState, NSOnState, NSPositiveDoubleType, NSPositiveFloatType, + NSPositiveIntType, NSPushInCell, NSPushInCellMask, NSRegularControlSize, NSScaleNone, + NSScaleProportionally, NSScaleToFit, NSSmallControlSize, NSTextCellType, +}; +pub use self::__NSClickGestureRecognizer::NSClickGestureRecognizer; +pub use self::__NSClipView::NSClipView; +pub use self::__NSCollectionView::{ + NSCollectionView, NSCollectionViewDataSource, NSCollectionViewDelegate, + NSCollectionViewDropBefore, NSCollectionViewDropOn, NSCollectionViewDropOperation, + NSCollectionViewElement, NSCollectionViewItem, NSCollectionViewItemHighlightAsDropTarget, + NSCollectionViewItemHighlightForDeselection, NSCollectionViewItemHighlightForSelection, + NSCollectionViewItemHighlightNone, NSCollectionViewItemHighlightState, + NSCollectionViewPrefetching, NSCollectionViewScrollPosition, + NSCollectionViewScrollPositionBottom, NSCollectionViewScrollPositionCenteredHorizontally, + NSCollectionViewScrollPositionCenteredVertically, NSCollectionViewScrollPositionLeadingEdge, + NSCollectionViewScrollPositionLeft, NSCollectionViewScrollPositionNearestHorizontalEdge, + NSCollectionViewScrollPositionNearestVerticalEdge, NSCollectionViewScrollPositionNone, + NSCollectionViewScrollPositionRight, NSCollectionViewScrollPositionTop, + NSCollectionViewScrollPositionTrailingEdge, NSCollectionViewSectionHeaderView, + NSCollectionViewSupplementaryElementKind, +}; +pub use self::__NSCollectionViewCompositionalLayout::{ + NSCollectionLayoutAnchor, NSCollectionLayoutBoundarySupplementaryItem, + NSCollectionLayoutContainer, NSCollectionLayoutDecorationItem, NSCollectionLayoutDimension, + NSCollectionLayoutEdgeSpacing, NSCollectionLayoutEnvironment, NSCollectionLayoutGroup, + NSCollectionLayoutGroupCustomItem, NSCollectionLayoutGroupCustomItemProvider, + NSCollectionLayoutItem, NSCollectionLayoutSection, + NSCollectionLayoutSectionOrthogonalScrollingBehavior, + NSCollectionLayoutSectionOrthogonalScrollingBehaviorContinuous, + NSCollectionLayoutSectionOrthogonalScrollingBehaviorContinuousGroupLeadingBoundary, + NSCollectionLayoutSectionOrthogonalScrollingBehaviorGroupPaging, + NSCollectionLayoutSectionOrthogonalScrollingBehaviorGroupPagingCentered, + NSCollectionLayoutSectionOrthogonalScrollingBehaviorNone, + NSCollectionLayoutSectionOrthogonalScrollingBehaviorPaging, + NSCollectionLayoutSectionVisibleItemsInvalidationHandler, NSCollectionLayoutSize, + NSCollectionLayoutSpacing, NSCollectionLayoutSupplementaryItem, NSCollectionLayoutVisibleItem, + NSCollectionViewCompositionalLayout, NSCollectionViewCompositionalLayoutConfiguration, + NSCollectionViewCompositionalLayoutSectionProvider, NSDirectionalEdgeInsets, + NSDirectionalEdgeInsetsZero, NSDirectionalRectEdge, NSDirectionalRectEdgeAll, + NSDirectionalRectEdgeBottom, NSDirectionalRectEdgeLeading, NSDirectionalRectEdgeNone, + NSDirectionalRectEdgeTop, NSDirectionalRectEdgeTrailing, NSRectAlignment, + NSRectAlignmentBottom, NSRectAlignmentBottomLeading, NSRectAlignmentBottomTrailing, + NSRectAlignmentLeading, NSRectAlignmentNone, NSRectAlignmentTop, NSRectAlignmentTopLeading, + NSRectAlignmentTopTrailing, NSRectAlignmentTrailing, +}; +pub use self::__NSCollectionViewFlowLayout::{ + NSCollectionElementKindSectionFooter, NSCollectionElementKindSectionHeader, + NSCollectionViewDelegateFlowLayout, NSCollectionViewFlowLayout, + NSCollectionViewFlowLayoutInvalidationContext, NSCollectionViewScrollDirection, + NSCollectionViewScrollDirectionHorizontal, NSCollectionViewScrollDirectionVertical, +}; +pub use self::__NSCollectionViewGridLayout::NSCollectionViewGridLayout; +pub use self::__NSCollectionViewLayout::{ + NSCollectionElementCategory, NSCollectionElementCategoryDecorationView, + NSCollectionElementCategoryInterItemGap, NSCollectionElementCategoryItem, + NSCollectionElementCategorySupplementaryView, NSCollectionElementKindInterItemGapIndicator, + NSCollectionUpdateAction, NSCollectionUpdateActionDelete, NSCollectionUpdateActionInsert, + NSCollectionUpdateActionMove, NSCollectionUpdateActionNone, NSCollectionUpdateActionReload, + NSCollectionViewDecorationElementKind, NSCollectionViewLayout, + NSCollectionViewLayoutAttributes, NSCollectionViewLayoutInvalidationContext, + NSCollectionViewUpdateItem, +}; +pub use self::__NSCollectionViewTransitionLayout::{ + NSCollectionViewTransitionLayout, NSCollectionViewTransitionLayoutAnimatedKey, +}; +pub use self::__NSColor::{ + NSAppKitVersionNumberWithPatternColorLeakFix, NSColor, NSColorSystemEffect, + NSColorSystemEffectDeepPressed, NSColorSystemEffectDisabled, NSColorSystemEffectNone, + NSColorSystemEffectPressed, NSColorSystemEffectRollover, NSColorType, NSColorTypeCatalog, + NSColorTypeComponentBased, NSColorTypePattern, NSSystemColorsDidChangeNotification, +}; +pub use self::__NSColorList::{ + NSColorList, NSColorListDidChangeNotification, NSColorListName, NSColorName, +}; +pub use self::__NSColorPanel::{ + NSCMYKModeColorPanel, NSColorChanging, NSColorListModeColorPanel, NSColorPanel, + NSColorPanelAllModesMask, NSColorPanelCMYKModeMask, NSColorPanelColorDidChangeNotification, + NSColorPanelColorListModeMask, NSColorPanelCrayonModeMask, NSColorPanelCustomPaletteModeMask, + NSColorPanelGrayModeMask, NSColorPanelHSBModeMask, NSColorPanelMode, NSColorPanelModeCMYK, + NSColorPanelModeColorList, NSColorPanelModeCrayon, NSColorPanelModeCustomPalette, + NSColorPanelModeGray, NSColorPanelModeHSB, NSColorPanelModeNone, NSColorPanelModeRGB, + NSColorPanelModeWheel, NSColorPanelOptions, NSColorPanelRGBModeMask, NSColorPanelWheelModeMask, + NSCrayonModeColorPanel, NSCustomPaletteModeColorPanel, NSGrayModeColorPanel, + NSHSBModeColorPanel, NSNoModeColorPanel, NSRGBModeColorPanel, NSWheelModeColorPanel, +}; +pub use self::__NSColorPicker::NSColorPicker; +pub use self::__NSColorPickerTouchBarItem::NSColorPickerTouchBarItem; +pub use self::__NSColorPicking::{NSColorPickingCustom, NSColorPickingDefault}; +pub use self::__NSColorSampler::NSColorSampler; +pub use self::__NSColorSpace::{ + NSCMYKColorSpaceModel, NSColorSpace, NSColorSpaceModel, NSColorSpaceModelCMYK, + NSColorSpaceModelDeviceN, NSColorSpaceModelGray, NSColorSpaceModelIndexed, + NSColorSpaceModelLAB, NSColorSpaceModelPatterned, NSColorSpaceModelRGB, + NSColorSpaceModelUnknown, NSDeviceNColorSpaceModel, NSGrayColorSpaceModel, + NSIndexedColorSpaceModel, NSLABColorSpaceModel, NSPatternColorSpaceModel, NSRGBColorSpaceModel, + NSUnknownColorSpaceModel, +}; +pub use self::__NSColorWell::NSColorWell; +pub use self::__NSComboBox::{ + NSComboBox, NSComboBoxDataSource, NSComboBoxDelegate, NSComboBoxSelectionDidChangeNotification, + NSComboBoxSelectionIsChangingNotification, NSComboBoxWillDismissNotification, + NSComboBoxWillPopUpNotification, +}; +pub use self::__NSComboBoxCell::{NSComboBoxCell, NSComboBoxCellDataSource}; +pub use self::__NSControl::{ + NSControl, NSControlTextDidBeginEditingNotification, NSControlTextDidChangeNotification, + NSControlTextDidEndEditingNotification, NSControlTextEditingDelegate, +}; +pub use self::__NSController::NSController; +pub use self::__NSCursor::{NSAppKitVersionNumberWithCursorSizeSupport, NSCursor}; +pub use self::__NSCustomImageRep::NSCustomImageRep; +pub use self::__NSCustomTouchBarItem::NSCustomTouchBarItem; +pub use self::__NSDataAsset::{NSDataAsset, NSDataAssetName}; +pub use self::__NSDatePicker::NSDatePicker; +pub use self::__NSDatePickerCell::{ + NSClockAndCalendarDatePickerStyle, NSDatePickerCell, NSDatePickerCellDelegate, + NSDatePickerElementFlagEra, NSDatePickerElementFlagHourMinute, + NSDatePickerElementFlagHourMinuteSecond, NSDatePickerElementFlagTimeZone, + NSDatePickerElementFlagYearMonth, NSDatePickerElementFlagYearMonthDay, + NSDatePickerElementFlags, NSDatePickerMode, NSDatePickerModeRange, NSDatePickerModeSingle, + NSDatePickerStyle, NSDatePickerStyleClockAndCalendar, NSDatePickerStyleTextField, + NSDatePickerStyleTextFieldAndStepper, NSEraDatePickerElementFlag, + NSHourMinuteDatePickerElementFlag, NSHourMinuteSecondDatePickerElementFlag, NSRangeDateMode, + NSSingleDateMode, NSTextFieldAndStepperDatePickerStyle, NSTextFieldDatePickerStyle, + NSTimeZoneDatePickerElementFlag, NSYearMonthDatePickerElementFlag, + NSYearMonthDayDatePickerElementFlag, +}; +pub use self::__NSDictionaryController::{ + NSDictionaryController, NSDictionaryControllerKeyValuePair, +}; +pub use self::__NSDiffableDataSource::{ + NSCollectionViewDiffableDataSource, + NSCollectionViewDiffableDataSourceSupplementaryViewProvider, NSDiffableDataSourceSnapshot, +}; +pub use self::__NSDockTile::{ + NSAppKitVersionNumberWithDockTilePlugInSupport, NSDockTile, NSDockTilePlugIn, +}; +pub use self::__NSDocument::{ + NSAutosaveAsOperation, NSAutosaveElsewhereOperation, NSAutosaveInPlaceOperation, + NSAutosaveOperation, NSChangeAutosaved, NSChangeCleared, NSChangeDiscardable, NSChangeDone, + NSChangeReadOtherContents, NSChangeRedone, NSChangeUndone, NSDocument, NSDocumentChangeType, + NSSaveAsOperation, NSSaveOperation, NSSaveOperationType, NSSaveToOperation, +}; +pub use self::__NSDocumentController::NSDocumentController; +pub use self::__NSDragging::{ + NSDragOperation, NSDragOperationAll, NSDragOperationAll_Obsolete, NSDragOperationCopy, + NSDragOperationDelete, NSDragOperationEvery, NSDragOperationGeneric, NSDragOperationLink, + NSDragOperationMove, NSDragOperationNone, NSDragOperationPrivate, NSDraggingContext, + NSDraggingContextOutsideApplication, NSDraggingContextWithinApplication, NSDraggingDestination, + NSDraggingFormation, NSDraggingFormationDefault, NSDraggingFormationList, + NSDraggingFormationNone, NSDraggingFormationPile, NSDraggingFormationStack, NSDraggingInfo, + NSDraggingItemEnumerationClearNonenumeratedImages, NSDraggingItemEnumerationConcurrent, + NSDraggingItemEnumerationOptions, NSDraggingSource, NSSpringLoadingContinuousActivation, + NSSpringLoadingDestination, NSSpringLoadingDisabled, NSSpringLoadingEnabled, + NSSpringLoadingHighlight, NSSpringLoadingHighlightEmphasized, NSSpringLoadingHighlightNone, + NSSpringLoadingHighlightStandard, NSSpringLoadingNoHover, NSSpringLoadingOptions, +}; +pub use self::__NSDraggingItem::{ + NSDraggingImageComponent, NSDraggingImageComponentIconKey, NSDraggingImageComponentKey, + NSDraggingImageComponentLabelKey, NSDraggingItem, +}; +pub use self::__NSDraggingSession::NSDraggingSession; +pub use self::__NSDrawer::{ + NSDrawer, NSDrawerClosedState, NSDrawerClosingState, NSDrawerDelegate, + NSDrawerDidCloseNotification, NSDrawerDidOpenNotification, NSDrawerOpenState, + NSDrawerOpeningState, NSDrawerState, NSDrawerWillCloseNotification, + NSDrawerWillOpenNotification, +}; +pub use self::__NSEPSImageRep::NSEPSImageRep; +pub use self::__NSErrors::{ + NSAbortModalException, NSAbortPrintingException, NSAccessibilityException, + NSAppKitIgnoredException, NSAppKitVirtualMemoryException, NSBadBitmapParametersException, + NSBadComparisonException, NSBadRTFColorTableException, NSBadRTFDirectiveException, + NSBadRTFFontTableException, NSBadRTFStyleSheetException, NSBrowserIllegalDelegateException, + NSColorListIOException, NSColorListNotEditableException, NSDraggingException, + NSFontUnavailableException, NSIllegalSelectorException, NSImageCacheException, + NSNibLoadingException, NSPPDIncludeNotFoundException, NSPPDIncludeStackOverflowException, + NSPPDIncludeStackUnderflowException, NSPPDParseException, NSPasteboardCommunicationException, + NSPrintPackageException, NSPrintingCommunicationException, NSRTFPropertyStackOverflowException, + NSTIFFException, NSTextLineTooLongException, NSTextNoSelectionException, NSTextReadException, + NSTextWriteException, NSTypedStreamVersionException, NSWindowServerCommunicationException, + NSWordTablesReadException, NSWordTablesWriteException, +}; +pub use self::__NSEvent::{ + NSAWTEventType, NSAlphaShiftKeyMask, NSAlternateKeyMask, NSAppKitDefined, NSAppKitDefinedMask, + NSApplicationActivatedEventType, NSApplicationDeactivatedEventType, NSApplicationDefined, + NSApplicationDefinedMask, NSBeginFunctionKey, NSBreakFunctionKey, NSClearDisplayFunctionKey, + NSClearLineFunctionKey, NSCommandKeyMask, NSControlKeyMask, NSCursorPointingDevice, + NSCursorUpdate, NSCursorUpdateMask, NSDeleteCharFunctionKey, NSDeleteFunctionKey, + NSDeleteLineFunctionKey, NSDeviceIndependentModifierFlagsMask, NSDownArrowFunctionKey, + NSEndFunctionKey, NSEraserPointingDevice, NSEvent, NSEventButtonMask, + NSEventButtonMaskPenLowerSide, NSEventButtonMaskPenTip, NSEventButtonMaskPenUpperSide, + NSEventGestureAxis, NSEventGestureAxisHorizontal, NSEventGestureAxisNone, + NSEventGestureAxisVertical, NSEventMask, NSEventMaskAny, NSEventMaskAppKitDefined, + NSEventMaskApplicationDefined, NSEventMaskBeginGesture, NSEventMaskChangeMode, + NSEventMaskCursorUpdate, NSEventMaskDirectTouch, NSEventMaskEndGesture, + NSEventMaskFlagsChanged, NSEventMaskGesture, NSEventMaskKeyDown, NSEventMaskKeyUp, + NSEventMaskLeftMouseDown, NSEventMaskLeftMouseDragged, NSEventMaskLeftMouseUp, + NSEventMaskMagnify, NSEventMaskMouseEntered, NSEventMaskMouseExited, NSEventMaskMouseMoved, + NSEventMaskOtherMouseDown, NSEventMaskOtherMouseDragged, NSEventMaskOtherMouseUp, + NSEventMaskPeriodic, NSEventMaskPressure, NSEventMaskRightMouseDown, + NSEventMaskRightMouseDragged, NSEventMaskRightMouseUp, NSEventMaskRotate, + NSEventMaskScrollWheel, NSEventMaskSmartMagnify, NSEventMaskSwipe, NSEventMaskSystemDefined, + NSEventMaskTabletPoint, NSEventMaskTabletProximity, NSEventModifierFlagCapsLock, + NSEventModifierFlagCommand, NSEventModifierFlagControl, + NSEventModifierFlagDeviceIndependentFlagsMask, NSEventModifierFlagFunction, + NSEventModifierFlagHelp, NSEventModifierFlagNumericPad, NSEventModifierFlagOption, + NSEventModifierFlagShift, NSEventModifierFlags, NSEventPhase, NSEventPhaseBegan, + NSEventPhaseCancelled, NSEventPhaseChanged, NSEventPhaseEnded, NSEventPhaseMayBegin, + NSEventPhaseNone, NSEventPhaseStationary, NSEventSubtype, NSEventSubtypeApplicationActivated, + NSEventSubtypeApplicationDeactivated, NSEventSubtypeMouseEvent, NSEventSubtypePowerOff, + NSEventSubtypeScreenChanged, NSEventSubtypeTabletPoint, NSEventSubtypeTabletProximity, + NSEventSubtypeTouch, NSEventSubtypeWindowExposed, NSEventSubtypeWindowMoved, + NSEventSwipeTrackingClampGestureAmount, NSEventSwipeTrackingLockDirection, + NSEventSwipeTrackingOptions, NSEventType, NSEventTypeAppKitDefined, + NSEventTypeApplicationDefined, NSEventTypeBeginGesture, NSEventTypeChangeMode, + NSEventTypeCursorUpdate, NSEventTypeDirectTouch, NSEventTypeEndGesture, + NSEventTypeFlagsChanged, NSEventTypeGesture, NSEventTypeKeyDown, NSEventTypeKeyUp, + NSEventTypeLeftMouseDown, NSEventTypeLeftMouseDragged, NSEventTypeLeftMouseUp, + NSEventTypeMagnify, NSEventTypeMouseEntered, NSEventTypeMouseExited, NSEventTypeMouseMoved, + NSEventTypeOtherMouseDown, NSEventTypeOtherMouseDragged, NSEventTypeOtherMouseUp, + NSEventTypePeriodic, NSEventTypePressure, NSEventTypeQuickLook, NSEventTypeRightMouseDown, + NSEventTypeRightMouseDragged, NSEventTypeRightMouseUp, NSEventTypeRotate, + NSEventTypeScrollWheel, NSEventTypeSmartMagnify, NSEventTypeSwipe, NSEventTypeSystemDefined, + NSEventTypeTabletPoint, NSEventTypeTabletProximity, NSExecuteFunctionKey, NSF10FunctionKey, + NSF11FunctionKey, NSF12FunctionKey, NSF13FunctionKey, NSF14FunctionKey, NSF15FunctionKey, + NSF16FunctionKey, NSF17FunctionKey, NSF18FunctionKey, NSF19FunctionKey, NSF1FunctionKey, + NSF20FunctionKey, NSF21FunctionKey, NSF22FunctionKey, NSF23FunctionKey, NSF24FunctionKey, + NSF25FunctionKey, NSF26FunctionKey, NSF27FunctionKey, NSF28FunctionKey, NSF29FunctionKey, + NSF2FunctionKey, NSF30FunctionKey, NSF31FunctionKey, NSF32FunctionKey, NSF33FunctionKey, + NSF34FunctionKey, NSF35FunctionKey, NSF3FunctionKey, NSF4FunctionKey, NSF5FunctionKey, + NSF6FunctionKey, NSF7FunctionKey, NSF8FunctionKey, NSF9FunctionKey, NSFindFunctionKey, + NSFlagsChanged, NSFlagsChangedMask, NSFunctionKeyMask, NSHelpFunctionKey, NSHelpKeyMask, + NSHomeFunctionKey, NSInsertCharFunctionKey, NSInsertFunctionKey, NSInsertLineFunctionKey, + NSKeyDown, NSKeyDownMask, NSKeyUp, NSKeyUpMask, NSLeftArrowFunctionKey, NSLeftMouseDown, + NSLeftMouseDownMask, NSLeftMouseDragged, NSLeftMouseDraggedMask, NSLeftMouseUp, + NSLeftMouseUpMask, NSMenuFunctionKey, NSModeSwitchFunctionKey, NSMouseEntered, + NSMouseEnteredMask, NSMouseEventSubtype, NSMouseExited, NSMouseExitedMask, NSMouseMoved, + NSMouseMovedMask, NSNextFunctionKey, NSNumericPadKeyMask, NSOtherMouseDown, + NSOtherMouseDownMask, NSOtherMouseDragged, NSOtherMouseDraggedMask, NSOtherMouseUp, + NSOtherMouseUpMask, NSPageDownFunctionKey, NSPageUpFunctionKey, NSPauseFunctionKey, + NSPenLowerSideMask, NSPenPointingDevice, NSPenTipMask, NSPenUpperSideMask, NSPeriodic, + NSPeriodicMask, NSPointingDeviceType, NSPointingDeviceTypeCursor, NSPointingDeviceTypeEraser, + NSPointingDeviceTypePen, NSPointingDeviceTypeUnknown, NSPowerOffEventType, NSPressureBehavior, + NSPressureBehaviorPrimaryAccelerator, NSPressureBehaviorPrimaryClick, + NSPressureBehaviorPrimaryDeepClick, NSPressureBehaviorPrimaryDeepDrag, + NSPressureBehaviorPrimaryDefault, NSPressureBehaviorPrimaryGeneric, NSPressureBehaviorUnknown, + NSPrevFunctionKey, NSPrintFunctionKey, NSPrintScreenFunctionKey, NSRedoFunctionKey, + NSResetFunctionKey, NSRightArrowFunctionKey, NSRightMouseDown, NSRightMouseDownMask, + NSRightMouseDragged, NSRightMouseDraggedMask, NSRightMouseUp, NSRightMouseUpMask, + NSScreenChangedEventType, NSScrollLockFunctionKey, NSScrollWheel, NSScrollWheelMask, + NSSelectFunctionKey, NSShiftKeyMask, NSStopFunctionKey, NSSysReqFunctionKey, NSSystemDefined, + NSSystemDefinedMask, NSSystemFunctionKey, NSTabletPoint, NSTabletPointEventSubtype, + NSTabletPointMask, NSTabletProximity, NSTabletProximityEventSubtype, NSTabletProximityMask, + NSTouchEventSubtype, NSUndoFunctionKey, NSUnknownPointingDevice, NSUpArrowFunctionKey, + NSUserFunctionKey, NSWindowExposedEventType, NSWindowMovedEventType, +}; +pub use self::__NSFilePromiseProvider::{NSFilePromiseProvider, NSFilePromiseProviderDelegate}; +pub use self::__NSFilePromiseReceiver::NSFilePromiseReceiver; +pub use self::__NSFont::{ + NSAntialiasThresholdChangedNotification, NSControlGlyph, NSConvertGlyphsToPackedGlyphs, NSFont, + NSFontAntialiasedIntegerAdvancementsRenderingMode, NSFontAntialiasedRenderingMode, + NSFontDefaultRenderingMode, NSFontIdentityMatrix, NSFontIntegerAdvancementsRenderingMode, + NSFontRenderingMode, NSFontSetChangedNotification, NSGlyph, NSMultibyteGlyphPacking, + NSNativeShortGlyphPacking, NSNullGlyph, +}; +pub use self::__NSFontAssetRequest::{ + NSFontAssetRequest, NSFontAssetRequestOptionUsesStandardUI, NSFontAssetRequestOptions, +}; +pub use self::__NSFontCollection::{ + NSFontCollection, NSFontCollectionActionKey, NSFontCollectionActionTypeKey, + NSFontCollectionAllFonts, NSFontCollectionDidChangeNotification, + NSFontCollectionDisallowAutoActivationOption, NSFontCollectionFavorites, + NSFontCollectionIncludeDisabledFontsOption, NSFontCollectionMatchingOptionKey, + NSFontCollectionName, NSFontCollectionNameKey, NSFontCollectionOldNameKey, + NSFontCollectionRecentlyUsed, NSFontCollectionRemoveDuplicatesOption, NSFontCollectionUser, + NSFontCollectionUserInfoKey, NSFontCollectionVisibility, NSFontCollectionVisibilityComputer, + NSFontCollectionVisibilityKey, NSFontCollectionVisibilityProcess, + NSFontCollectionVisibilityUser, NSFontCollectionWasHidden, NSFontCollectionWasRenamed, + NSFontCollectionWasShown, NSMutableFontCollection, +}; +pub use self::__NSFontDescriptor::{ + NSFontBoldTrait, NSFontCascadeListAttribute, NSFontCharacterSetAttribute, + NSFontClarendonSerifsClass, NSFontColorAttribute, NSFontCondensedTrait, NSFontDescriptor, + NSFontDescriptorAttributeName, NSFontDescriptorClassClarendonSerifs, + NSFontDescriptorClassFreeformSerifs, NSFontDescriptorClassMask, + NSFontDescriptorClassModernSerifs, NSFontDescriptorClassOldStyleSerifs, + NSFontDescriptorClassOrnamentals, NSFontDescriptorClassSansSerif, NSFontDescriptorClassScripts, + NSFontDescriptorClassSlabSerifs, NSFontDescriptorClassSymbolic, + NSFontDescriptorClassTransitionalSerifs, NSFontDescriptorClassUnknown, + NSFontDescriptorFeatureKey, NSFontDescriptorSymbolicTraits, NSFontDescriptorSystemDesign, + NSFontDescriptorSystemDesignDefault, NSFontDescriptorSystemDesignMonospaced, + NSFontDescriptorSystemDesignRounded, NSFontDescriptorSystemDesignSerif, + NSFontDescriptorTraitBold, NSFontDescriptorTraitCondensed, NSFontDescriptorTraitEmphasized, + NSFontDescriptorTraitExpanded, NSFontDescriptorTraitItalic, NSFontDescriptorTraitKey, + NSFontDescriptorTraitLooseLeading, NSFontDescriptorTraitMonoSpace, + NSFontDescriptorTraitTightLeading, NSFontDescriptorTraitUIOptimized, + NSFontDescriptorTraitVertical, NSFontDescriptorVariationKey, NSFontExpandedTrait, + NSFontFaceAttribute, NSFontFamilyAttribute, NSFontFamilyClass, NSFontFamilyClassMask, + NSFontFeatureSelectorIdentifierKey, NSFontFeatureSettingsAttribute, + NSFontFeatureTypeIdentifierKey, NSFontFixedAdvanceAttribute, NSFontFreeformSerifsClass, + NSFontItalicTrait, NSFontMatrixAttribute, NSFontModernSerifsClass, NSFontMonoSpaceTrait, + NSFontNameAttribute, NSFontOldStyleSerifsClass, NSFontOrnamentalsClass, NSFontSansSerifClass, + NSFontScriptsClass, NSFontSizeAttribute, NSFontSlabSerifsClass, NSFontSlantTrait, + NSFontSymbolicClass, NSFontSymbolicTrait, NSFontSymbolicTraits, NSFontTextStyle, + NSFontTextStyleBody, NSFontTextStyleCallout, NSFontTextStyleCaption1, NSFontTextStyleCaption2, + NSFontTextStyleFootnote, NSFontTextStyleHeadline, NSFontTextStyleLargeTitle, + NSFontTextStyleOptionKey, NSFontTextStyleSubheadline, NSFontTextStyleTitle1, + NSFontTextStyleTitle2, NSFontTextStyleTitle3, NSFontTraitsAttribute, + NSFontTransitionalSerifsClass, NSFontUIOptimizedTrait, NSFontUnknownClass, + NSFontVariationAttribute, NSFontVariationAxisDefaultValueKey, NSFontVariationAxisIdentifierKey, + NSFontVariationAxisMaximumValueKey, NSFontVariationAxisMinimumValueKey, + NSFontVariationAxisNameKey, NSFontVerticalTrait, NSFontVisibleNameAttribute, NSFontWeight, + NSFontWeightBlack, NSFontWeightBold, NSFontWeightHeavy, NSFontWeightLight, NSFontWeightMedium, + NSFontWeightRegular, NSFontWeightSemibold, NSFontWeightThin, NSFontWeightTrait, + NSFontWeightUltraLight, NSFontWidthTrait, +}; +pub use self::__NSFontManager::{ + NSAddTraitFontAction, NSBoldFontMask, NSCompressedFontMask, NSCondensedFontMask, + NSExpandedFontMask, NSFixedPitchFontMask, NSFontAction, NSFontCollectionApplicationOnlyMask, + NSFontCollectionOptions, NSFontManager, NSFontTraitMask, NSHeavierFontAction, NSItalicFontMask, + NSLighterFontAction, NSNarrowFontMask, NSNoFontChangeAction, NSNonStandardCharacterSetFontMask, + NSPosterFontMask, NSRemoveTraitFontAction, NSSizeDownFontAction, NSSizeUpFontAction, + NSSmallCapsFontMask, NSUnboldFontMask, NSUnitalicFontMask, NSViaPanelFontAction, +}; +pub use self::__NSFontPanel::{ + NSFPCurrentField, NSFPPreviewButton, NSFPPreviewField, NSFPRevertButton, NSFPSetButton, + NSFPSizeField, NSFPSizeTitle, NSFontChanging, NSFontPanel, NSFontPanelAllEffectsModeMask, + NSFontPanelAllModesMask, NSFontPanelCollectionModeMask, NSFontPanelDocumentColorEffectModeMask, + NSFontPanelFaceModeMask, NSFontPanelModeMask, NSFontPanelModeMaskAllEffects, + NSFontPanelModeMaskCollection, NSFontPanelModeMaskDocumentColorEffect, NSFontPanelModeMaskFace, + NSFontPanelModeMaskShadowEffect, NSFontPanelModeMaskSize, + NSFontPanelModeMaskStrikethroughEffect, NSFontPanelModeMaskTextColorEffect, + NSFontPanelModeMaskUnderlineEffect, NSFontPanelModesMaskAllModes, + NSFontPanelModesMaskStandardModes, NSFontPanelShadowEffectModeMask, NSFontPanelSizeModeMask, + NSFontPanelStandardModesMask, NSFontPanelStrikethroughEffectModeMask, + NSFontPanelTextColorEffectModeMask, NSFontPanelUnderlineEffectModeMask, +}; +pub use self::__NSForm::NSForm; +pub use self::__NSFormCell::NSFormCell; +pub use self::__NSGestureRecognizer::{ + NSGestureRecognizer, NSGestureRecognizerDelegate, NSGestureRecognizerState, + NSGestureRecognizerStateBegan, NSGestureRecognizerStateCancelled, + NSGestureRecognizerStateChanged, NSGestureRecognizerStateEnded, NSGestureRecognizerStateFailed, + NSGestureRecognizerStatePossible, NSGestureRecognizerStateRecognized, +}; +pub use self::__NSGlyphGenerator::{ + NSGlyphGenerator, NSGlyphStorage, NSShowControlGlyphs, NSShowInvisibleGlyphs, NSWantsBidiLevels, +}; +pub use self::__NSGlyphInfo::{ + NSAdobeCNS1CharacterCollection, NSAdobeGB1CharacterCollection, + NSAdobeJapan1CharacterCollection, NSAdobeJapan2CharacterCollection, + NSAdobeKorea1CharacterCollection, NSCharacterCollection, NSGlyphInfo, + NSIdentityMappingCharacterCollection, +}; +pub use self::__NSGradient::{ + NSGradient, NSGradientDrawingOptions, NSGradientDrawsAfterEndingLocation, + NSGradientDrawsBeforeStartingLocation, +}; +pub use self::__NSGraphics::{ + NSAnimationEffect, NSAnimationEffectDisappearingItemDefault, NSAnimationEffectPoof, + NSAvailableWindowDepths, NSBackingStoreBuffered, NSBackingStoreNonretained, + NSBackingStoreRetained, NSBackingStoreType, NSBeep, NSBestDepth, NSBitsPerPixelFromDepth, + NSBitsPerSampleFromDepth, NSBlack, NSCalibratedBlackColorSpace, NSCalibratedRGBColorSpace, + NSCalibratedWhiteColorSpace, NSColorRenderingIntent, + NSColorRenderingIntentAbsoluteColorimetric, NSColorRenderingIntentDefault, + NSColorRenderingIntentPerceptual, NSColorRenderingIntentRelativeColorimetric, + NSColorRenderingIntentSaturation, NSColorSpaceFromDepth, NSColorSpaceName, NSCompositeClear, + NSCompositeColor, NSCompositeColorBurn, NSCompositeColorDodge, NSCompositeCopy, + NSCompositeDarken, NSCompositeDestinationAtop, NSCompositeDestinationIn, + NSCompositeDestinationOut, NSCompositeDestinationOver, NSCompositeDifference, + NSCompositeExclusion, NSCompositeHardLight, NSCompositeHighlight, NSCompositeHue, + NSCompositeLighten, NSCompositeLuminosity, NSCompositeMultiply, NSCompositeOverlay, + NSCompositePlusDarker, NSCompositePlusLighter, NSCompositeSaturation, NSCompositeScreen, + NSCompositeSoftLight, NSCompositeSourceAtop, NSCompositeSourceIn, NSCompositeSourceOut, + NSCompositeSourceOver, NSCompositeXOR, NSCompositingOperation, NSCompositingOperationClear, + NSCompositingOperationColor, NSCompositingOperationColorBurn, NSCompositingOperationColorDodge, + NSCompositingOperationCopy, NSCompositingOperationDarken, + NSCompositingOperationDestinationAtop, NSCompositingOperationDestinationIn, + NSCompositingOperationDestinationOut, NSCompositingOperationDestinationOver, + NSCompositingOperationDifference, NSCompositingOperationExclusion, + NSCompositingOperationHardLight, NSCompositingOperationHighlight, NSCompositingOperationHue, + NSCompositingOperationLighten, NSCompositingOperationLuminosity, + NSCompositingOperationMultiply, NSCompositingOperationOverlay, + NSCompositingOperationPlusDarker, NSCompositingOperationPlusLighter, + NSCompositingOperationSaturation, NSCompositingOperationScreen, + NSCompositingOperationSoftLight, NSCompositingOperationSourceAtop, + NSCompositingOperationSourceIn, NSCompositingOperationSourceOut, + NSCompositingOperationSourceOver, NSCompositingOperationXOR, NSCopyBits, NSCountWindows, + NSCountWindowsForContext, NSCustomColorSpace, NSDarkGray, NSDeviceBitsPerSample, + NSDeviceBlackColorSpace, NSDeviceCMYKColorSpace, NSDeviceColorSpaceName, + NSDeviceDescriptionKey, NSDeviceIsPrinter, NSDeviceIsScreen, NSDeviceRGBColorSpace, + NSDeviceResolution, NSDeviceSize, NSDeviceWhiteColorSpace, NSDisableScreenUpdates, + NSDisplayGamut, NSDisplayGamutP3, NSDisplayGamutSRGB, NSDottedFrameRect, NSDrawBitmap, + NSDrawButton, NSDrawColorTiledRects, NSDrawDarkBezel, NSDrawGrayBezel, NSDrawGroove, + NSDrawLightBezel, NSDrawTiledRects, NSDrawWhiteBezel, NSDrawWindowBackground, + NSEnableScreenUpdates, NSEraseRect, NSFocusRingAbove, NSFocusRingBelow, NSFocusRingOnly, + NSFocusRingPlacement, NSFocusRingType, NSFocusRingTypeDefault, NSFocusRingTypeExterior, + NSFocusRingTypeNone, NSFrameRect, NSFrameRectWithWidth, NSFrameRectWithWidthUsingOperation, + NSGetWindowServerMemory, NSHighlightRect, NSLightGray, NSNamedColorSpace, + NSNumberOfColorComponents, NSPatternColorSpace, NSPlanarFromDepth, NSReadPixel, NSRectClip, + NSRectClipList, NSRectFill, NSRectFillList, NSRectFillListUsingOperation, + NSRectFillListWithColors, NSRectFillListWithColorsUsingOperation, NSRectFillListWithGrays, + NSRectFillUsingOperation, NSSetFocusRingStyle, NSShowAnimationEffect, NSWhite, NSWindowAbove, + NSWindowBelow, NSWindowDepth, NSWindowDepthOnehundredtwentyeightBitRGB, + NSWindowDepthSixtyfourBitRGB, NSWindowDepthTwentyfourBitRGB, NSWindowList, + NSWindowListForContext, NSWindowOrderingMode, NSWindowOut, +}; +pub use self::__NSGraphicsContext::{ + NSGraphicsContext, NSGraphicsContextAttributeKey, NSGraphicsContextDestinationAttributeName, + NSGraphicsContextPDFFormat, NSGraphicsContextPSFormat, + NSGraphicsContextRepresentationFormatAttributeName, NSGraphicsContextRepresentationFormatName, + NSImageInterpolation, NSImageInterpolationDefault, NSImageInterpolationHigh, + NSImageInterpolationLow, NSImageInterpolationMedium, NSImageInterpolationNone, +}; +pub use self::__NSGridView::{ + NSGridCell, NSGridCellPlacement, NSGridCellPlacementBottom, NSGridCellPlacementCenter, + NSGridCellPlacementFill, NSGridCellPlacementInherited, NSGridCellPlacementLeading, + NSGridCellPlacementNone, NSGridCellPlacementTop, NSGridCellPlacementTrailing, NSGridColumn, + NSGridRow, NSGridRowAlignment, NSGridRowAlignmentFirstBaseline, NSGridRowAlignmentInherited, + NSGridRowAlignmentLastBaseline, NSGridRowAlignmentNone, NSGridView, NSGridViewSizeForContent, +}; +pub use self::__NSGroupTouchBarItem::NSGroupTouchBarItem; +pub use self::__NSHapticFeedback::{ + NSHapticFeedbackManager, NSHapticFeedbackPattern, NSHapticFeedbackPatternAlignment, + NSHapticFeedbackPatternGeneric, NSHapticFeedbackPatternLevelChange, + NSHapticFeedbackPerformanceTime, NSHapticFeedbackPerformanceTimeDefault, + NSHapticFeedbackPerformanceTimeDrawCompleted, NSHapticFeedbackPerformanceTimeNow, + NSHapticFeedbackPerformer, +}; +pub use self::__NSHelpManager::{ + NSContextHelpModeDidActivateNotification, NSContextHelpModeDidDeactivateNotification, + NSHelpAnchorName, NSHelpBookName, NSHelpManager, NSHelpManagerContextHelpKey, +}; +pub use self::__NSImage::{ + NSImage, NSImageCacheAlways, NSImageCacheBySize, NSImageCacheDefault, NSImageCacheMode, + NSImageCacheNever, NSImageDelegate, NSImageHintCTM, NSImageHintInterpolation, + NSImageHintUserInterfaceLayoutDirection, NSImageLoadStatus, NSImageLoadStatusCancelled, + NSImageLoadStatusCompleted, NSImageLoadStatusInvalidData, NSImageLoadStatusReadError, + NSImageLoadStatusUnexpectedEOF, NSImageName, NSImageNameActionTemplate, NSImageNameAddTemplate, + NSImageNameAdvanced, NSImageNameApplicationIcon, NSImageNameBluetoothTemplate, + NSImageNameBonjour, NSImageNameBookmarksTemplate, NSImageNameCaution, NSImageNameColorPanel, + NSImageNameColumnViewTemplate, NSImageNameComputer, NSImageNameDotMac, + NSImageNameEnterFullScreenTemplate, NSImageNameEveryone, NSImageNameExitFullScreenTemplate, + NSImageNameFlowViewTemplate, NSImageNameFolder, NSImageNameFolderBurnable, + NSImageNameFolderSmart, NSImageNameFollowLinkFreestandingTemplate, NSImageNameFontPanel, + NSImageNameGoBackTemplate, NSImageNameGoForwardTemplate, NSImageNameGoLeftTemplate, + NSImageNameGoRightTemplate, NSImageNameHomeTemplate, NSImageNameIChatTheaterTemplate, + NSImageNameIconViewTemplate, NSImageNameInfo, NSImageNameInvalidDataFreestandingTemplate, + NSImageNameLeftFacingTriangleTemplate, NSImageNameListViewTemplate, + NSImageNameLockLockedTemplate, NSImageNameLockUnlockedTemplate, + NSImageNameMenuMixedStateTemplate, NSImageNameMenuOnStateTemplate, NSImageNameMobileMe, + NSImageNameMultipleDocuments, NSImageNameNetwork, NSImageNamePathTemplate, + NSImageNamePreferencesGeneral, NSImageNameQuickLookTemplate, + NSImageNameRefreshFreestandingTemplate, NSImageNameRefreshTemplate, NSImageNameRemoveTemplate, + NSImageNameRevealFreestandingTemplate, NSImageNameRightFacingTriangleTemplate, + NSImageNameShareTemplate, NSImageNameSlideshowTemplate, NSImageNameSmartBadgeTemplate, + NSImageNameStatusAvailable, NSImageNameStatusNone, NSImageNameStatusPartiallyAvailable, + NSImageNameStatusUnavailable, NSImageNameStopProgressFreestandingTemplate, + NSImageNameStopProgressTemplate, NSImageNameTouchBarAddDetailTemplate, + NSImageNameTouchBarAddTemplate, NSImageNameTouchBarAlarmTemplate, + NSImageNameTouchBarAudioInputMuteTemplate, NSImageNameTouchBarAudioInputTemplate, + NSImageNameTouchBarAudioOutputMuteTemplate, NSImageNameTouchBarAudioOutputVolumeHighTemplate, + NSImageNameTouchBarAudioOutputVolumeLowTemplate, + NSImageNameTouchBarAudioOutputVolumeMediumTemplate, + NSImageNameTouchBarAudioOutputVolumeOffTemplate, NSImageNameTouchBarBookmarksTemplate, + NSImageNameTouchBarColorPickerFill, NSImageNameTouchBarColorPickerFont, + NSImageNameTouchBarColorPickerStroke, NSImageNameTouchBarCommunicationAudioTemplate, + NSImageNameTouchBarCommunicationVideoTemplate, NSImageNameTouchBarComposeTemplate, + NSImageNameTouchBarDeleteTemplate, NSImageNameTouchBarDownloadTemplate, + NSImageNameTouchBarEnterFullScreenTemplate, NSImageNameTouchBarExitFullScreenTemplate, + NSImageNameTouchBarFastForwardTemplate, NSImageNameTouchBarFolderCopyToTemplate, + NSImageNameTouchBarFolderMoveToTemplate, NSImageNameTouchBarFolderTemplate, + NSImageNameTouchBarGetInfoTemplate, NSImageNameTouchBarGoBackTemplate, + NSImageNameTouchBarGoDownTemplate, NSImageNameTouchBarGoForwardTemplate, + NSImageNameTouchBarGoUpTemplate, NSImageNameTouchBarHistoryTemplate, + NSImageNameTouchBarIconViewTemplate, NSImageNameTouchBarListViewTemplate, + NSImageNameTouchBarMailTemplate, NSImageNameTouchBarNewFolderTemplate, + NSImageNameTouchBarNewMessageTemplate, NSImageNameTouchBarOpenInBrowserTemplate, + NSImageNameTouchBarPauseTemplate, NSImageNameTouchBarPlayPauseTemplate, + NSImageNameTouchBarPlayTemplate, NSImageNameTouchBarPlayheadTemplate, + NSImageNameTouchBarQuickLookTemplate, NSImageNameTouchBarRecordStartTemplate, + NSImageNameTouchBarRecordStopTemplate, NSImageNameTouchBarRefreshTemplate, + NSImageNameTouchBarRemoveTemplate, NSImageNameTouchBarRewindTemplate, + NSImageNameTouchBarRotateLeftTemplate, NSImageNameTouchBarRotateRightTemplate, + NSImageNameTouchBarSearchTemplate, NSImageNameTouchBarShareTemplate, + NSImageNameTouchBarSidebarTemplate, NSImageNameTouchBarSkipAhead15SecondsTemplate, + NSImageNameTouchBarSkipAhead30SecondsTemplate, NSImageNameTouchBarSkipAheadTemplate, + NSImageNameTouchBarSkipBack15SecondsTemplate, NSImageNameTouchBarSkipBack30SecondsTemplate, + NSImageNameTouchBarSkipBackTemplate, NSImageNameTouchBarSkipToEndTemplate, + NSImageNameTouchBarSkipToStartTemplate, NSImageNameTouchBarSlideshowTemplate, + NSImageNameTouchBarTagIconTemplate, NSImageNameTouchBarTextBoldTemplate, + NSImageNameTouchBarTextBoxTemplate, NSImageNameTouchBarTextCenterAlignTemplate, + NSImageNameTouchBarTextItalicTemplate, NSImageNameTouchBarTextJustifiedAlignTemplate, + NSImageNameTouchBarTextLeftAlignTemplate, NSImageNameTouchBarTextListTemplate, + NSImageNameTouchBarTextRightAlignTemplate, NSImageNameTouchBarTextStrikethroughTemplate, + NSImageNameTouchBarTextUnderlineTemplate, NSImageNameTouchBarUserAddTemplate, + NSImageNameTouchBarUserGroupTemplate, NSImageNameTouchBarUserTemplate, + NSImageNameTouchBarVolumeDownTemplate, NSImageNameTouchBarVolumeUpTemplate, + NSImageNameTrashEmpty, NSImageNameTrashFull, NSImageNameUser, NSImageNameUserAccounts, + NSImageNameUserGroup, NSImageNameUserGuest, NSImageResizingMode, NSImageResizingModeStretch, + NSImageResizingModeTile, NSImageSymbolConfiguration, NSImageSymbolScale, + NSImageSymbolScaleLarge, NSImageSymbolScaleMedium, NSImageSymbolScaleSmall, +}; +pub use self::__NSImageCell::{ + NSImageAlignBottom, NSImageAlignBottomLeft, NSImageAlignBottomRight, NSImageAlignCenter, + NSImageAlignLeft, NSImageAlignRight, NSImageAlignTop, NSImageAlignTopLeft, + NSImageAlignTopRight, NSImageAlignment, NSImageCell, NSImageFrameButton, NSImageFrameGrayBezel, + NSImageFrameGroove, NSImageFrameNone, NSImageFramePhoto, NSImageFrameStyle, +}; +pub use self::__NSImageRep::{ + NSImageHintKey, NSImageLayoutDirection, NSImageLayoutDirectionLeftToRight, + NSImageLayoutDirectionRightToLeft, NSImageLayoutDirectionUnspecified, NSImageRep, + NSImageRepMatchesDevice, NSImageRepRegistryDidChangeNotification, +}; +pub use self::__NSImageView::NSImageView; +pub use self::__NSInputManager::{NSInputManager, NSTextInput}; +pub use self::__NSInputServer::{NSInputServer, NSInputServerMouseTracker, NSInputServiceProvider}; +pub use self::__NSInterfaceStyle::{ + NSInterfaceStyle, NSInterfaceStyleDefault, NSInterfaceStyleForKey, NSMacintoshInterfaceStyle, + NSNextStepInterfaceStyle, NSNoInterfaceStyle, NSWindows95InterfaceStyle, +}; +pub use self::__NSItemProvider::{ + NSTypeIdentifierAddressText, NSTypeIdentifierDateText, NSTypeIdentifierPhoneNumberText, + NSTypeIdentifierTransitInformationText, +}; +pub use self::__NSKeyValueBinding::{ + NSAlignmentBinding, NSAllowsEditingMultipleValuesSelectionBindingOption, + NSAllowsNullArgumentBindingOption, NSAlternateImageBinding, NSAlternateTitleBinding, + NSAlwaysPresentsApplicationModalAlertsBindingOption, NSAnimateBinding, NSAnimationDelayBinding, + NSArgumentBinding, NSAttributedStringBinding, NSBindingInfoKey, NSBindingName, NSBindingOption, + NSBindingSelectionMarker, NSConditionallySetsEditableBindingOption, + NSConditionallySetsEnabledBindingOption, NSConditionallySetsHiddenBindingOption, + NSContentArrayBinding, NSContentArrayForMultipleSelectionBinding, NSContentBinding, + NSContentDictionaryBinding, NSContentHeightBinding, NSContentObjectBinding, + NSContentObjectsBinding, NSContentPlacementTagBindingOption, NSContentSetBinding, + NSContentValuesBinding, NSContentWidthBinding, NSContinuouslyUpdatesValueBindingOption, + NSCreatesSortDescriptorBindingOption, NSCriticalValueBinding, NSDataBinding, + NSDeletesObjectsOnRemoveBindingsOption, NSDisplayNameBindingOption, + NSDisplayPatternBindingOption, NSDisplayPatternTitleBinding, NSDisplayPatternValueBinding, + NSDocumentEditedBinding, NSDoubleClickArgumentBinding, NSDoubleClickTargetBinding, + NSEditableBinding, NSEditor, NSEditorRegistration, NSEnabledBinding, NSExcludedKeysBinding, + NSFilterPredicateBinding, NSFontBinding, NSFontBoldBinding, NSFontFamilyNameBinding, + NSFontItalicBinding, NSFontNameBinding, NSFontSizeBinding, + NSHandlesContentAsCompoundValueBindingOption, NSHeaderTitleBinding, NSHiddenBinding, + NSImageBinding, NSIncludedKeysBinding, NSInitialKeyBinding, NSInitialValueBinding, + NSInsertsNullPlaceholderBindingOption, NSInvokesSeparatelyWithArrayObjectsBindingOption, + NSIsControllerMarker, NSIsIndeterminateBinding, NSLabelBinding, + NSLocalizedKeyDictionaryBinding, NSManagedObjectContextBinding, NSMaxValueBinding, + NSMaxWidthBinding, NSMaximumRecentsBinding, NSMinValueBinding, NSMinWidthBinding, + NSMixedStateImageBinding, NSMultipleValuesMarker, NSMultipleValuesPlaceholderBindingOption, + NSNoSelectionMarker, NSNoSelectionPlaceholderBindingOption, NSNotApplicableMarker, + NSNotApplicablePlaceholderBindingOption, NSNullPlaceholderBindingOption, NSObservedKeyPathKey, + NSObservedObjectKey, NSOffStateImageBinding, NSOnStateImageBinding, NSOptionsKey, + NSPositioningRectBinding, NSPredicateBinding, NSPredicateFormatBindingOption, + NSRaisesForNotApplicableKeysBindingOption, NSRecentSearchesBinding, + NSRepresentedFilenameBinding, NSRowHeightBinding, NSSelectedIdentifierBinding, + NSSelectedIndexBinding, NSSelectedLabelBinding, NSSelectedObjectBinding, + NSSelectedObjectsBinding, NSSelectedTagBinding, NSSelectedValueBinding, + NSSelectedValuesBinding, NSSelectionIndexPathsBinding, NSSelectionIndexesBinding, + NSSelectorNameBindingOption, NSSelectsAllWhenSettingContentBindingOption, + NSSortDescriptorsBinding, NSTargetBinding, NSTextColorBinding, NSTitleBinding, + NSToolTipBinding, NSTransparentBinding, NSValidatesImmediatelyBindingOption, NSValueBinding, + NSValuePathBinding, NSValueTransformerBindingOption, NSValueTransformerNameBindingOption, + NSValueURLBinding, NSVisibleBinding, NSWarningValueBinding, NSWidthBinding, +}; +pub use self::__NSLayoutAnchor::{ + NSLayoutAnchor, NSLayoutDimension, NSLayoutXAxisAnchor, NSLayoutYAxisAnchor, +}; +pub use self::__NSLayoutConstraint::{ + NSLayoutAttribute, NSLayoutAttributeBaseline, NSLayoutAttributeBottom, + NSLayoutAttributeCenterX, NSLayoutAttributeCenterY, NSLayoutAttributeFirstBaseline, + NSLayoutAttributeHeight, NSLayoutAttributeLastBaseline, NSLayoutAttributeLeading, + NSLayoutAttributeLeft, NSLayoutAttributeNotAnAttribute, NSLayoutAttributeRight, + NSLayoutAttributeTop, NSLayoutAttributeTrailing, NSLayoutAttributeWidth, NSLayoutConstraint, + NSLayoutConstraintOrientation, NSLayoutConstraintOrientationHorizontal, + NSLayoutConstraintOrientationVertical, NSLayoutFormatAlignAllBaseline, + NSLayoutFormatAlignAllBottom, NSLayoutFormatAlignAllCenterX, NSLayoutFormatAlignAllCenterY, + NSLayoutFormatAlignAllFirstBaseline, NSLayoutFormatAlignAllLastBaseline, + NSLayoutFormatAlignAllLeading, NSLayoutFormatAlignAllLeft, NSLayoutFormatAlignAllRight, + NSLayoutFormatAlignAllTop, NSLayoutFormatAlignAllTrailing, NSLayoutFormatAlignmentMask, + NSLayoutFormatDirectionLeadingToTrailing, NSLayoutFormatDirectionLeftToRight, + NSLayoutFormatDirectionMask, NSLayoutFormatDirectionRightToLeft, NSLayoutFormatOptions, + NSLayoutPriority, NSLayoutPriorityDefaultHigh, NSLayoutPriorityDefaultLow, + NSLayoutPriorityDragThatCanResizeWindow, NSLayoutPriorityDragThatCannotResizeWindow, + NSLayoutPriorityFittingSizeCompression, NSLayoutPriorityRequired, + NSLayoutPriorityWindowSizeStayPut, NSLayoutRelation, NSLayoutRelationEqual, + NSLayoutRelationGreaterThanOrEqual, NSLayoutRelationLessThanOrEqual, NSViewNoInstrinsicMetric, + NSViewNoIntrinsicMetric, +}; +pub use self::__NSLayoutGuide::NSLayoutGuide; +pub use self::__NSLayoutManager::{ + NSControlCharacterAction, NSControlCharacterActionContainerBreak, + NSControlCharacterActionHorizontalTab, NSControlCharacterActionLineBreak, + NSControlCharacterActionParagraphBreak, NSControlCharacterActionWhitespace, + NSControlCharacterActionZeroAdvancement, NSGlyphAttributeBidiLevel, NSGlyphAttributeElastic, + NSGlyphAttributeInscribe, NSGlyphAttributeSoft, NSGlyphInscribeAbove, NSGlyphInscribeBase, + NSGlyphInscribeBelow, NSGlyphInscribeOverBelow, NSGlyphInscribeOverstrike, NSGlyphInscription, + NSGlyphProperty, NSGlyphPropertyControlCharacter, NSGlyphPropertyElastic, + NSGlyphPropertyNonBaseCharacter, NSGlyphPropertyNull, NSLayoutManager, NSLayoutManagerDelegate, + NSTextLayoutOrientation, NSTextLayoutOrientationHorizontal, NSTextLayoutOrientationProvider, + NSTextLayoutOrientationVertical, NSTypesetterBehavior, NSTypesetterBehavior_10_2, + NSTypesetterBehavior_10_2_WithCompatibility, NSTypesetterBehavior_10_3, + NSTypesetterBehavior_10_4, NSTypesetterLatestBehavior, NSTypesetterOriginalBehavior, +}; +pub use self::__NSLevelIndicator::{ + NSLevelIndicator, NSLevelIndicatorPlaceholderVisibility, + NSLevelIndicatorPlaceholderVisibilityAlways, NSLevelIndicatorPlaceholderVisibilityAutomatic, + NSLevelIndicatorPlaceholderVisibilityWhileEditing, +}; +pub use self::__NSLevelIndicatorCell::{ + NSContinuousCapacityLevelIndicatorStyle, NSDiscreteCapacityLevelIndicatorStyle, + NSLevelIndicatorCell, NSLevelIndicatorStyle, NSLevelIndicatorStyleContinuousCapacity, + NSLevelIndicatorStyleDiscreteCapacity, NSLevelIndicatorStyleRating, + NSLevelIndicatorStyleRelevancy, NSRatingLevelIndicatorStyle, NSRelevancyLevelIndicatorStyle, +}; +pub use self::__NSMagnificationGestureRecognizer::NSMagnificationGestureRecognizer; +pub use self::__NSMatrix::{ + NSHighlightModeMatrix, NSListModeMatrix, NSMatrix, NSMatrixDelegate, NSMatrixMode, + NSRadioModeMatrix, NSTrackModeMatrix, +}; +pub use self::__NSMediaLibraryBrowserController::{ + NSMediaLibrary, NSMediaLibraryAudio, NSMediaLibraryBrowserController, NSMediaLibraryImage, + NSMediaLibraryMovie, +}; +pub use self::__NSMenu::{ + NSMenu, NSMenuDelegate, NSMenuDidAddItemNotification, NSMenuDidBeginTrackingNotification, + NSMenuDidChangeItemNotification, NSMenuDidEndTrackingNotification, + NSMenuDidRemoveItemNotification, NSMenuDidSendActionNotification, NSMenuItemValidation, + NSMenuProperties, NSMenuPropertyItemAccessibilityDescription, + NSMenuPropertyItemAttributedTitle, NSMenuPropertyItemEnabled, NSMenuPropertyItemImage, + NSMenuPropertyItemKeyEquivalent, NSMenuPropertyItemTitle, NSMenuWillSendActionNotification, +}; +pub use self::__NSMenuItem::{NSMenuItem, NSMenuItemImportFromDeviceIdentifier}; +pub use self::__NSMenuItemCell::NSMenuItemCell; +pub use self::__NSMenuToolbarItem::NSMenuToolbarItem; +pub use self::__NSMovie::NSMovie; +pub use self::__NSNib::{NSNib, NSNibName, NSNibOwner, NSNibTopLevelObjects}; +pub use self::__NSObjectController::NSObjectController; +pub use self::__NSOpenGL::{ + NSOpenGLCPCurrentRendererID, NSOpenGLCPGPUFragmentProcessing, NSOpenGLCPGPUVertexProcessing, + NSOpenGLCPHasDrawable, NSOpenGLCPMPSwapsInFlight, NSOpenGLCPRasterizationEnable, + NSOpenGLCPReclaimResources, NSOpenGLCPStateValidation, NSOpenGLCPSurfaceBackingSize, + NSOpenGLCPSurfaceOpacity, NSOpenGLCPSurfaceOrder, NSOpenGLCPSurfaceSurfaceVolatile, + NSOpenGLCPSwapInterval, NSOpenGLCPSwapRectangle, NSOpenGLCPSwapRectangleEnable, + NSOpenGLContextParameter, NSOpenGLContextParameterCurrentRendererID, + NSOpenGLContextParameterGPUFragmentProcessing, NSOpenGLContextParameterGPUVertexProcessing, + NSOpenGLContextParameterHasDrawable, NSOpenGLContextParameterMPSwapsInFlight, + NSOpenGLContextParameterRasterizationEnable, NSOpenGLContextParameterReclaimResources, + NSOpenGLContextParameterStateValidation, NSOpenGLContextParameterSurfaceBackingSize, + NSOpenGLContextParameterSurfaceOpacity, NSOpenGLContextParameterSurfaceOrder, + NSOpenGLContextParameterSurfaceSurfaceVolatile, NSOpenGLContextParameterSwapInterval, + NSOpenGLContextParameterSwapRectangle, NSOpenGLContextParameterSwapRectangleEnable, + NSOpenGLGOClearFormatCache, NSOpenGLGOFormatCacheSize, NSOpenGLGOResetLibrary, + NSOpenGLGORetainRenderers, NSOpenGLGOUseBuildCache, NSOpenGLGlobalOption, + NSOpenGLPFAAccelerated, NSOpenGLPFAAcceleratedCompute, NSOpenGLPFAAccumSize, + NSOpenGLPFAAllRenderers, NSOpenGLPFAAllowOfflineRenderers, NSOpenGLPFAAlphaSize, + NSOpenGLPFAAuxBuffers, NSOpenGLPFAAuxDepthStencil, NSOpenGLPFABackingStore, + NSOpenGLPFAClosestPolicy, NSOpenGLPFAColorFloat, NSOpenGLPFAColorSize, NSOpenGLPFACompliant, + NSOpenGLPFADepthSize, NSOpenGLPFADoubleBuffer, NSOpenGLPFAFullScreen, NSOpenGLPFAMPSafe, + NSOpenGLPFAMaximumPolicy, NSOpenGLPFAMinimumPolicy, NSOpenGLPFAMultiScreen, + NSOpenGLPFAMultisample, NSOpenGLPFANoRecovery, NSOpenGLPFAOffScreen, NSOpenGLPFAOpenGLProfile, + NSOpenGLPFAPixelBuffer, NSOpenGLPFARemotePixelBuffer, NSOpenGLPFARendererID, NSOpenGLPFARobust, + NSOpenGLPFASampleAlpha, NSOpenGLPFASampleBuffers, NSOpenGLPFASamples, NSOpenGLPFAScreenMask, + NSOpenGLPFASingleRenderer, NSOpenGLPFAStencilSize, NSOpenGLPFAStereo, NSOpenGLPFASupersample, + NSOpenGLPFATripleBuffer, NSOpenGLPFAVirtualScreenCount, NSOpenGLPFAWindow, + NSOpenGLPixelFormatAttribute, NSOpenGLProfileVersion3_2Core, NSOpenGLProfileVersion4_1Core, + NSOpenGLProfileVersionLegacy, +}; +pub use self::__NSOpenPanel::NSOpenPanel; +pub use self::__NSOutlineView::{ + NSOutlineView, NSOutlineViewColumnDidMoveNotification, + NSOutlineViewColumnDidResizeNotification, NSOutlineViewDataSource, NSOutlineViewDelegate, + NSOutlineViewDisclosureButtonKey, NSOutlineViewDropOnItemIndex, + NSOutlineViewItemDidCollapseNotification, NSOutlineViewItemDidExpandNotification, + NSOutlineViewItemWillCollapseNotification, NSOutlineViewItemWillExpandNotification, + NSOutlineViewSelectionDidChangeNotification, NSOutlineViewSelectionIsChangingNotification, + NSOutlineViewShowHideButtonKey, +}; +pub use self::__NSPDFImageRep::NSPDFImageRep; +pub use self::__NSPDFInfo::NSPDFInfo; +pub use self::__NSPDFPanel::{ + NSPDFPanel, NSPDFPanelOptions, NSPDFPanelRequestsParentDirectory, NSPDFPanelShowsOrientation, + NSPDFPanelShowsPaperSize, +}; +pub use self::__NSPICTImageRep::NSPICTImageRep; +pub use self::__NSPageController::{ + NSPageController, NSPageControllerDelegate, NSPageControllerObjectIdentifier, + NSPageControllerTransitionStyle, NSPageControllerTransitionStyleHorizontalStrip, + NSPageControllerTransitionStyleStackBook, NSPageControllerTransitionStyleStackHistory, +}; +pub use self::__NSPageLayout::NSPageLayout; +pub use self::__NSPanGestureRecognizer::NSPanGestureRecognizer; +pub use self::__NSPanel::{ + NSAlertAlternateReturn, NSAlertDefaultReturn, NSAlertErrorReturn, NSAlertOtherReturn, NSPanel, + NSReleaseAlertPanel, +}; +pub use self::__NSParagraphStyle::{ + NSCenterTabStopType, NSDecimalTabStopType, NSLeftTabStopType, NSLineBreakByCharWrapping, + NSLineBreakByClipping, NSLineBreakByTruncatingHead, NSLineBreakByTruncatingMiddle, + NSLineBreakByTruncatingTail, NSLineBreakByWordWrapping, NSLineBreakMode, NSLineBreakStrategy, + NSLineBreakStrategyHangulWordPriority, NSLineBreakStrategyNone, NSLineBreakStrategyPushOut, + NSLineBreakStrategyStandard, NSMutableParagraphStyle, NSParagraphStyle, NSRightTabStopType, + NSTabColumnTerminatorsAttributeName, NSTextTab, NSTextTabOptionKey, NSTextTabType, +}; +pub use self::__NSPasteboard::{ + NSColorPboardType, NSCreateFileContentsPboardType, NSCreateFilenamePboardType, NSDragPboard, + NSFileContentsPboardType, NSFilenamesPboardType, NSFilesPromisePboardType, NSFindPboard, + NSFontPboard, NSFontPboardType, NSGeneralPboard, NSGetFileType, NSGetFileTypes, + NSHTMLPboardType, NSInkTextPboardType, NSMultipleTextSelectionPboardType, NSPDFPboardType, + NSPICTPboardType, NSPasteboard, NSPasteboardContentsCurrentHostOnly, + NSPasteboardContentsOptions, NSPasteboardName, NSPasteboardNameDrag, NSPasteboardNameFind, + NSPasteboardNameFont, NSPasteboardNameGeneral, NSPasteboardNameRuler, NSPasteboardReading, + NSPasteboardReadingAsData, NSPasteboardReadingAsKeyedArchive, + NSPasteboardReadingAsPropertyList, NSPasteboardReadingAsString, NSPasteboardReadingOptionKey, + NSPasteboardReadingOptions, NSPasteboardType, NSPasteboardTypeColor, NSPasteboardTypeFileURL, + NSPasteboardTypeFindPanelSearchOptions, NSPasteboardTypeFont, NSPasteboardTypeHTML, + NSPasteboardTypeMultipleTextSelection, NSPasteboardTypeOwner, NSPasteboardTypePDF, + NSPasteboardTypePNG, NSPasteboardTypeRTF, NSPasteboardTypeRTFD, NSPasteboardTypeRuler, + NSPasteboardTypeSound, NSPasteboardTypeString, NSPasteboardTypeTIFF, + NSPasteboardTypeTabularText, NSPasteboardTypeTextFinderOptions, NSPasteboardTypeURL, + NSPasteboardURLReadingContentsConformToTypesKey, NSPasteboardURLReadingFileURLsOnlyKey, + NSPasteboardWriting, NSPasteboardWritingOptions, NSPasteboardWritingPromised, + NSPostScriptPboardType, NSRTFDPboardType, NSRTFPboardType, NSRulerPboard, NSRulerPboardType, + NSStringPboardType, NSTIFFPboardType, NSTabularTextPboardType, NSURLPboardType, + NSVCardPboardType, +}; +pub use self::__NSPasteboardItem::{NSPasteboardItem, NSPasteboardItemDataProvider}; +pub use self::__NSPathCell::{ + NSPathCell, NSPathCellDelegate, NSPathStyle, NSPathStyleNavigationBar, NSPathStylePopUp, + NSPathStyleStandard, +}; +pub use self::__NSPathComponentCell::NSPathComponentCell; +pub use self::__NSPathControl::{NSPathControl, NSPathControlDelegate}; +pub use self::__NSPathControlItem::NSPathControlItem; +pub use self::__NSPersistentDocument::NSPersistentDocument; +pub use self::__NSPickerTouchBarItem::{ + NSPickerTouchBarItem, NSPickerTouchBarItemControlRepresentation, + NSPickerTouchBarItemControlRepresentationAutomatic, + NSPickerTouchBarItemControlRepresentationCollapsed, + NSPickerTouchBarItemControlRepresentationExpanded, NSPickerTouchBarItemSelectionMode, + NSPickerTouchBarItemSelectionModeMomentary, NSPickerTouchBarItemSelectionModeSelectAny, + NSPickerTouchBarItemSelectionModeSelectOne, +}; +pub use self::__NSPopUpButton::{NSPopUpButton, NSPopUpButtonWillPopUpNotification}; +pub use self::__NSPopUpButtonCell::{ + NSPopUpArrowAtBottom, NSPopUpArrowAtCenter, NSPopUpArrowPosition, NSPopUpButtonCell, + NSPopUpButtonCellWillPopUpNotification, NSPopUpNoArrow, +}; +pub use self::__NSPopover::{ + NSPopover, NSPopoverAppearance, NSPopoverAppearanceHUD, NSPopoverAppearanceMinimal, + NSPopoverBehavior, NSPopoverBehaviorApplicationDefined, NSPopoverBehaviorSemitransient, + NSPopoverBehaviorTransient, NSPopoverCloseReasonDetachToWindow, NSPopoverCloseReasonKey, + NSPopoverCloseReasonStandard, NSPopoverCloseReasonValue, NSPopoverDelegate, + NSPopoverDidCloseNotification, NSPopoverDidShowNotification, NSPopoverWillCloseNotification, + NSPopoverWillShowNotification, +}; +pub use self::__NSPopoverTouchBarItem::NSPopoverTouchBarItem; +pub use self::__NSPredicateEditor::NSPredicateEditor; +pub use self::__NSPredicateEditorRowTemplate::NSPredicateEditorRowTemplate; +pub use self::__NSPressGestureRecognizer::NSPressGestureRecognizer; +pub use self::__NSPressureConfiguration::NSPressureConfiguration; +pub use self::__NSPrintInfo::{ + NSAutoPagination, NSClipPagination, NSFitPagination, NSLandscapeOrientation, + NSPaperOrientation, NSPaperOrientationLandscape, NSPaperOrientationPortrait, + NSPortraitOrientation, NSPrintAllPages, NSPrintBottomMargin, NSPrintCancelJob, NSPrintCopies, + NSPrintDetailedErrorReporting, NSPrintFaxNumber, NSPrintFirstPage, NSPrintFormName, + NSPrintHeaderAndFooter, NSPrintHorizontalPagination, NSPrintHorizontallyCentered, NSPrintInfo, + NSPrintInfoAttributeKey, NSPrintInfoSettingKey, NSPrintJobDisposition, + NSPrintJobDispositionValue, NSPrintJobFeatures, NSPrintJobSavingFileNameExtensionHidden, + NSPrintJobSavingURL, NSPrintLastPage, NSPrintLeftMargin, NSPrintManualFeed, NSPrintMustCollate, + NSPrintOrientation, NSPrintPagesAcross, NSPrintPagesDown, NSPrintPagesPerSheet, + NSPrintPaperFeed, NSPrintPaperName, NSPrintPaperSize, NSPrintPreviewJob, NSPrintPrinter, + NSPrintPrinterName, NSPrintReversePageOrder, NSPrintRightMargin, NSPrintSaveJob, + NSPrintSavePath, NSPrintScalingFactor, NSPrintSelectionOnly, NSPrintSpoolJob, NSPrintTime, + NSPrintTopMargin, NSPrintVerticalPagination, NSPrintVerticallyCentered, NSPrintingOrientation, + NSPrintingPaginationMode, NSPrintingPaginationModeAutomatic, NSPrintingPaginationModeClip, + NSPrintingPaginationModeFit, +}; +pub use self::__NSPrintOperation::{ + NSAscendingPageOrder, NSDescendingPageOrder, NSPrintOperation, NSPrintOperationExistsException, + NSPrintRenderingQuality, NSPrintRenderingQualityBest, NSPrintRenderingQualityResponsive, + NSPrintingPageOrder, NSSpecialPageOrder, NSUnknownPageOrder, +}; +pub use self::__NSPrintPanel::{ + NSPrintAllPresetsJobStyleHint, NSPrintNoPresetsJobStyleHint, NSPrintPanel, + NSPrintPanelAccessorizing, NSPrintPanelAccessorySummaryItemDescriptionKey, + NSPrintPanelAccessorySummaryItemNameKey, NSPrintPanelAccessorySummaryKey, + NSPrintPanelJobStyleHint, NSPrintPanelOptions, NSPrintPanelShowsCopies, + NSPrintPanelShowsOrientation, NSPrintPanelShowsPageRange, NSPrintPanelShowsPageSetupAccessory, + NSPrintPanelShowsPaperSize, NSPrintPanelShowsPreview, NSPrintPanelShowsPrintSelection, + NSPrintPanelShowsScaling, NSPrintPhotoJobStyleHint, +}; +pub use self::__NSPrinter::{ + NSPrinter, NSPrinterPaperName, NSPrinterTableError, NSPrinterTableNotFound, NSPrinterTableOK, + NSPrinterTableStatus, NSPrinterTypeName, +}; +pub use self::__NSProgressIndicator::{ + NSProgressIndicator, NSProgressIndicatorBarStyle, NSProgressIndicatorPreferredAquaThickness, + NSProgressIndicatorPreferredLargeThickness, NSProgressIndicatorPreferredSmallThickness, + NSProgressIndicatorPreferredThickness, NSProgressIndicatorSpinningStyle, + NSProgressIndicatorStyle, NSProgressIndicatorStyleBar, NSProgressIndicatorStyleSpinning, + NSProgressIndicatorThickness, +}; +pub use self::__NSResponder::{NSResponder, NSStandardKeyBindingResponding}; +pub use self::__NSRotationGestureRecognizer::NSRotationGestureRecognizer; +pub use self::__NSRuleEditor::{ + NSRuleEditor, NSRuleEditorDelegate, NSRuleEditorNestingMode, NSRuleEditorNestingModeCompound, + NSRuleEditorNestingModeList, NSRuleEditorNestingModeSimple, NSRuleEditorNestingModeSingle, + NSRuleEditorPredicateComparisonModifier, NSRuleEditorPredicateCompoundType, + NSRuleEditorPredicateCustomSelector, NSRuleEditorPredicateLeftExpression, + NSRuleEditorPredicateOperatorType, NSRuleEditorPredicateOptions, NSRuleEditorPredicatePartKey, + NSRuleEditorPredicateRightExpression, NSRuleEditorRowType, NSRuleEditorRowTypeCompound, + NSRuleEditorRowTypeSimple, NSRuleEditorRowsDidChangeNotification, +}; +pub use self::__NSRulerMarker::NSRulerMarker; +pub use self::__NSRulerView::{ + NSHorizontalRuler, NSRulerOrientation, NSRulerView, NSRulerViewUnitCentimeters, + NSRulerViewUnitInches, NSRulerViewUnitName, NSRulerViewUnitPicas, NSRulerViewUnitPoints, + NSVerticalRuler, +}; +pub use self::__NSRunningApplication::{ + NSApplicationActivateAllWindows, NSApplicationActivateIgnoringOtherApps, + NSApplicationActivationOptions, NSApplicationActivationPolicy, + NSApplicationActivationPolicyAccessory, NSApplicationActivationPolicyProhibited, + NSApplicationActivationPolicyRegular, NSRunningApplication, +}; +pub use self::__NSSavePanel::{NSOpenSavePanelDelegate, NSSavePanel}; +pub use self::__NSScreen::{NSScreen, NSScreenColorSpaceDidChangeNotification}; +pub use self::__NSScrollView::{ + NSScrollElasticity, NSScrollElasticityAllowed, NSScrollElasticityAutomatic, + NSScrollElasticityNone, NSScrollView, NSScrollViewDidEndLiveMagnifyNotification, + NSScrollViewDidEndLiveScrollNotification, NSScrollViewDidLiveScrollNotification, + NSScrollViewFindBarPosition, NSScrollViewFindBarPositionAboveContent, + NSScrollViewFindBarPositionAboveHorizontalRuler, NSScrollViewFindBarPositionBelowContent, + NSScrollViewWillStartLiveMagnifyNotification, NSScrollViewWillStartLiveScrollNotification, +}; +pub use self::__NSScroller::{ + NSAllScrollerParts, NSNoScrollerParts, NSOnlyScrollerArrows, + NSPreferredScrollerStyleDidChangeNotification, NSScrollArrowPosition, NSScroller, + NSScrollerArrow, NSScrollerArrowsDefaultSetting, NSScrollerArrowsMaxEnd, + NSScrollerArrowsMinEnd, NSScrollerArrowsNone, NSScrollerDecrementArrow, + NSScrollerDecrementLine, NSScrollerDecrementPage, NSScrollerIncrementArrow, + NSScrollerIncrementLine, NSScrollerIncrementPage, NSScrollerKnob, NSScrollerKnobSlot, + NSScrollerKnobStyle, NSScrollerKnobStyleDark, NSScrollerKnobStyleDefault, + NSScrollerKnobStyleLight, NSScrollerNoPart, NSScrollerPart, NSScrollerStyle, + NSScrollerStyleLegacy, NSScrollerStyleOverlay, NSUsableScrollerParts, +}; +pub use self::__NSScrubber::{ + NSScrubber, NSScrubberAlignment, NSScrubberAlignmentCenter, NSScrubberAlignmentLeading, + NSScrubberAlignmentNone, NSScrubberAlignmentTrailing, NSScrubberDataSource, NSScrubberDelegate, + NSScrubberMode, NSScrubberModeFixed, NSScrubberModeFree, NSScrubberSelectionStyle, +}; +pub use self::__NSScrubberItemView::{ + NSScrubberArrangedView, NSScrubberImageItemView, NSScrubberItemView, NSScrubberSelectionView, + NSScrubberTextItemView, +}; +pub use self::__NSScrubberLayout::{ + NSScrubberFlowLayout, NSScrubberFlowLayoutDelegate, NSScrubberLayout, + NSScrubberLayoutAttributes, NSScrubberProportionalLayout, +}; +pub use self::__NSSearchField::{ + NSSearchField, NSSearchFieldDelegate, NSSearchFieldRecentsAutosaveName, +}; +pub use self::__NSSearchFieldCell::{ + NSSearchFieldCell, NSSearchFieldClearRecentsMenuItemTag, NSSearchFieldNoRecentsMenuItemTag, + NSSearchFieldRecentsMenuItemTag, NSSearchFieldRecentsTitleMenuItemTag, +}; +pub use self::__NSSearchToolbarItem::NSSearchToolbarItem; +pub use self::__NSSecureTextField::{NSSecureTextField, NSSecureTextFieldCell}; +pub use self::__NSSegmentedCell::NSSegmentedCell; +pub use self::__NSSegmentedControl::{ + NSSegmentDistribution, NSSegmentDistributionFill, NSSegmentDistributionFillEqually, + NSSegmentDistributionFillProportionally, NSSegmentDistributionFit, NSSegmentStyle, + NSSegmentStyleAutomatic, NSSegmentStyleCapsule, NSSegmentStyleRoundRect, NSSegmentStyleRounded, + NSSegmentStyleSeparated, NSSegmentStyleSmallSquare, NSSegmentStyleTexturedRounded, + NSSegmentStyleTexturedSquare, NSSegmentSwitchTracking, NSSegmentSwitchTrackingMomentary, + NSSegmentSwitchTrackingMomentaryAccelerator, NSSegmentSwitchTrackingSelectAny, + NSSegmentSwitchTrackingSelectOne, NSSegmentedControl, +}; +pub use self::__NSShadow::NSShadow; +pub use self::__NSSharingService::{ + NSCloudKitSharingServiceAllowPrivate, NSCloudKitSharingServiceAllowPublic, + NSCloudKitSharingServiceAllowReadOnly, NSCloudKitSharingServiceAllowReadWrite, + NSCloudKitSharingServiceOptions, NSCloudKitSharingServiceStandard, + NSCloudSharingServiceDelegate, NSSharingContentScope, NSSharingContentScopeFull, + NSSharingContentScopeItem, NSSharingContentScopePartial, NSSharingService, + NSSharingServiceDelegate, NSSharingServiceName, NSSharingServiceNameAddToAperture, + NSSharingServiceNameAddToIPhoto, NSSharingServiceNameAddToSafariReadingList, + NSSharingServiceNameCloudSharing, NSSharingServiceNameComposeEmail, + NSSharingServiceNameComposeMessage, NSSharingServiceNamePostImageOnFlickr, + NSSharingServiceNamePostOnFacebook, NSSharingServiceNamePostOnLinkedIn, + NSSharingServiceNamePostOnSinaWeibo, NSSharingServiceNamePostOnTencentWeibo, + NSSharingServiceNamePostOnTwitter, NSSharingServiceNamePostVideoOnTudou, + NSSharingServiceNamePostVideoOnVimeo, NSSharingServiceNamePostVideoOnYouku, + NSSharingServiceNameSendViaAirDrop, NSSharingServiceNameUseAsDesktopPicture, + NSSharingServiceNameUseAsFacebookProfileImage, NSSharingServiceNameUseAsLinkedInProfileImage, + NSSharingServiceNameUseAsTwitterProfileImage, NSSharingServicePicker, + NSSharingServicePickerDelegate, +}; +pub use self::__NSSharingServicePickerToolbarItem::{ + NSSharingServicePickerToolbarItem, NSSharingServicePickerToolbarItemDelegate, +}; +pub use self::__NSSharingServicePickerTouchBarItem::{ + NSSharingServicePickerTouchBarItem, NSSharingServicePickerTouchBarItemDelegate, +}; +pub use self::__NSSlider::NSSlider; +pub use self::__NSSliderAccessory::{NSSliderAccessory, NSSliderAccessoryBehavior}; +pub use self::__NSSliderCell::{ + NSCircularSlider, NSLinearSlider, NSSliderCell, NSSliderType, NSSliderTypeCircular, + NSSliderTypeLinear, NSTickMarkAbove, NSTickMarkBelow, NSTickMarkLeft, NSTickMarkPosition, + NSTickMarkPositionAbove, NSTickMarkPositionBelow, NSTickMarkPositionLeading, + NSTickMarkPositionTrailing, NSTickMarkRight, +}; +pub use self::__NSSliderTouchBarItem::{ + NSSliderAccessoryWidth, NSSliderAccessoryWidthDefault, NSSliderAccessoryWidthWide, + NSSliderTouchBarItem, +}; +pub use self::__NSSound::{ + NSSound, NSSoundDelegate, NSSoundName, NSSoundPboardType, NSSoundPlaybackDeviceIdentifier, +}; +pub use self::__NSSpeechRecognizer::{NSSpeechRecognizer, NSSpeechRecognizerDelegate}; +pub use self::__NSSpeechSynthesizer::{ + NSSpeechBoundary, NSSpeechCharacterModeProperty, NSSpeechCommandDelimiterKey, + NSSpeechCommandDelimiterProperty, NSSpeechCommandPrefix, NSSpeechCommandSuffix, + NSSpeechCurrentVoiceProperty, NSSpeechDictionaryAbbreviations, NSSpeechDictionaryEntryPhonemes, + NSSpeechDictionaryEntrySpelling, NSSpeechDictionaryKey, NSSpeechDictionaryLocaleIdentifier, + NSSpeechDictionaryModificationDate, NSSpeechDictionaryPronunciations, NSSpeechErrorCount, + NSSpeechErrorKey, NSSpeechErrorNewestCharacterOffset, NSSpeechErrorNewestCode, + NSSpeechErrorOldestCharacterOffset, NSSpeechErrorOldestCode, NSSpeechErrorsProperty, + NSSpeechImmediateBoundary, NSSpeechInputModeProperty, NSSpeechMode, NSSpeechModeLiteral, + NSSpeechModeNormal, NSSpeechModePhoneme, NSSpeechModeText, NSSpeechNumberModeProperty, + NSSpeechOutputToFileURLProperty, NSSpeechPhonemeInfoExample, NSSpeechPhonemeInfoHiliteEnd, + NSSpeechPhonemeInfoHiliteStart, NSSpeechPhonemeInfoKey, NSSpeechPhonemeInfoOpcode, + NSSpeechPhonemeInfoSymbol, NSSpeechPhonemeSymbolsProperty, NSSpeechPitchBaseProperty, + NSSpeechPitchModProperty, NSSpeechPropertyKey, NSSpeechRateProperty, + NSSpeechRecentSyncProperty, NSSpeechResetProperty, NSSpeechSentenceBoundary, NSSpeechStatusKey, + NSSpeechStatusNumberOfCharactersLeft, NSSpeechStatusOutputBusy, NSSpeechStatusOutputPaused, + NSSpeechStatusPhonemeCode, NSSpeechStatusProperty, NSSpeechSynthesizer, + NSSpeechSynthesizerDelegate, NSSpeechSynthesizerInfoIdentifier, NSSpeechSynthesizerInfoKey, + NSSpeechSynthesizerInfoProperty, NSSpeechSynthesizerInfoVersion, NSSpeechSynthesizerVoiceName, + NSSpeechVolumeProperty, NSSpeechWordBoundary, NSVoiceAge, NSVoiceAttributeKey, NSVoiceDemoText, + NSVoiceGender, NSVoiceGenderFemale, NSVoiceGenderMale, NSVoiceGenderName, NSVoiceGenderNeuter, + NSVoiceGenderNeutral, NSVoiceIdentifier, NSVoiceIndividuallySpokenCharacters, NSVoiceLanguage, + NSVoiceLocaleIdentifier, NSVoiceName, NSVoiceSupportedCharacters, +}; +pub use self::__NSSpellChecker::{ + NSCorrectionIndicatorType, NSCorrectionIndicatorTypeDefault, NSCorrectionIndicatorTypeGuesses, + NSCorrectionIndicatorTypeReversion, NSCorrectionResponse, NSCorrectionResponseAccepted, + NSCorrectionResponseEdited, NSCorrectionResponseIgnored, NSCorrectionResponseNone, + NSCorrectionResponseRejected, NSCorrectionResponseReverted, NSSpellChecker, + NSSpellCheckerDidChangeAutomaticCapitalizationNotification, + NSSpellCheckerDidChangeAutomaticDashSubstitutionNotification, + NSSpellCheckerDidChangeAutomaticPeriodSubstitutionNotification, + NSSpellCheckerDidChangeAutomaticQuoteSubstitutionNotification, + NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification, + NSSpellCheckerDidChangeAutomaticTextCompletionNotification, + NSSpellCheckerDidChangeAutomaticTextReplacementNotification, NSTextCheckingDocumentAuthorKey, + NSTextCheckingDocumentTitleKey, NSTextCheckingDocumentURLKey, NSTextCheckingOptionKey, + NSTextCheckingOrthographyKey, NSTextCheckingQuotesKey, NSTextCheckingReferenceDateKey, + NSTextCheckingReferenceTimeZoneKey, NSTextCheckingRegularExpressionsKey, + NSTextCheckingReplacementsKey, NSTextCheckingSelectedRangeKey, +}; +pub use self::__NSSpellProtocol::{NSChangeSpelling, NSIgnoreMisspelledWords}; +pub use self::__NSSplitView::{ + NSSplitView, NSSplitViewAutosaveName, NSSplitViewDelegate, + NSSplitViewDidResizeSubviewsNotification, NSSplitViewDividerStyle, + NSSplitViewDividerStylePaneSplitter, NSSplitViewDividerStyleThick, NSSplitViewDividerStyleThin, + NSSplitViewWillResizeSubviewsNotification, +}; +pub use self::__NSSplitViewController::{ + NSSplitViewController, NSSplitViewControllerAutomaticDimension, +}; +pub use self::__NSSplitViewItem::{ + NSSplitViewItem, NSSplitViewItemBehavior, NSSplitViewItemBehaviorContentList, + NSSplitViewItemBehaviorDefault, NSSplitViewItemBehaviorSidebar, + NSSplitViewItemCollapseBehavior, NSSplitViewItemCollapseBehaviorDefault, + NSSplitViewItemCollapseBehaviorPreferResizingSiblingsWithFixedSplitView, + NSSplitViewItemCollapseBehaviorPreferResizingSplitViewWithFixedSiblings, + NSSplitViewItemCollapseBehaviorUseConstraints, NSSplitViewItemUnspecifiedDimension, +}; +pub use self::__NSStackView::{ + NSStackView, NSStackViewDelegate, NSStackViewDistribution, + NSStackViewDistributionEqualCentering, NSStackViewDistributionEqualSpacing, + NSStackViewDistributionFill, NSStackViewDistributionFillEqually, + NSStackViewDistributionFillProportionally, NSStackViewDistributionGravityAreas, + NSStackViewGravity, NSStackViewGravityBottom, NSStackViewGravityCenter, + NSStackViewGravityLeading, NSStackViewGravityTop, NSStackViewGravityTrailing, + NSStackViewVisibilityPriority, NSStackViewVisibilityPriorityDetachOnlyIfNecessary, + NSStackViewVisibilityPriorityMustHold, NSStackViewVisibilityPriorityNotVisible, +}; +pub use self::__NSStatusBar::{NSSquareStatusItemLength, NSStatusBar, NSVariableStatusItemLength}; +pub use self::__NSStatusBarButton::NSStatusBarButton; +pub use self::__NSStatusItem::{ + NSStatusItem, NSStatusItemAutosaveName, NSStatusItemBehavior, + NSStatusItemBehaviorRemovalAllowed, NSStatusItemBehaviorTerminationOnRemoval, +}; +pub use self::__NSStepper::NSStepper; +pub use self::__NSStepperCell::NSStepperCell; +pub use self::__NSStepperTouchBarItem::NSStepperTouchBarItem; +pub use self::__NSStoryboard::{ + NSStoryboard, NSStoryboardControllerCreator, NSStoryboardName, NSStoryboardSceneIdentifier, +}; +pub use self::__NSStoryboardSegue::{ + NSSeguePerforming, NSStoryboardSegue, NSStoryboardSegueIdentifier, +}; +pub use self::__NSStringDrawing::{ + NSStringDrawingContext, NSStringDrawingDisableScreenFontSubstitution, NSStringDrawingOneShot, + NSStringDrawingOptions, NSStringDrawingTruncatesLastVisibleLine, + NSStringDrawingUsesDeviceMetrics, NSStringDrawingUsesFontLeading, + NSStringDrawingUsesLineFragmentOrigin, +}; +pub use self::__NSSwitch::NSSwitch; +pub use self::__NSTabView::{ + NSAppKitVersionNumberWithDirectionalTabs, NSBottomTabsBezelBorder, NSLeftTabsBezelBorder, + NSNoTabsBezelBorder, NSNoTabsLineBorder, NSNoTabsNoBorder, NSRightTabsBezelBorder, + NSTabPosition, NSTabPositionBottom, NSTabPositionLeft, NSTabPositionNone, NSTabPositionRight, + NSTabPositionTop, NSTabView, NSTabViewBorderType, NSTabViewBorderTypeBezel, + NSTabViewBorderTypeLine, NSTabViewBorderTypeNone, NSTabViewDelegate, NSTabViewType, + NSTopTabsBezelBorder, +}; +pub use self::__NSTabViewController::{ + NSTabViewController, NSTabViewControllerTabStyle, + NSTabViewControllerTabStyleSegmentedControlOnBottom, + NSTabViewControllerTabStyleSegmentedControlOnTop, NSTabViewControllerTabStyleToolbar, + NSTabViewControllerTabStyleUnspecified, +}; +pub use self::__NSTabViewItem::{ + NSBackgroundTab, NSPressedTab, NSSelectedTab, NSTabState, NSTabViewItem, +}; +pub use self::__NSTableCellView::NSTableCellView; +pub use self::__NSTableColumn::{ + NSTableColumn, NSTableColumnAutoresizingMask, NSTableColumnNoResizing, + NSTableColumnResizingOptions, NSTableColumnUserResizingMask, +}; +pub use self::__NSTableHeaderCell::NSTableHeaderCell; +pub use self::__NSTableHeaderView::NSTableHeaderView; +pub use self::__NSTableRowView::NSTableRowView; +pub use self::__NSTableView::{ + NSTableRowActionEdge, NSTableRowActionEdgeLeading, NSTableRowActionEdgeTrailing, NSTableView, + NSTableViewAnimationEffectFade, NSTableViewAnimationEffectGap, NSTableViewAnimationEffectNone, + NSTableViewAnimationOptions, NSTableViewAnimationSlideDown, NSTableViewAnimationSlideLeft, + NSTableViewAnimationSlideRight, NSTableViewAnimationSlideUp, NSTableViewAutosaveName, + NSTableViewColumnAutoresizingStyle, NSTableViewColumnDidMoveNotification, + NSTableViewColumnDidResizeNotification, NSTableViewDashedHorizontalGridLineMask, + NSTableViewDataSource, NSTableViewDelegate, NSTableViewDraggingDestinationFeedbackStyle, + NSTableViewDraggingDestinationFeedbackStyleGap, + NSTableViewDraggingDestinationFeedbackStyleNone, + NSTableViewDraggingDestinationFeedbackStyleRegular, + NSTableViewDraggingDestinationFeedbackStyleSourceList, NSTableViewDropAbove, NSTableViewDropOn, + NSTableViewDropOperation, NSTableViewFirstColumnOnlyAutoresizingStyle, + NSTableViewGridLineStyle, NSTableViewGridNone, NSTableViewLastColumnOnlyAutoresizingStyle, + NSTableViewNoColumnAutoresizing, NSTableViewReverseSequentialColumnAutoresizingStyle, + NSTableViewRowSizeStyle, NSTableViewRowSizeStyleCustom, NSTableViewRowSizeStyleDefault, + NSTableViewRowSizeStyleLarge, NSTableViewRowSizeStyleMedium, NSTableViewRowSizeStyleSmall, + NSTableViewRowViewKey, NSTableViewSelectionDidChangeNotification, + NSTableViewSelectionHighlightStyle, NSTableViewSelectionHighlightStyleNone, + NSTableViewSelectionHighlightStyleRegular, NSTableViewSelectionHighlightStyleSourceList, + NSTableViewSelectionIsChangingNotification, NSTableViewSequentialColumnAutoresizingStyle, + NSTableViewSolidHorizontalGridLineMask, NSTableViewSolidVerticalGridLineMask, NSTableViewStyle, + NSTableViewStyleAutomatic, NSTableViewStyleFullWidth, NSTableViewStyleInset, + NSTableViewStylePlain, NSTableViewStyleSourceList, NSTableViewUniformColumnAutoresizingStyle, +}; +pub use self::__NSTableViewDiffableDataSource::{ + NSTableViewDiffableDataSource, NSTableViewDiffableDataSourceCellProvider, + NSTableViewDiffableDataSourceRowProvider, + NSTableViewDiffableDataSourceSectionHeaderViewProvider, +}; +pub use self::__NSTableViewRowAction::{ + NSTableViewRowAction, NSTableViewRowActionStyle, NSTableViewRowActionStyleDestructive, + NSTableViewRowActionStyleRegular, +}; +pub use self::__NSText::{ + NSBackTabCharacter, NSBackspaceCharacter, NSBacktabTextMovement, NSCancelTextMovement, + NSCarriageReturnCharacter, NSCenterTextAlignment, NSDeleteCharacter, NSDownTextMovement, + NSEnterCharacter, NSFormFeedCharacter, NSIllegalTextMovement, NSJustifiedTextAlignment, + NSLeftTextAlignment, NSLeftTextMovement, NSLineSeparatorCharacter, NSNaturalTextAlignment, + NSNewlineCharacter, NSOtherTextMovement, NSParagraphSeparatorCharacter, NSReturnTextMovement, + NSRightTextAlignment, NSRightTextMovement, NSTabCharacter, NSTabTextMovement, NSText, + NSTextAlignment, NSTextAlignmentCenter, NSTextAlignmentJustified, NSTextAlignmentLeft, + NSTextAlignmentNatural, NSTextAlignmentRight, NSTextDelegate, + NSTextDidBeginEditingNotification, NSTextDidChangeNotification, + NSTextDidEndEditingNotification, NSTextMovement, NSTextMovementBacktab, NSTextMovementCancel, + NSTextMovementDown, NSTextMovementLeft, NSTextMovementOther, NSTextMovementReturn, + NSTextMovementRight, NSTextMovementTab, NSTextMovementUp, NSTextMovementUserInfoKey, + NSTextWritingDirectionEmbedding, NSTextWritingDirectionOverride, NSUpTextMovement, + NSWritingDirection, NSWritingDirectionLeftToRight, NSWritingDirectionNatural, + NSWritingDirectionRightToLeft, +}; +pub use self::__NSTextAlternatives::{ + NSTextAlternatives, NSTextAlternativesSelectedAlternativeStringNotification, +}; +pub use self::__NSTextAttachment::{ + NSAttachmentCharacter, NSTextAttachment, NSTextAttachmentContainer, NSTextAttachmentLayout, + NSTextAttachmentViewProvider, +}; +pub use self::__NSTextAttachmentCell::NSTextAttachmentCell; +pub use self::__NSTextCheckingClient::{ + NSTextCheckingClient, NSTextInputTraitType, NSTextInputTraitTypeDefault, + NSTextInputTraitTypeNo, NSTextInputTraitTypeYes, NSTextInputTraits, +}; +pub use self::__NSTextCheckingController::NSTextCheckingController; +pub use self::__NSTextContainer::{ + NSLineDoesntMove, NSLineMovementDirection, NSLineMovesDown, NSLineMovesLeft, NSLineMovesRight, + NSLineMovesUp, NSLineSweepDirection, NSLineSweepDown, NSLineSweepLeft, NSLineSweepRight, + NSLineSweepUp, NSTextContainer, +}; +pub use self::__NSTextContent::{ + NSTextContent, NSTextContentType, NSTextContentTypeOneTimeCode, NSTextContentTypePassword, + NSTextContentTypeUsername, +}; +pub use self::__NSTextContentManager::{ + NSTextContentManager, NSTextContentManagerDelegate, NSTextContentManagerEnumerationOptions, + NSTextContentManagerEnumerationOptionsNone, NSTextContentManagerEnumerationOptionsReverse, + NSTextContentStorage, NSTextContentStorageDelegate, + NSTextContentStorageUnsupportedAttributeAddedNotification, NSTextElementProvider, +}; +pub use self::__NSTextElement::{NSTextElement, NSTextParagraph}; +pub use self::__NSTextField::{NSTextField, NSTextFieldDelegate}; +pub use self::__NSTextFieldCell::{ + NSTextFieldBezelStyle, NSTextFieldCell, NSTextFieldRoundedBezel, NSTextFieldSquareBezel, +}; +pub use self::__NSTextFinder::{ + NSPasteboardTypeTextFinderOptionKey, NSTextFinder, NSTextFinderAction, + NSTextFinderActionHideFindInterface, NSTextFinderActionHideReplaceInterface, + NSTextFinderActionNextMatch, NSTextFinderActionPreviousMatch, NSTextFinderActionReplace, + NSTextFinderActionReplaceAll, NSTextFinderActionReplaceAllInSelection, + NSTextFinderActionReplaceAndFind, NSTextFinderActionSelectAll, + NSTextFinderActionSelectAllInSelection, NSTextFinderActionSetSearchString, + NSTextFinderActionShowFindInterface, NSTextFinderActionShowReplaceInterface, + NSTextFinderBarContainer, NSTextFinderCaseInsensitiveKey, NSTextFinderClient, + NSTextFinderMatchingType, NSTextFinderMatchingTypeContains, NSTextFinderMatchingTypeEndsWith, + NSTextFinderMatchingTypeFullWord, NSTextFinderMatchingTypeKey, + NSTextFinderMatchingTypeStartsWith, +}; +pub use self::__NSTextInputClient::NSTextInputClient; +pub use self::__NSTextInputContext::{ + NSTextInputContext, NSTextInputContextKeyboardSelectionDidChangeNotification, + NSTextInputSourceIdentifier, +}; +pub use self::__NSTextLayoutFragment::{ + NSTextLayoutFragment, NSTextLayoutFragmentEnumerationOptions, + NSTextLayoutFragmentEnumerationOptionsEnsuresExtraLineFragment, + NSTextLayoutFragmentEnumerationOptionsEnsuresLayout, + NSTextLayoutFragmentEnumerationOptionsEstimatesSize, + NSTextLayoutFragmentEnumerationOptionsNone, NSTextLayoutFragmentEnumerationOptionsReverse, + NSTextLayoutFragmentState, NSTextLayoutFragmentStateCalculatedUsageBounds, + NSTextLayoutFragmentStateEstimatedUsageBounds, NSTextLayoutFragmentStateLayoutAvailable, + NSTextLayoutFragmentStateNone, +}; +pub use self::__NSTextLayoutManager::{ + NSTextLayoutManager, NSTextLayoutManagerDelegate, NSTextLayoutManagerSegmentOptions, + NSTextLayoutManagerSegmentOptionsHeadSegmentExtended, + NSTextLayoutManagerSegmentOptionsMiddleFragmentsExcluded, + NSTextLayoutManagerSegmentOptionsNone, NSTextLayoutManagerSegmentOptionsRangeNotRequired, + NSTextLayoutManagerSegmentOptionsTailSegmentExtended, + NSTextLayoutManagerSegmentOptionsUpstreamAffinity, NSTextLayoutManagerSegmentType, + NSTextLayoutManagerSegmentTypeHighlight, NSTextLayoutManagerSegmentTypeSelection, + NSTextLayoutManagerSegmentTypeStandard, +}; +pub use self::__NSTextLineFragment::NSTextLineFragment; +pub use self::__NSTextList::{ + NSTextList, NSTextListMarkerBox, NSTextListMarkerCheck, NSTextListMarkerCircle, + NSTextListMarkerDecimal, NSTextListMarkerDiamond, NSTextListMarkerDisc, NSTextListMarkerFormat, + NSTextListMarkerHyphen, NSTextListMarkerLowercaseAlpha, NSTextListMarkerLowercaseHexadecimal, + NSTextListMarkerLowercaseLatin, NSTextListMarkerLowercaseRoman, NSTextListMarkerOctal, + NSTextListMarkerSquare, NSTextListMarkerUppercaseAlpha, NSTextListMarkerUppercaseHexadecimal, + NSTextListMarkerUppercaseLatin, NSTextListMarkerUppercaseRoman, NSTextListOptions, + NSTextListPrependEnclosingMarker, +}; +pub use self::__NSTextRange::{NSTextLocation, NSTextRange}; +pub use self::__NSTextSelection::{ + NSTextSelection, NSTextSelectionAffinity, NSTextSelectionAffinityDownstream, + NSTextSelectionAffinityUpstream, NSTextSelectionGranularity, + NSTextSelectionGranularityCharacter, NSTextSelectionGranularityLine, + NSTextSelectionGranularityParagraph, NSTextSelectionGranularitySentence, + NSTextSelectionGranularityWord, +}; +pub use self::__NSTextSelectionNavigation::{ + NSTextSelectionDataSource, NSTextSelectionNavigation, NSTextSelectionNavigationDestination, + NSTextSelectionNavigationDestinationCharacter, NSTextSelectionNavigationDestinationContainer, + NSTextSelectionNavigationDestinationDocument, NSTextSelectionNavigationDestinationLine, + NSTextSelectionNavigationDestinationParagraph, NSTextSelectionNavigationDestinationSentence, + NSTextSelectionNavigationDestinationWord, NSTextSelectionNavigationDirection, + NSTextSelectionNavigationDirectionBackward, NSTextSelectionNavigationDirectionDown, + NSTextSelectionNavigationDirectionForward, NSTextSelectionNavigationDirectionLeft, + NSTextSelectionNavigationDirectionRight, NSTextSelectionNavigationDirectionUp, + NSTextSelectionNavigationLayoutOrientation, + NSTextSelectionNavigationLayoutOrientationHorizontal, + NSTextSelectionNavigationLayoutOrientationVertical, NSTextSelectionNavigationModifier, + NSTextSelectionNavigationModifierExtend, NSTextSelectionNavigationModifierMultiple, + NSTextSelectionNavigationModifierVisual, NSTextSelectionNavigationWritingDirection, + NSTextSelectionNavigationWritingDirectionLeftToRight, + NSTextSelectionNavigationWritingDirectionRightToLeft, +}; +pub use self::__NSTextStorage::{ + NSTextStorage, NSTextStorageDelegate, NSTextStorageDidProcessEditingNotification, + NSTextStorageEditActions, NSTextStorageEditedAttributes, NSTextStorageEditedCharacters, + NSTextStorageEditedOptions, NSTextStorageObserving, + NSTextStorageWillProcessEditingNotification, +}; +pub use self::__NSTextTable::{ + NSTextBlock, NSTextBlockAbsoluteValueType, NSTextBlockBaselineAlignment, NSTextBlockBorder, + NSTextBlockBottomAlignment, NSTextBlockDimension, NSTextBlockHeight, NSTextBlockLayer, + NSTextBlockMargin, NSTextBlockMaximumHeight, NSTextBlockMaximumWidth, + NSTextBlockMiddleAlignment, NSTextBlockMinimumHeight, NSTextBlockMinimumWidth, + NSTextBlockPadding, NSTextBlockPercentageValueType, NSTextBlockTopAlignment, + NSTextBlockValueType, NSTextBlockVerticalAlignment, NSTextBlockWidth, NSTextTable, + NSTextTableAutomaticLayoutAlgorithm, NSTextTableBlock, NSTextTableFixedLayoutAlgorithm, + NSTextTableLayoutAlgorithm, +}; +pub use self::__NSTextView::{ + NSAllRomanInputSourcesLocaleIdentifier, NSFindPanelAction, NSFindPanelActionNext, + NSFindPanelActionPrevious, NSFindPanelActionReplace, NSFindPanelActionReplaceAll, + NSFindPanelActionReplaceAllInSelection, NSFindPanelActionReplaceAndFind, + NSFindPanelActionSelectAll, NSFindPanelActionSelectAllInSelection, + NSFindPanelActionSetFindString, NSFindPanelActionShowFindPanel, + NSFindPanelCaseInsensitiveSearch, NSFindPanelSearchOptionsPboardType, + NSFindPanelSubstringMatch, NSFindPanelSubstringMatchType, + NSFindPanelSubstringMatchTypeContains, NSFindPanelSubstringMatchTypeEndsWith, + NSFindPanelSubstringMatchTypeFullWord, NSFindPanelSubstringMatchTypeStartsWith, + NSPasteboardTypeFindPanelSearchOptionKey, NSSelectByCharacter, NSSelectByParagraph, + NSSelectByWord, NSSelectionAffinity, NSSelectionAffinityDownstream, + NSSelectionAffinityUpstream, NSSelectionGranularity, NSTextView, NSTextViewDelegate, + NSTextViewDidChangeSelectionNotification, NSTextViewDidChangeTypingAttributesNotification, + NSTextViewDidSwitchToNSLayoutManagerNotification, + NSTextViewWillChangeNotifyingTextViewNotification, + NSTextViewWillSwitchToNSLayoutManagerNotification, NSTouchBarItemIdentifierCharacterPicker, + NSTouchBarItemIdentifierTextAlignment, NSTouchBarItemIdentifierTextColorPicker, + NSTouchBarItemIdentifierTextFormat, NSTouchBarItemIdentifierTextList, + NSTouchBarItemIdentifierTextStyle, +}; +pub use self::__NSTextViewportLayoutController::{ + NSTextViewportLayoutController, NSTextViewportLayoutControllerDelegate, +}; +pub use self::__NSTintConfiguration::NSTintConfiguration; +pub use self::__NSTitlebarAccessoryViewController::NSTitlebarAccessoryViewController; +pub use self::__NSTokenField::{NSTokenField, NSTokenFieldDelegate}; +pub use self::__NSTokenFieldCell::{ + NSDefaultTokenStyle, NSPlainTextTokenStyle, NSRoundedTokenStyle, NSTokenFieldCell, + NSTokenFieldCellDelegate, NSTokenStyle, NSTokenStyleDefault, NSTokenStyleNone, + NSTokenStylePlainSquared, NSTokenStyleRounded, NSTokenStyleSquared, +}; +pub use self::__NSToolbar::{ + NSToolbar, NSToolbarDelegate, NSToolbarDidRemoveItemNotification, NSToolbarDisplayMode, + NSToolbarDisplayModeDefault, NSToolbarDisplayModeIconAndLabel, NSToolbarDisplayModeIconOnly, + NSToolbarDisplayModeLabelOnly, NSToolbarIdentifier, NSToolbarItemIdentifier, NSToolbarSizeMode, + NSToolbarSizeModeDefault, NSToolbarSizeModeRegular, NSToolbarSizeModeSmall, + NSToolbarWillAddItemNotification, +}; +pub use self::__NSToolbarItem::{ + NSCloudSharingValidation, NSToolbarCloudSharingItemIdentifier, + NSToolbarCustomizeToolbarItemIdentifier, NSToolbarFlexibleSpaceItemIdentifier, NSToolbarItem, + NSToolbarItemValidation, NSToolbarItemVisibilityPriority, NSToolbarItemVisibilityPriorityHigh, + NSToolbarItemVisibilityPriorityLow, NSToolbarItemVisibilityPriorityStandard, + NSToolbarItemVisibilityPriorityUser, NSToolbarPrintItemIdentifier, + NSToolbarSeparatorItemIdentifier, NSToolbarShowColorsItemIdentifier, + NSToolbarShowFontsItemIdentifier, NSToolbarSidebarTrackingSeparatorItemIdentifier, + NSToolbarSpaceItemIdentifier, NSToolbarToggleSidebarItemIdentifier, +}; +pub use self::__NSToolbarItemGroup::{ + NSToolbarItemGroup, NSToolbarItemGroupControlRepresentation, + NSToolbarItemGroupControlRepresentationAutomatic, + NSToolbarItemGroupControlRepresentationCollapsed, + NSToolbarItemGroupControlRepresentationExpanded, NSToolbarItemGroupSelectionMode, + NSToolbarItemGroupSelectionModeMomentary, NSToolbarItemGroupSelectionModeSelectAny, + NSToolbarItemGroupSelectionModeSelectOne, +}; +pub use self::__NSTouch::{ + NSTouch, NSTouchPhase, NSTouchPhaseAny, NSTouchPhaseBegan, NSTouchPhaseCancelled, + NSTouchPhaseEnded, NSTouchPhaseMoved, NSTouchPhaseStationary, NSTouchPhaseTouching, + NSTouchType, NSTouchTypeDirect, NSTouchTypeIndirect, NSTouchTypeMask, NSTouchTypeMaskDirect, + NSTouchTypeMaskIndirect, +}; +pub use self::__NSTouchBar::{ + NSTouchBar, NSTouchBarCustomizationIdentifier, NSTouchBarDelegate, NSTouchBarProvider, +}; +pub use self::__NSTouchBarItem::{ + NSTouchBarItem, NSTouchBarItemIdentifier, NSTouchBarItemIdentifierFixedSpaceLarge, + NSTouchBarItemIdentifierFixedSpaceSmall, NSTouchBarItemIdentifierFlexibleSpace, + NSTouchBarItemIdentifierOtherItemsProxy, NSTouchBarItemPriority, NSTouchBarItemPriorityHigh, + NSTouchBarItemPriorityLow, NSTouchBarItemPriorityNormal, +}; +pub use self::__NSTrackingArea::{ + NSTrackingActiveAlways, NSTrackingActiveInActiveApp, NSTrackingActiveInKeyWindow, + NSTrackingActiveWhenFirstResponder, NSTrackingArea, NSTrackingAreaOptions, + NSTrackingAssumeInside, NSTrackingCursorUpdate, NSTrackingEnabledDuringMouseDrag, + NSTrackingInVisibleRect, NSTrackingMouseEnteredAndExited, NSTrackingMouseMoved, +}; +pub use self::__NSTrackingSeparatorToolbarItem::NSTrackingSeparatorToolbarItem; +pub use self::__NSTreeController::NSTreeController; +pub use self::__NSTreeNode::NSTreeNode; +pub use self::__NSTypesetter::{ + NSTypesetter, NSTypesetterContainerBreakAction, NSTypesetterControlCharacterAction, + NSTypesetterHorizontalTabAction, NSTypesetterLineBreakAction, NSTypesetterParagraphBreakAction, + NSTypesetterWhitespaceAction, NSTypesetterZeroAdvancementAction, +}; +pub use self::__NSUserActivity::{NSUserActivityDocumentURLKey, NSUserActivityRestoring}; +pub use self::__NSUserDefaultsController::NSUserDefaultsController; +pub use self::__NSUserInterfaceCompression::{ + NSUserInterfaceCompression, NSUserInterfaceCompressionOptions, +}; +pub use self::__NSUserInterfaceItemIdentification::{ + NSUserInterfaceItemIdentification, NSUserInterfaceItemIdentifier, +}; +pub use self::__NSUserInterfaceItemSearching::NSUserInterfaceItemSearching; +pub use self::__NSUserInterfaceLayout::{ + NSUserInterfaceLayoutDirection, NSUserInterfaceLayoutDirectionLeftToRight, + NSUserInterfaceLayoutDirectionRightToLeft, NSUserInterfaceLayoutOrientation, + NSUserInterfaceLayoutOrientationHorizontal, NSUserInterfaceLayoutOrientationVertical, +}; +pub use self::__NSUserInterfaceValidation::{ + NSUserInterfaceValidations, NSValidatedUserInterfaceItem, +}; +pub use self::__NSView::{ + NSAutoresizingMaskOptions, NSBezelBorder, NSBorderType, NSDefinitionOptionKey, + NSDefinitionPresentationType, NSDefinitionPresentationTypeDictionaryApplication, + NSDefinitionPresentationTypeKey, NSDefinitionPresentationTypeOverlay, + NSFullScreenModeAllScreens, NSFullScreenModeApplicationPresentationOptions, + NSFullScreenModeSetting, NSFullScreenModeWindowLevel, NSGrooveBorder, NSLineBorder, NSNoBorder, + NSToolTipTag, NSTrackingRectTag, NSView, NSViewBoundsDidChangeNotification, + NSViewDidUpdateTrackingAreasNotification, NSViewFocusDidChangeNotification, + NSViewFrameDidChangeNotification, NSViewFullScreenModeOptionKey, + NSViewGlobalFrameDidChangeNotification, NSViewHeightSizable, NSViewLayerContentScaleDelegate, + NSViewLayerContentsPlacement, NSViewLayerContentsPlacementBottom, + NSViewLayerContentsPlacementBottomLeft, NSViewLayerContentsPlacementBottomRight, + NSViewLayerContentsPlacementCenter, NSViewLayerContentsPlacementLeft, + NSViewLayerContentsPlacementRight, NSViewLayerContentsPlacementScaleAxesIndependently, + NSViewLayerContentsPlacementScaleProportionallyToFill, + NSViewLayerContentsPlacementScaleProportionallyToFit, NSViewLayerContentsPlacementTop, + NSViewLayerContentsPlacementTopLeft, NSViewLayerContentsPlacementTopRight, + NSViewLayerContentsRedrawBeforeViewResize, NSViewLayerContentsRedrawCrossfade, + NSViewLayerContentsRedrawDuringViewResize, NSViewLayerContentsRedrawNever, + NSViewLayerContentsRedrawOnSetNeedsDisplay, NSViewLayerContentsRedrawPolicy, NSViewMaxXMargin, + NSViewMaxYMargin, NSViewMinXMargin, NSViewMinYMargin, NSViewNotSizable, NSViewToolTipOwner, + NSViewWidthSizable, +}; +pub use self::__NSViewController::{ + NSViewController, NSViewControllerPresentationAnimator, + NSViewControllerTransitionAllowUserInteraction, NSViewControllerTransitionCrossfade, + NSViewControllerTransitionNone, NSViewControllerTransitionOptions, + NSViewControllerTransitionSlideBackward, NSViewControllerTransitionSlideDown, + NSViewControllerTransitionSlideForward, NSViewControllerTransitionSlideLeft, + NSViewControllerTransitionSlideRight, NSViewControllerTransitionSlideUp, +}; +pub use self::__NSVisualEffectView::{ + NSVisualEffectBlendingMode, NSVisualEffectBlendingModeBehindWindow, + NSVisualEffectBlendingModeWithinWindow, NSVisualEffectMaterial, + NSVisualEffectMaterialAppearanceBased, NSVisualEffectMaterialContentBackground, + NSVisualEffectMaterialDark, NSVisualEffectMaterialFullScreenUI, + NSVisualEffectMaterialHUDWindow, NSVisualEffectMaterialHeaderView, NSVisualEffectMaterialLight, + NSVisualEffectMaterialMediumLight, NSVisualEffectMaterialMenu, NSVisualEffectMaterialPopover, + NSVisualEffectMaterialSelection, NSVisualEffectMaterialSheet, NSVisualEffectMaterialSidebar, + NSVisualEffectMaterialTitlebar, NSVisualEffectMaterialToolTip, NSVisualEffectMaterialUltraDark, + NSVisualEffectMaterialUnderPageBackground, NSVisualEffectMaterialUnderWindowBackground, + NSVisualEffectMaterialWindowBackground, NSVisualEffectState, NSVisualEffectStateActive, + NSVisualEffectStateFollowsWindowActiveState, NSVisualEffectStateInactive, NSVisualEffectView, +}; +pub use self::__NSWindow::{ + NSAppKitVersionNumberWithCustomSheetPosition, + NSAppKitVersionNumberWithDeferredWindowDisplaySupport, NSBackingPropertyOldColorSpaceKey, + NSBackingPropertyOldScaleFactorKey, NSBorderlessWindowMask, NSClosableWindowMask, + NSDirectSelection, NSDisplayWindowRunLoopOrdering, NSDocModalWindowMask, + NSFullScreenWindowMask, NSFullSizeContentViewWindowMask, NSHUDWindowMask, + NSMiniaturizableWindowMask, NSModalResponseCancel, NSModalResponseOK, NSNonactivatingPanelMask, + NSResetCursorRectsRunLoopOrdering, NSResizableWindowMask, NSSelectingNext, NSSelectingPrevious, + NSSelectionDirection, NSTexturedBackgroundWindowMask, NSTitlebarSeparatorStyle, + NSTitlebarSeparatorStyleAutomatic, NSTitlebarSeparatorStyleLine, NSTitlebarSeparatorStyleNone, + NSTitlebarSeparatorStyleShadow, NSTitledWindowMask, NSUnifiedTitleAndToolbarWindowMask, + NSUnscaledWindowMask, NSUtilityWindowMask, NSWindow, NSWindowAnimationBehavior, + NSWindowAnimationBehaviorAlertPanel, NSWindowAnimationBehaviorDefault, + NSWindowAnimationBehaviorDocumentWindow, NSWindowAnimationBehaviorNone, + NSWindowAnimationBehaviorUtilityWindow, NSWindowBackingLocation, + NSWindowBackingLocationDefault, NSWindowBackingLocationMainMemory, + NSWindowBackingLocationVideoMemory, NSWindowButton, NSWindowCloseButton, + NSWindowCollectionBehavior, NSWindowCollectionBehaviorCanJoinAllSpaces, + NSWindowCollectionBehaviorDefault, NSWindowCollectionBehaviorFullScreenAllowsTiling, + NSWindowCollectionBehaviorFullScreenAuxiliary, + NSWindowCollectionBehaviorFullScreenDisallowsTiling, NSWindowCollectionBehaviorFullScreenNone, + NSWindowCollectionBehaviorFullScreenPrimary, NSWindowCollectionBehaviorIgnoresCycle, + NSWindowCollectionBehaviorManaged, NSWindowCollectionBehaviorMoveToActiveSpace, + NSWindowCollectionBehaviorParticipatesInCycle, NSWindowCollectionBehaviorStationary, + NSWindowCollectionBehaviorTransient, NSWindowDelegate, NSWindowDidBecomeKeyNotification, + NSWindowDidBecomeMainNotification, NSWindowDidChangeBackingPropertiesNotification, + NSWindowDidChangeOcclusionStateNotification, NSWindowDidChangeScreenNotification, + NSWindowDidChangeScreenProfileNotification, NSWindowDidDeminiaturizeNotification, + NSWindowDidEndLiveResizeNotification, NSWindowDidEndSheetNotification, + NSWindowDidEnterFullScreenNotification, NSWindowDidEnterVersionBrowserNotification, + NSWindowDidExitFullScreenNotification, NSWindowDidExitVersionBrowserNotification, + NSWindowDidExposeNotification, NSWindowDidMiniaturizeNotification, NSWindowDidMoveNotification, + NSWindowDidResignKeyNotification, NSWindowDidResignMainNotification, + NSWindowDidResizeNotification, NSWindowDidUpdateNotification, NSWindowDocumentIconButton, + NSWindowDocumentVersionsButton, NSWindowFrameAutosaveName, NSWindowFullScreenButton, + NSWindowLevel, NSWindowMiniaturizeButton, NSWindowNumberListAllApplications, + NSWindowNumberListAllSpaces, NSWindowNumberListOptions, NSWindowOcclusionState, + NSWindowOcclusionStateVisible, NSWindowPersistableFrameDescriptor, NSWindowSharingNone, + NSWindowSharingReadOnly, NSWindowSharingReadWrite, NSWindowSharingType, NSWindowStyleMask, + NSWindowStyleMaskBorderless, NSWindowStyleMaskClosable, NSWindowStyleMaskDocModalWindow, + NSWindowStyleMaskFullScreen, NSWindowStyleMaskFullSizeContentView, NSWindowStyleMaskHUDWindow, + NSWindowStyleMaskMiniaturizable, NSWindowStyleMaskNonactivatingPanel, + NSWindowStyleMaskResizable, NSWindowStyleMaskTexturedBackground, NSWindowStyleMaskTitled, + NSWindowStyleMaskUnifiedTitleAndToolbar, NSWindowStyleMaskUtilityWindow, + NSWindowTabbingIdentifier, NSWindowTabbingMode, NSWindowTabbingModeAutomatic, + NSWindowTabbingModeDisallowed, NSWindowTabbingModePreferred, NSWindowTitleHidden, + NSWindowTitleVisibility, NSWindowTitleVisible, NSWindowToolbarButton, NSWindowToolbarStyle, + NSWindowToolbarStyleAutomatic, NSWindowToolbarStyleExpanded, NSWindowToolbarStylePreference, + NSWindowToolbarStyleUnified, NSWindowToolbarStyleUnifiedCompact, NSWindowUserTabbingPreference, + NSWindowUserTabbingPreferenceAlways, NSWindowUserTabbingPreferenceInFullScreen, + NSWindowUserTabbingPreferenceManual, NSWindowWillBeginSheetNotification, + NSWindowWillCloseNotification, NSWindowWillEnterFullScreenNotification, + NSWindowWillEnterVersionBrowserNotification, NSWindowWillExitFullScreenNotification, + NSWindowWillExitVersionBrowserNotification, NSWindowWillMiniaturizeNotification, + NSWindowWillMoveNotification, NSWindowWillStartLiveResizeNotification, NSWindowZoomButton, +}; +pub use self::__NSWindowController::NSWindowController; +pub use self::__NSWindowRestoration::{ + NSApplicationDidFinishRestoringWindowsNotification, NSWindowRestoration, +}; +pub use self::__NSWindowTab::NSWindowTab; +pub use self::__NSWindowTabGroup::NSWindowTabGroup; +pub use self::__NSWorkspace::{ + NSApplicationFileType, NSDirectoryFileType, NSExclude10_4ElementsIconCreationOption, + NSExcludeQuickDrawElementsIconCreationOption, NSFilesystemFileType, NSPlainFileType, + NSShellCommandFileType, NSWorkspace, NSWorkspaceActiveSpaceDidChangeNotification, + NSWorkspaceApplicationKey, NSWorkspaceAuthorization, NSWorkspaceAuthorizationType, + NSWorkspaceAuthorizationTypeCreateSymbolicLink, NSWorkspaceAuthorizationTypeReplaceFile, + NSWorkspaceAuthorizationTypeSetAttributes, NSWorkspaceCompressOperation, + NSWorkspaceCopyOperation, NSWorkspaceDecompressOperation, NSWorkspaceDecryptOperation, + NSWorkspaceDesktopImageAllowClippingKey, NSWorkspaceDesktopImageFillColorKey, + NSWorkspaceDesktopImageOptionKey, NSWorkspaceDesktopImageScalingKey, + NSWorkspaceDestroyOperation, NSWorkspaceDidActivateApplicationNotification, + NSWorkspaceDidChangeFileLabelsNotification, NSWorkspaceDidDeactivateApplicationNotification, + NSWorkspaceDidHideApplicationNotification, NSWorkspaceDidLaunchApplicationNotification, + NSWorkspaceDidMountNotification, NSWorkspaceDidPerformFileOperationNotification, + NSWorkspaceDidRenameVolumeNotification, NSWorkspaceDidTerminateApplicationNotification, + NSWorkspaceDidUnhideApplicationNotification, NSWorkspaceDidUnmountNotification, + NSWorkspaceDidWakeNotification, NSWorkspaceDuplicateOperation, NSWorkspaceEncryptOperation, + NSWorkspaceFileOperationName, NSWorkspaceIconCreationOptions, + NSWorkspaceLaunchAllowingClassicStartup, NSWorkspaceLaunchAndHide, + NSWorkspaceLaunchAndHideOthers, NSWorkspaceLaunchAndPrint, NSWorkspaceLaunchAsync, + NSWorkspaceLaunchConfigurationAppleEvent, NSWorkspaceLaunchConfigurationArchitecture, + NSWorkspaceLaunchConfigurationArguments, NSWorkspaceLaunchConfigurationEnvironment, + NSWorkspaceLaunchConfigurationKey, NSWorkspaceLaunchDefault, + NSWorkspaceLaunchInhibitingBackgroundOnly, NSWorkspaceLaunchNewInstance, + NSWorkspaceLaunchOptions, NSWorkspaceLaunchPreferringClassic, + NSWorkspaceLaunchWithErrorPresentation, NSWorkspaceLaunchWithoutActivation, + NSWorkspaceLaunchWithoutAddingToRecents, NSWorkspaceLinkOperation, NSWorkspaceMoveOperation, + NSWorkspaceOpenConfiguration, NSWorkspaceRecycleOperation, + NSWorkspaceScreensDidSleepNotification, NSWorkspaceScreensDidWakeNotification, + NSWorkspaceSessionDidBecomeActiveNotification, NSWorkspaceSessionDidResignActiveNotification, + NSWorkspaceVolumeLocalizedNameKey, NSWorkspaceVolumeOldLocalizedNameKey, + NSWorkspaceVolumeOldURLKey, NSWorkspaceVolumeURLKey, + NSWorkspaceWillLaunchApplicationNotification, NSWorkspaceWillPowerOffNotification, + NSWorkspaceWillSleepNotification, NSWorkspaceWillUnmountNotification, +}; diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationController.rs b/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationController.rs new file mode 100644 index 000000000..31032a76f --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationController.rs @@ -0,0 +1,83 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct ASAccountAuthenticationModificationControllerDelegate; + + unsafe impl ASAccountAuthenticationModificationControllerDelegate { + #[optional] + #[method(accountAuthenticationModificationController:didSuccessfullyCompleteRequest:withUserInfo:)] + pub unsafe fn accountAuthenticationModificationController_didSuccessfullyCompleteRequest_withUserInfo( + &self, + controller: &ASAccountAuthenticationModificationController, + request: &ASAccountAuthenticationModificationRequest, + userInfo: Option<&NSDictionary>, + ); + + #[optional] + #[method(accountAuthenticationModificationController:didFailRequest:withError:)] + pub unsafe fn accountAuthenticationModificationController_didFailRequest_withError( + &self, + controller: &ASAccountAuthenticationModificationController, + request: &ASAccountAuthenticationModificationRequest, + error: &NSError, + ); + } +); + +extern_protocol!( + pub struct ASAccountAuthenticationModificationControllerPresentationContextProviding; + + unsafe impl ASAccountAuthenticationModificationControllerPresentationContextProviding { + #[method_id(@__retain_semantics Other presentationAnchorForAccountAuthenticationModificationController:)] + pub unsafe fn presentationAnchorForAccountAuthenticationModificationController( + &self, + controller: &ASAccountAuthenticationModificationController, + ) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct ASAccountAuthenticationModificationController; + + unsafe impl ClassType for ASAccountAuthenticationModificationController { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAccountAuthenticationModificationController { + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate( + &self, + ) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate( + &self, + delegate: Option<&ASAccountAuthenticationModificationControllerDelegate>, + ); + + #[method_id(@__retain_semantics Other presentationContextProvider)] + pub unsafe fn presentationContextProvider( + &self, + ) -> Option< + Id, + >; + + #[method(setPresentationContextProvider:)] + pub unsafe fn setPresentationContextProvider( + &self, + presentationContextProvider: Option< + &ASAccountAuthenticationModificationControllerPresentationContextProviding, + >, + ); + + #[method(performRequest:)] + pub unsafe fn performRequest(&self, request: &ASAccountAuthenticationModificationRequest); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationExtensionContext.rs b/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationExtensionContext.rs new file mode 100644 index 000000000..1946781ec --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationExtensionContext.rs @@ -0,0 +1,42 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAccountAuthenticationModificationExtensionContext; + + unsafe impl ClassType for ASAccountAuthenticationModificationExtensionContext { + type Super = NSExtensionContext; + } +); + +extern_methods!( + unsafe impl ASAccountAuthenticationModificationExtensionContext { + #[method(getSignInWithAppleUpgradeAuthorizationWithState:nonce:completionHandler:)] + pub unsafe fn getSignInWithAppleUpgradeAuthorizationWithState_nonce_completionHandler( + &self, + state: Option<&NSString>, + nonce: Option<&NSString>, + completionHandler: &Block<(*mut ASAuthorizationAppleIDCredential, *mut NSError), ()>, + ); + + #[method(completeUpgradeToSignInWithAppleWithUserInfo:)] + pub unsafe fn completeUpgradeToSignInWithAppleWithUserInfo( + &self, + userInfo: Option<&NSDictionary>, + ); + + #[method(completeChangePasswordRequestWithUpdatedCredential:userInfo:)] + pub unsafe fn completeChangePasswordRequestWithUpdatedCredential_userInfo( + &self, + updatedCredential: &ASPasswordCredential, + userInfo: Option<&NSDictionary>, + ); + + #[method(cancelRequestWithError:)] + pub unsafe fn cancelRequestWithError(&self, error: &NSError); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest.rs new file mode 100644 index 000000000..88453596b --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest.rs @@ -0,0 +1,37 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest; + + unsafe impl ClassType + for ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest + { + type Super = ASAccountAuthenticationModificationRequest; + } +); + +extern_methods!( + unsafe impl ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest { + #[method_id(@__retain_semantics Init initWithUser:serviceIdentifier:userInfo:)] + pub unsafe fn initWithUser_serviceIdentifier_userInfo( + this: Option>, + user: &NSString, + serviceIdentifier: &ASCredentialServiceIdentifier, + userInfo: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Other user)] + pub unsafe fn user(&self) -> Id; + + #[method_id(@__retain_semantics Other serviceIdentifier)] + pub unsafe fn serviceIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationRequest.rs new file mode 100644 index 000000000..93508f6ad --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationRequest.rs @@ -0,0 +1,18 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAccountAuthenticationModificationRequest; + + unsafe impl ClassType for ASAccountAuthenticationModificationRequest { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAccountAuthenticationModificationRequest {} +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest.rs new file mode 100644 index 000000000..572a20816 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest.rs @@ -0,0 +1,37 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest; + + unsafe impl ClassType + for ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest + { + type Super = ASAccountAuthenticationModificationRequest; + } +); + +extern_methods!( + unsafe impl ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest { + #[method_id(@__retain_semantics Init initWithUser:serviceIdentifier:userInfo:)] + pub unsafe fn initWithUser_serviceIdentifier_userInfo( + this: Option>, + user: &NSString, + serviceIdentifier: &ASCredentialServiceIdentifier, + userInfo: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Other user)] + pub unsafe fn user(&self) -> Id; + + #[method_id(@__retain_semantics Other serviceIdentifier)] + pub unsafe fn serviceIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationViewController.rs b/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationViewController.rs new file mode 100644 index 000000000..c78a0f383 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAccountAuthenticationModificationViewController.rs @@ -0,0 +1,60 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAccountAuthenticationModificationViewController; + + unsafe impl ClassType for ASAccountAuthenticationModificationViewController { + type Super = ASViewController; + } +); + +extern_methods!( + unsafe impl ASAccountAuthenticationModificationViewController { + #[method_id(@__retain_semantics Other extensionContext)] + pub unsafe fn extensionContext( + &self, + ) -> Id; + + #[method(convertAccountToSignInWithAppleWithoutUserInteractionForServiceIdentifier:existingCredential:userInfo:)] + pub unsafe fn convertAccountToSignInWithAppleWithoutUserInteractionForServiceIdentifier_existingCredential_userInfo( + &self, + serviceIdentifier: &ASCredentialServiceIdentifier, + existingCredential: &ASPasswordCredential, + userInfo: Option<&NSDictionary>, + ); + + #[method(prepareInterfaceToConvertAccountToSignInWithAppleForServiceIdentifier:existingCredential:userInfo:)] + pub unsafe fn prepareInterfaceToConvertAccountToSignInWithAppleForServiceIdentifier_existingCredential_userInfo( + &self, + serviceIdentifier: &ASCredentialServiceIdentifier, + existingCredential: &ASPasswordCredential, + userInfo: Option<&NSDictionary>, + ); + + #[method(changePasswordWithoutUserInteractionForServiceIdentifier:existingCredential:newPassword:userInfo:)] + pub unsafe fn changePasswordWithoutUserInteractionForServiceIdentifier_existingCredential_newPassword_userInfo( + &self, + serviceIdentifier: &ASCredentialServiceIdentifier, + existingCredential: &ASPasswordCredential, + newPassword: &NSString, + userInfo: Option<&NSDictionary>, + ); + + #[method(prepareInterfaceToChangePasswordForServiceIdentifier:existingCredential:newPassword:userInfo:)] + pub unsafe fn prepareInterfaceToChangePasswordForServiceIdentifier_existingCredential_newPassword_userInfo( + &self, + serviceIdentifier: &ASCredentialServiceIdentifier, + existingCredential: &ASPasswordCredential, + newPassword: &NSString, + userInfo: Option<&NSDictionary>, + ); + + #[method(cancelRequest)] + pub unsafe fn cancelRequest(&self); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorization.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorization.rs new file mode 100644 index 000000000..4d6e1f4dd --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorization.rs @@ -0,0 +1,36 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +pub type ASAuthorizationScope = NSString; + +extern_static!(ASAuthorizationScopeFullName: &'static ASAuthorizationScope); + +extern_static!(ASAuthorizationScopeEmail: &'static ASAuthorizationScope); + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorization; + + unsafe impl ClassType for ASAuthorization { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorization { + #[method_id(@__retain_semantics Other provider)] + pub unsafe fn provider(&self) -> Id; + + #[method_id(@__retain_semantics Other credential)] + pub unsafe fn credential(&self) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationAppleIDButton.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationAppleIDButton.rs new file mode 100644 index 000000000..296ea137d --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationAppleIDButton.rs @@ -0,0 +1,56 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum ASAuthorizationAppleIDButtonType { + ASAuthorizationAppleIDButtonTypeSignIn = 0, + ASAuthorizationAppleIDButtonTypeContinue = 1, + ASAuthorizationAppleIDButtonTypeSignUp = 2, + ASAuthorizationAppleIDButtonTypeDefault = ASAuthorizationAppleIDButtonTypeSignIn, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum ASAuthorizationAppleIDButtonStyle { + ASAuthorizationAppleIDButtonStyleWhite = 0, + ASAuthorizationAppleIDButtonStyleWhiteOutline = 1, + ASAuthorizationAppleIDButtonStyleBlack = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationAppleIDButton; + + unsafe impl ClassType for ASAuthorizationAppleIDButton { + type Super = ASControl; + } +); + +extern_methods!( + unsafe impl ASAuthorizationAppleIDButton { + #[method_id(@__retain_semantics Other buttonWithType:style:)] + pub unsafe fn buttonWithType_style( + type_: ASAuthorizationAppleIDButtonType, + style: ASAuthorizationAppleIDButtonStyle, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithAuthorizationButtonType:authorizationButtonStyle:)] + pub unsafe fn initWithAuthorizationButtonType_authorizationButtonStyle( + this: Option>, + type_: ASAuthorizationAppleIDButtonType, + style: ASAuthorizationAppleIDButtonStyle, + ) -> Id; + + #[method(cornerRadius)] + pub unsafe fn cornerRadius(&self) -> CGFloat; + + #[method(setCornerRadius:)] + pub unsafe fn setCornerRadius(&self, cornerRadius: CGFloat); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationAppleIDCredential.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationAppleIDCredential.rs new file mode 100644 index 000000000..9f55537a8 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationAppleIDCredential.rs @@ -0,0 +1,57 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum ASUserDetectionStatus { + ASUserDetectionStatusUnsupported = 0, + ASUserDetectionStatusUnknown = 1, + ASUserDetectionStatusLikelyReal = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationAppleIDCredential; + + unsafe impl ClassType for ASAuthorizationAppleIDCredential { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationAppleIDCredential { + #[method_id(@__retain_semantics Other user)] + pub unsafe fn user(&self) -> Id; + + #[method_id(@__retain_semantics Other state)] + pub unsafe fn state(&self) -> Option>; + + #[method_id(@__retain_semantics Other authorizedScopes)] + pub unsafe fn authorizedScopes(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other authorizationCode)] + pub unsafe fn authorizationCode(&self) -> Option>; + + #[method_id(@__retain_semantics Other identityToken)] + pub unsafe fn identityToken(&self) -> Option>; + + #[method_id(@__retain_semantics Other email)] + pub unsafe fn email(&self) -> Option>; + + #[method_id(@__retain_semantics Other fullName)] + pub unsafe fn fullName(&self) -> Option>; + + #[method(realUserStatus)] + pub unsafe fn realUserStatus(&self) -> ASUserDetectionStatus; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationAppleIDProvider.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationAppleIDProvider.rs new file mode 100644 index 000000000..4823c960a --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationAppleIDProvider.rs @@ -0,0 +1,42 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum ASAuthorizationAppleIDProviderCredentialState { + ASAuthorizationAppleIDProviderCredentialRevoked = 0, + ASAuthorizationAppleIDProviderCredentialAuthorized = 1, + ASAuthorizationAppleIDProviderCredentialNotFound = 2, + ASAuthorizationAppleIDProviderCredentialTransferred = 3, + } +); + +extern_static!( + ASAuthorizationAppleIDProviderCredentialRevokedNotification: &'static NSNotificationName +); + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationAppleIDProvider; + + unsafe impl ClassType for ASAuthorizationAppleIDProvider { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationAppleIDProvider { + #[method_id(@__retain_semantics Other createRequest)] + pub unsafe fn createRequest(&self) -> Id; + + #[method(getCredentialStateForUserID:completion:)] + pub unsafe fn getCredentialStateForUserID_completion( + &self, + userID: &NSString, + completion: &Block<(ASAuthorizationAppleIDProviderCredentialState, *mut NSError), ()>, + ); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationAppleIDRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationAppleIDRequest.rs new file mode 100644 index 000000000..67d38b40b --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationAppleIDRequest.rs @@ -0,0 +1,24 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationAppleIDRequest; + + unsafe impl ClassType for ASAuthorizationAppleIDRequest { + type Super = ASAuthorizationOpenIDRequest; + } +); + +extern_methods!( + unsafe impl ASAuthorizationAppleIDRequest { + #[method_id(@__retain_semantics Other user)] + pub unsafe fn user(&self) -> Option>; + + #[method(setUser:)] + pub unsafe fn setUser(&self, user: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationController.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationController.rs new file mode 100644 index 000000000..003700eeb --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationController.rs @@ -0,0 +1,108 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct ASAuthorizationControllerDelegate; + + unsafe impl ASAuthorizationControllerDelegate { + #[optional] + #[method(authorizationController:didCompleteWithAuthorization:)] + pub unsafe fn authorizationController_didCompleteWithAuthorization( + &self, + controller: &ASAuthorizationController, + authorization: &ASAuthorization, + ); + + #[optional] + #[method(authorizationController:didCompleteWithError:)] + pub unsafe fn authorizationController_didCompleteWithError( + &self, + controller: &ASAuthorizationController, + error: &NSError, + ); + + #[optional] + #[method(authorizationController:didCompleteWithCustomMethod:)] + pub unsafe fn authorizationController_didCompleteWithCustomMethod( + &self, + controller: &ASAuthorizationController, + method: &ASAuthorizationCustomMethod, + ); + } +); + +extern_protocol!( + pub struct ASAuthorizationControllerPresentationContextProviding; + + unsafe impl ASAuthorizationControllerPresentationContextProviding { + #[method_id(@__retain_semantics Other presentationAnchorForAuthorizationController:)] + pub unsafe fn presentationAnchorForAuthorizationController( + &self, + controller: &ASAuthorizationController, + ) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationController; + + unsafe impl ClassType for ASAuthorizationController { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationController { + #[method_id(@__retain_semantics Other authorizationRequests)] + pub unsafe fn authorizationRequests(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&ASAuthorizationControllerDelegate>); + + #[method_id(@__retain_semantics Other presentationContextProvider)] + pub unsafe fn presentationContextProvider( + &self, + ) -> Option>; + + #[method(setPresentationContextProvider:)] + pub unsafe fn setPresentationContextProvider( + &self, + presentationContextProvider: Option< + &ASAuthorizationControllerPresentationContextProviding, + >, + ); + + #[method_id(@__retain_semantics Other customAuthorizationMethods)] + pub unsafe fn customAuthorizationMethods( + &self, + ) -> Id, Shared>; + + #[method(setCustomAuthorizationMethods:)] + pub unsafe fn setCustomAuthorizationMethods( + &self, + customAuthorizationMethods: &NSArray, + ); + + #[method_id(@__retain_semantics Init initWithAuthorizationRequests:)] + pub unsafe fn initWithAuthorizationRequests( + this: Option>, + authorizationRequests: &NSArray, + ) -> Id; + + #[method(performRequests)] + pub unsafe fn performRequests(&self); + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationCredential.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationCredential.rs new file mode 100644 index 000000000..3d5b5fde2 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationCredential.rs @@ -0,0 +1,11 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct ASAuthorizationCredential; + + unsafe impl ASAuthorizationCredential {} +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationCustomMethod.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationCustomMethod.rs new file mode 100644 index 000000000..e940e81a5 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationCustomMethod.rs @@ -0,0 +1,15 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +pub type ASAuthorizationCustomMethod = NSString; + +extern_static!( + ASAuthorizationCustomMethodVideoSubscriberAccount: &'static ASAuthorizationCustomMethod +); + +extern_static!(ASAuthorizationCustomMethodRestorePurchase: &'static ASAuthorizationCustomMethod); + +extern_static!(ASAuthorizationCustomMethodOther: &'static ASAuthorizationCustomMethod); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationError.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationError.rs new file mode 100644 index 000000000..9666b3d24 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationError.rs @@ -0,0 +1,19 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_static!(ASAuthorizationErrorDomain: &'static NSErrorDomain); + +ns_error_enum!( + #[underlying(NSInteger)] + pub enum ASAuthorizationError { + ASAuthorizationErrorUnknown = 1000, + ASAuthorizationErrorCanceled = 1001, + ASAuthorizationErrorInvalidResponse = 1002, + ASAuthorizationErrorNotHandled = 1003, + ASAuthorizationErrorFailed = 1004, + ASAuthorizationErrorNotInteractive = 1005, + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationOpenIDRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationOpenIDRequest.rs new file mode 100644 index 000000000..de5f37cc7 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationOpenIDRequest.rs @@ -0,0 +1,58 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +pub type ASAuthorizationOpenIDOperation = NSString; + +extern_static!(ASAuthorizationOperationImplicit: &'static ASAuthorizationOpenIDOperation); + +extern_static!(ASAuthorizationOperationLogin: &'static ASAuthorizationOpenIDOperation); + +extern_static!(ASAuthorizationOperationRefresh: &'static ASAuthorizationOpenIDOperation); + +extern_static!(ASAuthorizationOperationLogout: &'static ASAuthorizationOpenIDOperation); + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationOpenIDRequest; + + unsafe impl ClassType for ASAuthorizationOpenIDRequest { + type Super = ASAuthorizationRequest; + } +); + +extern_methods!( + unsafe impl ASAuthorizationOpenIDRequest { + #[method_id(@__retain_semantics Other requestedScopes)] + pub unsafe fn requestedScopes(&self) -> Option, Shared>>; + + #[method(setRequestedScopes:)] + pub unsafe fn setRequestedScopes( + &self, + requestedScopes: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other state)] + pub unsafe fn state(&self) -> Option>; + + #[method(setState:)] + pub unsafe fn setState(&self, state: Option<&NSString>); + + #[method_id(@__retain_semantics Other nonce)] + pub unsafe fn nonce(&self) -> Option>; + + #[method(setNonce:)] + pub unsafe fn setNonce(&self, nonce: Option<&NSString>); + + #[method_id(@__retain_semantics Other requestedOperation)] + pub unsafe fn requestedOperation(&self) -> Id; + + #[method(setRequestedOperation:)] + pub unsafe fn setRequestedOperation( + &self, + requestedOperation: &ASAuthorizationOpenIDOperation, + ); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPasswordProvider.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPasswordProvider.rs new file mode 100644 index 000000000..9304710ce --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPasswordProvider.rs @@ -0,0 +1,21 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationPasswordProvider; + + unsafe impl ClassType for ASAuthorizationPasswordProvider { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationPasswordProvider { + #[method_id(@__retain_semantics Other createRequest)] + pub unsafe fn createRequest(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPasswordRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPasswordRequest.rs new file mode 100644 index 000000000..85188c110 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPasswordRequest.rs @@ -0,0 +1,18 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationPasswordRequest; + + unsafe impl ClassType for ASAuthorizationPasswordRequest { + type Super = ASAuthorizationRequest; + } +); + +extern_methods!( + unsafe impl ASAuthorizationPasswordRequest {} +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialAssertion.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialAssertion.rs new file mode 100644 index 000000000..78b1c65f0 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialAssertion.rs @@ -0,0 +1,24 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationPlatformPublicKeyCredentialAssertion; + + unsafe impl ClassType for ASAuthorizationPlatformPublicKeyCredentialAssertion { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationPlatformPublicKeyCredentialAssertion { + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialAssertionRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialAssertionRequest.rs new file mode 100644 index 000000000..6a91930f8 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialAssertionRequest.rs @@ -0,0 +1,35 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationPlatformPublicKeyCredentialAssertionRequest; + + unsafe impl ClassType for ASAuthorizationPlatformPublicKeyCredentialAssertionRequest { + type Super = ASAuthorizationRequest; + } +); + +extern_methods!( + unsafe impl ASAuthorizationPlatformPublicKeyCredentialAssertionRequest { + #[method_id(@__retain_semantics Other allowedCredentials)] + pub unsafe fn allowedCredentials( + &self, + ) -> Id, Shared>; + + #[method(setAllowedCredentials:)] + pub unsafe fn setAllowedCredentials( + &self, + allowedCredentials: &NSArray, + ); + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialDescriptor.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialDescriptor.rs new file mode 100644 index 000000000..ee159e199 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialDescriptor.rs @@ -0,0 +1,30 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationPlatformPublicKeyCredentialDescriptor; + + unsafe impl ClassType for ASAuthorizationPlatformPublicKeyCredentialDescriptor { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationPlatformPublicKeyCredentialDescriptor { + #[method_id(@__retain_semantics Init initWithCredentialID:)] + pub unsafe fn initWithCredentialID( + this: Option>, + credentialID: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialProvider.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialProvider.rs new file mode 100644 index 000000000..da2428577 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialProvider.rs @@ -0,0 +1,47 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationPlatformPublicKeyCredentialProvider; + + unsafe impl ClassType for ASAuthorizationPlatformPublicKeyCredentialProvider { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationPlatformPublicKeyCredentialProvider { + #[method_id(@__retain_semantics Init initWithRelyingPartyIdentifier:)] + pub unsafe fn initWithRelyingPartyIdentifier( + this: Option>, + relyingPartyIdentifier: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other createCredentialRegistrationRequestWithChallenge:name:userID:)] + pub unsafe fn createCredentialRegistrationRequestWithChallenge_name_userID( + &self, + challenge: &NSData, + name: &NSString, + userID: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Other createCredentialAssertionRequestWithChallenge:)] + pub unsafe fn createCredentialAssertionRequestWithChallenge( + &self, + challenge: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Other relyingPartyIdentifier)] + pub unsafe fn relyingPartyIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialRegistration.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialRegistration.rs new file mode 100644 index 000000000..284f9d989 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialRegistration.rs @@ -0,0 +1,24 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationPlatformPublicKeyCredentialRegistration; + + unsafe impl ClassType for ASAuthorizationPlatformPublicKeyCredentialRegistration { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationPlatformPublicKeyCredentialRegistration { + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest.rs new file mode 100644 index 000000000..8b133f923 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest.rs @@ -0,0 +1,24 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest; + + unsafe impl ClassType for ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest { + type Super = ASAuthorizationRequest; + } +); + +extern_methods!( + unsafe impl ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest { + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationProvider.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationProvider.rs new file mode 100644 index 000000000..fcee83286 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationProvider.rs @@ -0,0 +1,11 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct ASAuthorizationProvider; + + unsafe impl ASAuthorizationProvider {} +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationRequest.rs new file mode 100644 index 000000000..bf3deb8b6 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationRequest.rs @@ -0,0 +1,119 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +pub type ASAuthorizationProviderAuthorizationOperation = NSString; + +extern_static!( + ASAuthorizationProviderAuthorizationOperationConfigurationRemoved: + &'static ASAuthorizationProviderAuthorizationOperation +); + +extern_protocol!( + pub struct ASAuthorizationProviderExtensionAuthorizationRequestHandler; + + unsafe impl ASAuthorizationProviderExtensionAuthorizationRequestHandler { + #[method(beginAuthorizationWithRequest:)] + pub unsafe fn beginAuthorizationWithRequest( + &self, + request: &ASAuthorizationProviderExtensionAuthorizationRequest, + ); + + #[optional] + #[method(cancelAuthorizationWithRequest:)] + pub unsafe fn cancelAuthorizationWithRequest( + &self, + request: &ASAuthorizationProviderExtensionAuthorizationRequest, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationProviderExtensionAuthorizationRequest; + + unsafe impl ClassType for ASAuthorizationProviderExtensionAuthorizationRequest { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationProviderExtensionAuthorizationRequest { + #[method(doNotHandle)] + pub unsafe fn doNotHandle(&self); + + #[method(cancel)] + pub unsafe fn cancel(&self); + + #[method(complete)] + pub unsafe fn complete(&self); + + #[method(completeWithHTTPAuthorizationHeaders:)] + pub unsafe fn completeWithHTTPAuthorizationHeaders( + &self, + httpAuthorizationHeaders: &NSDictionary, + ); + + #[method(completeWithHTTPResponse:httpBody:)] + pub unsafe fn completeWithHTTPResponse_httpBody( + &self, + httpResponse: &NSHTTPURLResponse, + httpBody: Option<&NSData>, + ); + + #[method(completeWithAuthorizationResult:)] + pub unsafe fn completeWithAuthorizationResult( + &self, + authorizationResult: &ASAuthorizationProviderExtensionAuthorizationResult, + ); + + #[method(completeWithError:)] + pub unsafe fn completeWithError(&self, error: &NSError); + + #[method(presentAuthorizationViewControllerWithCompletion:)] + pub unsafe fn presentAuthorizationViewControllerWithCompletion( + &self, + completion: &Block<(Bool, *mut NSError), ()>, + ); + + #[method_id(@__retain_semantics Other url)] + pub unsafe fn url(&self) -> Id; + + #[method_id(@__retain_semantics Other requestedOperation)] + pub unsafe fn requestedOperation( + &self, + ) -> Id; + + #[method_id(@__retain_semantics Other httpHeaders)] + pub unsafe fn httpHeaders(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other httpBody)] + pub unsafe fn httpBody(&self) -> Id; + + #[method_id(@__retain_semantics Other realm)] + pub unsafe fn realm(&self) -> Id; + + #[method_id(@__retain_semantics Other extensionData)] + pub unsafe fn extensionData(&self) -> Id; + + #[method_id(@__retain_semantics Other callerBundleIdentifier)] + pub unsafe fn callerBundleIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Other authorizationOptions)] + pub unsafe fn authorizationOptions(&self) -> Id; + + #[method(isCallerManaged)] + pub unsafe fn isCallerManaged(&self) -> bool; + + #[method_id(@__retain_semantics Other callerTeamIdentifier)] + pub unsafe fn callerTeamIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Other localizedCallerDisplayName)] + pub unsafe fn localizedCallerDisplayName(&self) -> Id; + + #[method(isUserInterfaceEnabled)] + pub unsafe fn isUserInterfaceEnabled(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationResult.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationResult.rs new file mode 100644 index 000000000..15e7ba0ce --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationResult.rs @@ -0,0 +1,60 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationProviderExtensionAuthorizationResult; + + unsafe impl ClassType for ASAuthorizationProviderExtensionAuthorizationResult { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationProviderExtensionAuthorizationResult { + #[method_id(@__retain_semantics Init initWithHTTPAuthorizationHeaders:)] + pub unsafe fn initWithHTTPAuthorizationHeaders( + this: Option>, + httpAuthorizationHeaders: &NSDictionary, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithHTTPResponse:httpBody:)] + pub unsafe fn initWithHTTPResponse_httpBody( + this: Option>, + httpResponse: &NSHTTPURLResponse, + httpBody: Option<&NSData>, + ) -> Id; + + #[method_id(@__retain_semantics Other httpAuthorizationHeaders)] + pub unsafe fn httpAuthorizationHeaders( + &self, + ) -> Option, Shared>>; + + #[method(setHttpAuthorizationHeaders:)] + pub unsafe fn setHttpAuthorizationHeaders( + &self, + httpAuthorizationHeaders: Option<&NSDictionary>, + ); + + #[method_id(@__retain_semantics Other httpResponse)] + pub unsafe fn httpResponse(&self) -> Option>; + + #[method(setHttpResponse:)] + pub unsafe fn setHttpResponse(&self, httpResponse: Option<&NSHTTPURLResponse>); + + #[method_id(@__retain_semantics Other httpBody)] + pub unsafe fn httpBody(&self) -> Option>; + + #[method(setHttpBody:)] + pub unsafe fn setHttpBody(&self, httpBody: Option<&NSData>); + + #[method_id(@__retain_semantics Other privateKeys)] + pub unsafe fn privateKeys(&self) -> Id; + + #[method(setPrivateKeys:)] + pub unsafe fn setPrivateKeys(&self, privateKeys: &NSArray); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialAssertion.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialAssertion.rs new file mode 100644 index 000000000..c9432a36d --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialAssertion.rs @@ -0,0 +1,20 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct ASAuthorizationPublicKeyCredentialAssertion; + + unsafe impl ASAuthorizationPublicKeyCredentialAssertion { + #[method_id(@__retain_semantics Other rawAuthenticatorData)] + pub unsafe fn rawAuthenticatorData(&self) -> Id; + + #[method_id(@__retain_semantics Other userID)] + pub unsafe fn userID(&self) -> Id; + + #[method_id(@__retain_semantics Other signature)] + pub unsafe fn signature(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialAssertionRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialAssertionRequest.rs new file mode 100644 index 000000000..df37957d9 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialAssertionRequest.rs @@ -0,0 +1,45 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct ASAuthorizationPublicKeyCredentialAssertionRequest; + + unsafe impl ASAuthorizationPublicKeyCredentialAssertionRequest { + #[method_id(@__retain_semantics Other challenge)] + pub unsafe fn challenge(&self) -> Id; + + #[method(setChallenge:)] + pub unsafe fn setChallenge(&self, challenge: &NSData); + + #[method_id(@__retain_semantics Other relyingPartyIdentifier)] + pub unsafe fn relyingPartyIdentifier(&self) -> Id; + + #[method(setRelyingPartyIdentifier:)] + pub unsafe fn setRelyingPartyIdentifier(&self, relyingPartyIdentifier: &NSString); + + #[method_id(@__retain_semantics Other allowedCredentials)] + pub unsafe fn allowedCredentials( + &self, + ) -> Id, Shared>; + + #[method(setAllowedCredentials:)] + pub unsafe fn setAllowedCredentials( + &self, + allowedCredentials: &NSArray, + ); + + #[method_id(@__retain_semantics Other userVerificationPreference)] + pub unsafe fn userVerificationPreference( + &self, + ) -> Id; + + #[method(setUserVerificationPreference:)] + pub unsafe fn setUserVerificationPreference( + &self, + userVerificationPreference: &ASAuthorizationPublicKeyCredentialUserVerificationPreference, + ); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialConstants.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialConstants.rs new file mode 100644 index 000000000..39bbadd63 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialConstants.rs @@ -0,0 +1,61 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +pub type ASAuthorizationPublicKeyCredentialUserVerificationPreference = NSString; + +extern_static!( + ASAuthorizationPublicKeyCredentialUserVerificationPreferencePreferred: + Option<&'static ASAuthorizationPublicKeyCredentialUserVerificationPreference> +); + +extern_static!( + ASAuthorizationPublicKeyCredentialUserVerificationPreferenceRequired: + Option<&'static ASAuthorizationPublicKeyCredentialUserVerificationPreference> +); + +extern_static!( + ASAuthorizationPublicKeyCredentialUserVerificationPreferenceDiscouraged: + Option<&'static ASAuthorizationPublicKeyCredentialUserVerificationPreference> +); + +pub type ASAuthorizationPublicKeyCredentialAttestationKind = NSString; + +extern_static!( + ASAuthorizationPublicKeyCredentialAttestationKindNone: + Option<&'static ASAuthorizationPublicKeyCredentialAttestationKind> +); + +extern_static!( + ASAuthorizationPublicKeyCredentialAttestationKindDirect: + Option<&'static ASAuthorizationPublicKeyCredentialAttestationKind> +); + +extern_static!( + ASAuthorizationPublicKeyCredentialAttestationKindIndirect: + Option<&'static ASAuthorizationPublicKeyCredentialAttestationKind> +); + +extern_static!( + ASAuthorizationPublicKeyCredentialAttestationKindEnterprise: + Option<&'static ASAuthorizationPublicKeyCredentialAttestationKind> +); + +pub type ASAuthorizationPublicKeyCredentialResidentKeyPreference = NSString; + +extern_static!( + ASAuthorizationPublicKeyCredentialResidentKeyPreferenceDiscouraged: + Option<&'static ASAuthorizationPublicKeyCredentialResidentKeyPreference> +); + +extern_static!( + ASAuthorizationPublicKeyCredentialResidentKeyPreferencePreferred: + Option<&'static ASAuthorizationPublicKeyCredentialResidentKeyPreference> +); + +extern_static!( + ASAuthorizationPublicKeyCredentialResidentKeyPreferenceRequired: + Option<&'static ASAuthorizationPublicKeyCredentialResidentKeyPreference> +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialDescriptor.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialDescriptor.rs new file mode 100644 index 000000000..347d8e57d --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialDescriptor.rs @@ -0,0 +1,17 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct ASAuthorizationPublicKeyCredentialDescriptor; + + unsafe impl ASAuthorizationPublicKeyCredentialDescriptor { + #[method_id(@__retain_semantics Other credentialID)] + pub unsafe fn credentialID(&self) -> Id; + + #[method(setCredentialID:)] + pub unsafe fn setCredentialID(&self, credentialID: &NSData); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialParameters.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialParameters.rs new file mode 100644 index 000000000..33c638e1f --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialParameters.rs @@ -0,0 +1,33 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationPublicKeyCredentialParameters; + + unsafe impl ClassType for ASAuthorizationPublicKeyCredentialParameters { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationPublicKeyCredentialParameters { + #[method_id(@__retain_semantics Init initWithAlgorithm:)] + pub unsafe fn initWithAlgorithm( + this: Option>, + algorithm: ASCOSEAlgorithmIdentifier, + ) -> Id; + + #[method(algorithm)] + pub unsafe fn algorithm(&self) -> ASCOSEAlgorithmIdentifier; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialRegistration.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialRegistration.rs new file mode 100644 index 000000000..418a81256 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialRegistration.rs @@ -0,0 +1,14 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct ASAuthorizationPublicKeyCredentialRegistration; + + unsafe impl ASAuthorizationPublicKeyCredentialRegistration { + #[method_id(@__retain_semantics Other rawAttestationObject)] + pub unsafe fn rawAttestationObject(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialRegistrationRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialRegistrationRequest.rs new file mode 100644 index 000000000..d6676f129 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationPublicKeyCredentialRegistrationRequest.rs @@ -0,0 +1,60 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct ASAuthorizationPublicKeyCredentialRegistrationRequest; + + unsafe impl ASAuthorizationPublicKeyCredentialRegistrationRequest { + #[method_id(@__retain_semantics Other relyingPartyIdentifier)] + pub unsafe fn relyingPartyIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Other userID)] + pub unsafe fn userID(&self) -> Id; + + #[method(setUserID:)] + pub unsafe fn setUserID(&self, userID: &NSData); + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method(setName:)] + pub unsafe fn setName(&self, name: &NSString); + + #[method_id(@__retain_semantics Other displayName)] + pub unsafe fn displayName(&self) -> Option>; + + #[method(setDisplayName:)] + pub unsafe fn setDisplayName(&self, displayName: Option<&NSString>); + + #[method_id(@__retain_semantics Other challenge)] + pub unsafe fn challenge(&self) -> Id; + + #[method(setChallenge:)] + pub unsafe fn setChallenge(&self, challenge: &NSData); + + #[method_id(@__retain_semantics Other userVerificationPreference)] + pub unsafe fn userVerificationPreference( + &self, + ) -> Id; + + #[method(setUserVerificationPreference:)] + pub unsafe fn setUserVerificationPreference( + &self, + userVerificationPreference: &ASAuthorizationPublicKeyCredentialUserVerificationPreference, + ); + + #[method_id(@__retain_semantics Other attestationPreference)] + pub unsafe fn attestationPreference( + &self, + ) -> Id; + + #[method(setAttestationPreference:)] + pub unsafe fn setAttestationPreference( + &self, + attestationPreference: &ASAuthorizationPublicKeyCredentialAttestationKind, + ); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationRequest.rs new file mode 100644 index 000000000..3b45581ca --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationRequest.rs @@ -0,0 +1,27 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationRequest; + + unsafe impl ClassType for ASAuthorizationRequest { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationRequest { + #[method_id(@__retain_semantics Other provider)] + pub unsafe fn provider(&self) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialAssertion.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialAssertion.rs new file mode 100644 index 000000000..39773924c --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialAssertion.rs @@ -0,0 +1,24 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationSecurityKeyPublicKeyCredentialAssertion; + + unsafe impl ClassType for ASAuthorizationSecurityKeyPublicKeyCredentialAssertion { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationSecurityKeyPublicKeyCredentialAssertion { + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest.rs new file mode 100644 index 000000000..66a2dc2fe --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest.rs @@ -0,0 +1,29 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest; + + unsafe impl ClassType for ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest { + type Super = ASAuthorizationRequest; + } +); + +extern_methods!( + unsafe impl ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest { + #[method_id(@__retain_semantics Other allowedCredentials)] + pub unsafe fn allowedCredentials( + &self, + ) -> Id, Shared>; + + #[method(setAllowedCredentials:)] + pub unsafe fn setAllowedCredentials( + &self, + allowedCredentials: &NSArray, + ); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor.rs new file mode 100644 index 000000000..5cab21995 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor.rs @@ -0,0 +1,66 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +pub type ASAuthorizationSecurityKeyPublicKeyCredentialDescriptorTransport = NSString; + +extern_static!( + ASAuthorizationSecurityKeyPublicKeyCredentialDescriptorTransportUSB: + &'static ASAuthorizationSecurityKeyPublicKeyCredentialDescriptorTransport +); + +extern_static!( + ASAuthorizationSecurityKeyPublicKeyCredentialDescriptorTransportNFC: + &'static ASAuthorizationSecurityKeyPublicKeyCredentialDescriptorTransport +); + +extern_static!( + ASAuthorizationSecurityKeyPublicKeyCredentialDescriptorTransportBluetooth: + &'static ASAuthorizationSecurityKeyPublicKeyCredentialDescriptorTransport +); + +extern_fn!( + pub unsafe fn ASAuthorizationAllSupportedPublicKeyCredentialDescriptorTransports( + ) -> NonNull>; +); + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor; + + unsafe impl ClassType for ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor { + #[method_id(@__retain_semantics Init initWithCredentialID:transports:)] + pub unsafe fn initWithCredentialID_transports( + this: Option>, + credentialID: &NSData, + allowedTransports: &NSArray< + ASAuthorizationSecurityKeyPublicKeyCredentialDescriptorTransport, + >, + ) -> Id; + + #[method_id(@__retain_semantics Other transports)] + pub unsafe fn transports( + &self, + ) -> Id, Shared>; + + #[method(setTransports:)] + pub unsafe fn setTransports( + &self, + transports: &NSArray, + ); + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialProvider.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialProvider.rs new file mode 100644 index 000000000..6227b1233 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialProvider.rs @@ -0,0 +1,48 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationSecurityKeyPublicKeyCredentialProvider; + + unsafe impl ClassType for ASAuthorizationSecurityKeyPublicKeyCredentialProvider { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationSecurityKeyPublicKeyCredentialProvider { + #[method_id(@__retain_semantics Init initWithRelyingPartyIdentifier:)] + pub unsafe fn initWithRelyingPartyIdentifier( + this: Option>, + relyingPartyIdentifier: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other createCredentialRegistrationRequestWithChallenge:displayName:name:userID:)] + pub unsafe fn createCredentialRegistrationRequestWithChallenge_displayName_name_userID( + &self, + challenge: &NSData, + displayName: &NSString, + name: &NSString, + userID: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Other createCredentialAssertionRequestWithChallenge:)] + pub unsafe fn createCredentialAssertionRequestWithChallenge( + &self, + challenge: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Other relyingPartyIdentifier)] + pub unsafe fn relyingPartyIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialRegistration.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialRegistration.rs new file mode 100644 index 000000000..213e7462c --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialRegistration.rs @@ -0,0 +1,18 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationSecurityKeyPublicKeyCredentialRegistration; + + unsafe impl ClassType for ASAuthorizationSecurityKeyPublicKeyCredentialRegistration { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationSecurityKeyPublicKeyCredentialRegistration {} +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest.rs new file mode 100644 index 000000000..1abbffaf5 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest.rs @@ -0,0 +1,57 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest; + + unsafe impl ClassType for ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest { + type Super = ASAuthorizationRequest; + } +); + +extern_methods!( + unsafe impl ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest { + #[method_id(@__retain_semantics Other credentialParameters)] + pub unsafe fn credentialParameters( + &self, + ) -> Id, Shared>; + + #[method(setCredentialParameters:)] + pub unsafe fn setCredentialParameters( + &self, + credentialParameters: &NSArray, + ); + + #[method_id(@__retain_semantics Other excludedCredentials)] + pub unsafe fn excludedCredentials( + &self, + ) -> Id, Shared>; + + #[method(setExcludedCredentials:)] + pub unsafe fn setExcludedCredentials( + &self, + excludedCredentials: &NSArray, + ); + + #[method_id(@__retain_semantics Other residentKeyPreference)] + pub unsafe fn residentKeyPreference( + &self, + ) -> Id; + + #[method(setResidentKeyPreference:)] + pub unsafe fn setResidentKeyPreference( + &self, + residentKeyPreference: &ASAuthorizationPublicKeyCredentialResidentKeyPreference, + ); + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSingleSignOnCredential.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSingleSignOnCredential.rs new file mode 100644 index 000000000..fb9ef22fa --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSingleSignOnCredential.rs @@ -0,0 +1,42 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationSingleSignOnCredential; + + unsafe impl ClassType for ASAuthorizationSingleSignOnCredential { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationSingleSignOnCredential { + #[method_id(@__retain_semantics Other state)] + pub unsafe fn state(&self) -> Option>; + + #[method_id(@__retain_semantics Other accessToken)] + pub unsafe fn accessToken(&self) -> Option>; + + #[method_id(@__retain_semantics Other identityToken)] + pub unsafe fn identityToken(&self) -> Option>; + + #[method_id(@__retain_semantics Other authorizedScopes)] + pub unsafe fn authorizedScopes(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other authenticatedResponse)] + pub unsafe fn authenticatedResponse(&self) -> Option>; + + #[method_id(@__retain_semantics Other privateKeys)] + pub unsafe fn privateKeys(&self) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSingleSignOnProvider.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSingleSignOnProvider.rs new file mode 100644 index 000000000..19eec85ad --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSingleSignOnProvider.rs @@ -0,0 +1,37 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationSingleSignOnProvider; + + unsafe impl ClassType for ASAuthorizationSingleSignOnProvider { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASAuthorizationSingleSignOnProvider { + #[method_id(@__retain_semantics Other authorizationProviderWithIdentityProviderURL:)] + pub unsafe fn authorizationProviderWithIdentityProviderURL(url: &NSURL) + -> Id; + + #[method_id(@__retain_semantics Other createRequest)] + pub unsafe fn createRequest(&self) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other url)] + pub unsafe fn url(&self) -> Id; + + #[method(canPerformAuthorization)] + pub unsafe fn canPerformAuthorization(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSingleSignOnRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSingleSignOnRequest.rs new file mode 100644 index 000000000..551afded9 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASAuthorizationSingleSignOnRequest.rs @@ -0,0 +1,33 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASAuthorizationSingleSignOnRequest; + + unsafe impl ClassType for ASAuthorizationSingleSignOnRequest { + type Super = ASAuthorizationOpenIDRequest; + } +); + +extern_methods!( + unsafe impl ASAuthorizationSingleSignOnRequest { + #[method_id(@__retain_semantics Other authorizationOptions)] + pub unsafe fn authorizationOptions(&self) -> Id, Shared>; + + #[method(setAuthorizationOptions:)] + pub unsafe fn setAuthorizationOptions( + &self, + authorizationOptions: &NSArray, + ); + + #[method(isUserInterfaceEnabled)] + pub unsafe fn isUserInterfaceEnabled(&self) -> bool; + + #[method(setUserInterfaceEnabled:)] + pub unsafe fn setUserInterfaceEnabled(&self, userInterfaceEnabled: bool); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASCOSEConstants.rs b/crates/icrate/src/generated/AuthenticationServices/ASCOSEConstants.rs new file mode 100644 index 000000000..a2a8a2eef --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASCOSEConstants.rs @@ -0,0 +1,13 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +pub type ASCOSEAlgorithmIdentifier = NSInteger; + +extern_static!(ASCOSEAlgorithmIdentifierES256: ASCOSEAlgorithmIdentifier = -7); + +pub type ASCOSEEllipticCurveIdentifier = NSInteger; + +extern_static!(ASCOSEEllipticCurveIdentifierP256: ASCOSEEllipticCurveIdentifier = 1); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASCredentialIdentityStore.rs b/crates/icrate/src/generated/AuthenticationServices/ASCredentialIdentityStore.rs new file mode 100644 index 000000000..bea058d50 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASCredentialIdentityStore.rs @@ -0,0 +1,68 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_static!(ASCredentialIdentityStoreErrorDomain: &'static NSErrorDomain); + +ns_error_enum!( + #[underlying(NSInteger)] + pub enum ASCredentialIdentityStoreErrorCode { + ASCredentialIdentityStoreErrorCodeInternalError = 0, + ASCredentialIdentityStoreErrorCodeStoreDisabled = 1, + ASCredentialIdentityStoreErrorCodeStoreBusy = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct ASCredentialIdentityStore; + + unsafe impl ClassType for ASCredentialIdentityStore { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASCredentialIdentityStore { + #[method_id(@__retain_semantics Other sharedStore)] + pub unsafe fn sharedStore() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(getCredentialIdentityStoreStateWithCompletion:)] + pub unsafe fn getCredentialIdentityStoreStateWithCompletion( + &self, + completion: &Block<(NonNull,), ()>, + ); + + #[method(saveCredentialIdentities:completion:)] + pub unsafe fn saveCredentialIdentities_completion( + &self, + credentialIdentities: &NSArray, + completion: Option<&Block<(Bool, *mut NSError), ()>>, + ); + + #[method(removeCredentialIdentities:completion:)] + pub unsafe fn removeCredentialIdentities_completion( + &self, + credentialIdentities: &NSArray, + completion: Option<&Block<(Bool, *mut NSError), ()>>, + ); + + #[method(removeAllCredentialIdentitiesWithCompletion:)] + pub unsafe fn removeAllCredentialIdentitiesWithCompletion( + &self, + completion: Option<&Block<(Bool, *mut NSError), ()>>, + ); + + #[method(replaceCredentialIdentitiesWithIdentities:completion:)] + pub unsafe fn replaceCredentialIdentitiesWithIdentities_completion( + &self, + newCredentialIdentities: &NSArray, + completion: Option<&Block<(Bool, *mut NSError), ()>>, + ); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASCredentialIdentityStoreState.rs b/crates/icrate/src/generated/AuthenticationServices/ASCredentialIdentityStoreState.rs new file mode 100644 index 000000000..662441f23 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASCredentialIdentityStoreState.rs @@ -0,0 +1,24 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASCredentialIdentityStoreState; + + unsafe impl ClassType for ASCredentialIdentityStoreState { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASCredentialIdentityStoreState { + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(supportsIncrementalUpdates)] + pub unsafe fn supportsIncrementalUpdates(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASCredentialProviderExtensionContext.rs b/crates/icrate/src/generated/AuthenticationServices/ASCredentialProviderExtensionContext.rs new file mode 100644 index 000000000..8b0ef0f5f --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASCredentialProviderExtensionContext.rs @@ -0,0 +1,38 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASCredentialProviderExtensionContext; + + unsafe impl ClassType for ASCredentialProviderExtensionContext { + type Super = NSExtensionContext; + } +); + +extern_methods!( + unsafe impl ASCredentialProviderExtensionContext { + #[method(completeRequestWithSelectedCredential:completionHandler:)] + pub unsafe fn completeRequestWithSelectedCredential_completionHandler( + &self, + credential: &ASPasswordCredential, + completionHandler: Option<&Block<(Bool,), ()>>, + ); + + #[method(completeExtensionConfigurationRequest)] + pub unsafe fn completeExtensionConfigurationRequest(&self); + + #[method(completeRequestReturningItems:completionHandler:)] + pub unsafe fn completeRequestReturningItems_completionHandler( + &self, + items: Option<&NSArray>, + completionHandler: Option<&Block<(Bool,), ()>>, + ); + + #[method(cancelRequestWithError:)] + pub unsafe fn cancelRequestWithError(&self, error: &NSError); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASCredentialProviderViewController.rs b/crates/icrate/src/generated/AuthenticationServices/ASCredentialProviderViewController.rs new file mode 100644 index 000000000..fc48fa9f5 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASCredentialProviderViewController.rs @@ -0,0 +1,42 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASCredentialProviderViewController; + + unsafe impl ClassType for ASCredentialProviderViewController { + type Super = ASViewController; + } +); + +extern_methods!( + unsafe impl ASCredentialProviderViewController { + #[method_id(@__retain_semantics Other extensionContext)] + pub unsafe fn extensionContext(&self) -> Id; + + #[method(prepareCredentialListForServiceIdentifiers:)] + pub unsafe fn prepareCredentialListForServiceIdentifiers( + &self, + serviceIdentifiers: &NSArray, + ); + + #[method(provideCredentialWithoutUserInteractionForIdentity:)] + pub unsafe fn provideCredentialWithoutUserInteractionForIdentity( + &self, + credentialIdentity: &ASPasswordCredentialIdentity, + ); + + #[method(prepareInterfaceToProvideCredentialForIdentity:)] + pub unsafe fn prepareInterfaceToProvideCredentialForIdentity( + &self, + credentialIdentity: &ASPasswordCredentialIdentity, + ); + + #[method(prepareInterfaceForExtensionConfiguration)] + pub unsafe fn prepareInterfaceForExtensionConfiguration(&self); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASCredentialServiceIdentifier.rs b/crates/icrate/src/generated/AuthenticationServices/ASCredentialServiceIdentifier.rs new file mode 100644 index 000000000..0c276217c --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASCredentialServiceIdentifier.rs @@ -0,0 +1,39 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum ASCredentialServiceIdentifierType { + ASCredentialServiceIdentifierTypeDomain = 0, + ASCredentialServiceIdentifierTypeURL = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct ASCredentialServiceIdentifier; + + unsafe impl ClassType for ASCredentialServiceIdentifier { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASCredentialServiceIdentifier { + #[method_id(@__retain_semantics Init initWithIdentifier:type:)] + pub unsafe fn initWithIdentifier_type( + this: Option>, + identifier: &NSString, + type_: ASCredentialServiceIdentifierType, + ) -> Id; + + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Id; + + #[method(type)] + pub unsafe fn type_(&self) -> ASCredentialServiceIdentifierType; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASExtensionErrors.rs b/crates/icrate/src/generated/AuthenticationServices/ASExtensionErrors.rs new file mode 100644 index 000000000..744f634c7 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASExtensionErrors.rs @@ -0,0 +1,19 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_static!(ASExtensionErrorDomain: Option<&'static NSErrorDomain>); + +ns_error_enum!( + #[underlying(NSInteger)] + pub enum ASExtensionErrorCode { + ASExtensionErrorCodeFailed = 0, + ASExtensionErrorCodeUserCanceled = 1, + ASExtensionErrorCodeUserInteractionRequired = 100, + ASExtensionErrorCodeCredentialIdentityNotFound = 101, + } +); + +extern_static!(ASExtensionLocalizedFailureReasonErrorKey: Option<&'static NSErrorUserInfoKey>); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASFoundation.rs b/crates/icrate/src/generated/AuthenticationServices/ASFoundation.rs new file mode 100644 index 000000000..d378a60b0 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASFoundation.rs @@ -0,0 +1,5 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; diff --git a/crates/icrate/src/generated/AuthenticationServices/ASPasswordCredential.rs b/crates/icrate/src/generated/AuthenticationServices/ASPasswordCredential.rs new file mode 100644 index 000000000..c6478e37d --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASPasswordCredential.rs @@ -0,0 +1,37 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASPasswordCredential; + + unsafe impl ClassType for ASPasswordCredential { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASPasswordCredential { + #[method_id(@__retain_semantics Init initWithUser:password:)] + pub unsafe fn initWithUser_password( + this: Option>, + user: &NSString, + password: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other credentialWithUser:password:)] + pub unsafe fn credentialWithUser_password( + user: &NSString, + password: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other user)] + pub unsafe fn user(&self) -> Id; + + #[method_id(@__retain_semantics Other password)] + pub unsafe fn password(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASPasswordCredentialIdentity.rs b/crates/icrate/src/generated/AuthenticationServices/ASPasswordCredentialIdentity.rs new file mode 100644 index 000000000..27191748e --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASPasswordCredentialIdentity.rs @@ -0,0 +1,51 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASPasswordCredentialIdentity; + + unsafe impl ClassType for ASPasswordCredentialIdentity { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASPasswordCredentialIdentity { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithServiceIdentifier:user:recordIdentifier:)] + pub unsafe fn initWithServiceIdentifier_user_recordIdentifier( + this: Option>, + serviceIdentifier: &ASCredentialServiceIdentifier, + user: &NSString, + recordIdentifier: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Other identityWithServiceIdentifier:user:recordIdentifier:)] + pub unsafe fn identityWithServiceIdentifier_user_recordIdentifier( + serviceIdentifier: &ASCredentialServiceIdentifier, + user: &NSString, + recordIdentifier: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Other serviceIdentifier)] + pub unsafe fn serviceIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Other user)] + pub unsafe fn user(&self) -> Id; + + #[method_id(@__retain_semantics Other recordIdentifier)] + pub unsafe fn recordIdentifier(&self) -> Option>; + + #[method(rank)] + pub unsafe fn rank(&self) -> NSInteger; + + #[method(setRank:)] + pub unsafe fn setRank(&self, rank: NSInteger); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASPublicKeyCredential.rs b/crates/icrate/src/generated/AuthenticationServices/ASPublicKeyCredential.rs new file mode 100644 index 000000000..d5e05029a --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASPublicKeyCredential.rs @@ -0,0 +1,17 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct ASPublicKeyCredential; + + unsafe impl ASPublicKeyCredential { + #[method_id(@__retain_semantics Other rawClientDataJSON)] + pub unsafe fn rawClientDataJSON(&self) -> Id; + + #[method_id(@__retain_semantics Other credentialID)] + pub unsafe fn credentialID(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASWebAuthenticationSession.rs b/crates/icrate/src/generated/AuthenticationServices/ASWebAuthenticationSession.rs new file mode 100644 index 000000000..e0b0af9b9 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASWebAuthenticationSession.rs @@ -0,0 +1,86 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_static!(ASWebAuthenticationSessionErrorDomain: &'static NSErrorDomain); + +ns_error_enum!( + #[underlying(NSInteger)] + pub enum ASWebAuthenticationSessionErrorCode { + ASWebAuthenticationSessionErrorCodeCanceledLogin = 1, + ASWebAuthenticationSessionErrorCodePresentationContextNotProvided = 2, + ASWebAuthenticationSessionErrorCodePresentationContextInvalid = 3, + } +); + +pub type ASWebAuthenticationSessionCompletionHandler = *mut Block<(*mut NSURL, *mut NSError), ()>; + +extern_class!( + #[derive(Debug)] + pub struct ASWebAuthenticationSession; + + unsafe impl ClassType for ASWebAuthenticationSession { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASWebAuthenticationSession { + #[method_id(@__retain_semantics Init initWithURL:callbackURLScheme:completionHandler:)] + pub unsafe fn initWithURL_callbackURLScheme_completionHandler( + this: Option>, + URL: &NSURL, + callbackURLScheme: Option<&NSString>, + completionHandler: ASWebAuthenticationSessionCompletionHandler, + ) -> Id; + + #[method_id(@__retain_semantics Other presentationContextProvider)] + pub unsafe fn presentationContextProvider( + &self, + ) -> Option>; + + #[method(setPresentationContextProvider:)] + pub unsafe fn setPresentationContextProvider( + &self, + presentationContextProvider: Option<&ASWebAuthenticationPresentationContextProviding>, + ); + + #[method(prefersEphemeralWebBrowserSession)] + pub unsafe fn prefersEphemeralWebBrowserSession(&self) -> bool; + + #[method(setPrefersEphemeralWebBrowserSession:)] + pub unsafe fn setPrefersEphemeralWebBrowserSession( + &self, + prefersEphemeralWebBrowserSession: bool, + ); + + #[method(canStart)] + pub unsafe fn canStart(&self) -> bool; + + #[method(start)] + pub unsafe fn start(&self) -> bool; + + #[method(cancel)] + pub unsafe fn cancel(&self); + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); + +extern_protocol!( + pub struct ASWebAuthenticationPresentationContextProviding; + + unsafe impl ASWebAuthenticationPresentationContextProviding { + #[method_id(@__retain_semantics Other presentationAnchorForWebAuthenticationSession:)] + pub unsafe fn presentationAnchorForWebAuthenticationSession( + &self, + session: &ASWebAuthenticationSession, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASWebAuthenticationSessionRequest.rs b/crates/icrate/src/generated/AuthenticationServices/ASWebAuthenticationSessionRequest.rs new file mode 100644 index 000000000..63b75bfcc --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASWebAuthenticationSessionRequest.rs @@ -0,0 +1,75 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct ASWebAuthenticationSessionRequestDelegate; + + unsafe impl ASWebAuthenticationSessionRequestDelegate { + #[optional] + #[method(authenticationSessionRequest:didCompleteWithCallbackURL:)] + pub unsafe fn authenticationSessionRequest_didCompleteWithCallbackURL( + &self, + authenticationSessionRequest: &ASWebAuthenticationSessionRequest, + callbackURL: &NSURL, + ); + + #[optional] + #[method(authenticationSessionRequest:didCancelWithError:)] + pub unsafe fn authenticationSessionRequest_didCancelWithError( + &self, + authenticationSessionRequest: &ASWebAuthenticationSessionRequest, + error: &NSError, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct ASWebAuthenticationSessionRequest; + + unsafe impl ClassType for ASWebAuthenticationSessionRequest { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASWebAuthenticationSessionRequest { + #[method_id(@__retain_semantics Other UUID)] + pub unsafe fn UUID(&self) -> Id; + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Id; + + #[method_id(@__retain_semantics Other callbackURLScheme)] + pub unsafe fn callbackURLScheme(&self) -> Option>; + + #[method(shouldUseEphemeralSession)] + pub unsafe fn shouldUseEphemeralSession(&self) -> bool; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate( + &self, + ) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate( + &self, + delegate: Option<&ASWebAuthenticationSessionRequestDelegate>, + ); + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(cancelWithError:)] + pub unsafe fn cancelWithError(&self, error: &NSError); + + #[method(completeWithCallbackURL:)] + pub unsafe fn completeWithCallbackURL(&self, url: &NSURL); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASWebAuthenticationSessionWebBrowserSessionHandling.rs b/crates/icrate/src/generated/AuthenticationServices/ASWebAuthenticationSessionWebBrowserSessionHandling.rs new file mode 100644 index 000000000..8a48a14f7 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASWebAuthenticationSessionWebBrowserSessionHandling.rs @@ -0,0 +1,23 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct ASWebAuthenticationSessionWebBrowserSessionHandling; + + unsafe impl ASWebAuthenticationSessionWebBrowserSessionHandling { + #[method(beginHandlingWebAuthenticationSessionRequest:)] + pub unsafe fn beginHandlingWebAuthenticationSessionRequest( + &self, + request: Option<&ASWebAuthenticationSessionRequest>, + ); + + #[method(cancelWebAuthenticationSessionRequest:)] + pub unsafe fn cancelWebAuthenticationSessionRequest( + &self, + request: Option<&ASWebAuthenticationSessionRequest>, + ); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/ASWebAuthenticationSessionWebBrowserSessionManager.rs b/crates/icrate/src/generated/AuthenticationServices/ASWebAuthenticationSessionWebBrowserSessionManager.rs new file mode 100644 index 000000000..f70bd5296 --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/ASWebAuthenticationSessionWebBrowserSessionManager.rs @@ -0,0 +1,39 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::AuthenticationServices::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct ASWebAuthenticationSessionWebBrowserSessionManager; + + unsafe impl ClassType for ASWebAuthenticationSessionWebBrowserSessionManager { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl ASWebAuthenticationSessionWebBrowserSessionManager { + #[method_id(@__retain_semantics Other sharedManager)] + pub unsafe fn sharedManager( + ) -> Id; + + #[method_id(@__retain_semantics Other sessionHandler)] + pub unsafe fn sessionHandler( + &self, + ) -> Id; + + #[method(setSessionHandler:)] + pub unsafe fn setSessionHandler( + &self, + sessionHandler: &ASWebAuthenticationSessionWebBrowserSessionHandling, + ); + + #[method(wasLaunchedByAuthenticationServices)] + pub unsafe fn wasLaunchedByAuthenticationServices(&self) -> bool; + + #[method(registerDefaultsForASWASInSetupAssistantIfNeeded)] + pub unsafe fn registerDefaultsForASWASInSetupAssistantIfNeeded(); + } +); diff --git a/crates/icrate/src/generated/AuthenticationServices/mod.rs b/crates/icrate/src/generated/AuthenticationServices/mod.rs new file mode 100644 index 000000000..4c612f87e --- /dev/null +++ b/crates/icrate/src/generated/AuthenticationServices/mod.rs @@ -0,0 +1,263 @@ +#[path = "ASAccountAuthenticationModificationController.rs"] +mod __ASAccountAuthenticationModificationController; +#[path = "ASAccountAuthenticationModificationExtensionContext.rs"] +mod __ASAccountAuthenticationModificationExtensionContext; +#[path = "ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest.rs"] +mod __ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest; +#[path = "ASAccountAuthenticationModificationRequest.rs"] +mod __ASAccountAuthenticationModificationRequest; +#[path = "ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest.rs"] +mod __ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest; +#[path = "ASAccountAuthenticationModificationViewController.rs"] +mod __ASAccountAuthenticationModificationViewController; +#[path = "ASAuthorization.rs"] +mod __ASAuthorization; +#[path = "ASAuthorizationAppleIDButton.rs"] +mod __ASAuthorizationAppleIDButton; +#[path = "ASAuthorizationAppleIDCredential.rs"] +mod __ASAuthorizationAppleIDCredential; +#[path = "ASAuthorizationAppleIDProvider.rs"] +mod __ASAuthorizationAppleIDProvider; +#[path = "ASAuthorizationAppleIDRequest.rs"] +mod __ASAuthorizationAppleIDRequest; +#[path = "ASAuthorizationController.rs"] +mod __ASAuthorizationController; +#[path = "ASAuthorizationCredential.rs"] +mod __ASAuthorizationCredential; +#[path = "ASAuthorizationCustomMethod.rs"] +mod __ASAuthorizationCustomMethod; +#[path = "ASAuthorizationError.rs"] +mod __ASAuthorizationError; +#[path = "ASAuthorizationOpenIDRequest.rs"] +mod __ASAuthorizationOpenIDRequest; +#[path = "ASAuthorizationPasswordProvider.rs"] +mod __ASAuthorizationPasswordProvider; +#[path = "ASAuthorizationPasswordRequest.rs"] +mod __ASAuthorizationPasswordRequest; +#[path = "ASAuthorizationPlatformPublicKeyCredentialAssertion.rs"] +mod __ASAuthorizationPlatformPublicKeyCredentialAssertion; +#[path = "ASAuthorizationPlatformPublicKeyCredentialAssertionRequest.rs"] +mod __ASAuthorizationPlatformPublicKeyCredentialAssertionRequest; +#[path = "ASAuthorizationPlatformPublicKeyCredentialDescriptor.rs"] +mod __ASAuthorizationPlatformPublicKeyCredentialDescriptor; +#[path = "ASAuthorizationPlatformPublicKeyCredentialProvider.rs"] +mod __ASAuthorizationPlatformPublicKeyCredentialProvider; +#[path = "ASAuthorizationPlatformPublicKeyCredentialRegistration.rs"] +mod __ASAuthorizationPlatformPublicKeyCredentialRegistration; +#[path = "ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest.rs"] +mod __ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest; +#[path = "ASAuthorizationProvider.rs"] +mod __ASAuthorizationProvider; +#[path = "ASAuthorizationProviderExtensionAuthorizationRequest.rs"] +mod __ASAuthorizationProviderExtensionAuthorizationRequest; +#[path = "ASAuthorizationProviderExtensionAuthorizationResult.rs"] +mod __ASAuthorizationProviderExtensionAuthorizationResult; +#[path = "ASAuthorizationPublicKeyCredentialAssertion.rs"] +mod __ASAuthorizationPublicKeyCredentialAssertion; +#[path = "ASAuthorizationPublicKeyCredentialAssertionRequest.rs"] +mod __ASAuthorizationPublicKeyCredentialAssertionRequest; +#[path = "ASAuthorizationPublicKeyCredentialConstants.rs"] +mod __ASAuthorizationPublicKeyCredentialConstants; +#[path = "ASAuthorizationPublicKeyCredentialDescriptor.rs"] +mod __ASAuthorizationPublicKeyCredentialDescriptor; +#[path = "ASAuthorizationPublicKeyCredentialParameters.rs"] +mod __ASAuthorizationPublicKeyCredentialParameters; +#[path = "ASAuthorizationPublicKeyCredentialRegistration.rs"] +mod __ASAuthorizationPublicKeyCredentialRegistration; +#[path = "ASAuthorizationPublicKeyCredentialRegistrationRequest.rs"] +mod __ASAuthorizationPublicKeyCredentialRegistrationRequest; +#[path = "ASAuthorizationRequest.rs"] +mod __ASAuthorizationRequest; +#[path = "ASAuthorizationSecurityKeyPublicKeyCredentialAssertion.rs"] +mod __ASAuthorizationSecurityKeyPublicKeyCredentialAssertion; +#[path = "ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest.rs"] +mod __ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest; +#[path = "ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor.rs"] +mod __ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor; +#[path = "ASAuthorizationSecurityKeyPublicKeyCredentialProvider.rs"] +mod __ASAuthorizationSecurityKeyPublicKeyCredentialProvider; +#[path = "ASAuthorizationSecurityKeyPublicKeyCredentialRegistration.rs"] +mod __ASAuthorizationSecurityKeyPublicKeyCredentialRegistration; +#[path = "ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest.rs"] +mod __ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest; +#[path = "ASAuthorizationSingleSignOnCredential.rs"] +mod __ASAuthorizationSingleSignOnCredential; +#[path = "ASAuthorizationSingleSignOnProvider.rs"] +mod __ASAuthorizationSingleSignOnProvider; +#[path = "ASAuthorizationSingleSignOnRequest.rs"] +mod __ASAuthorizationSingleSignOnRequest; +#[path = "ASCOSEConstants.rs"] +mod __ASCOSEConstants; +#[path = "ASCredentialIdentityStore.rs"] +mod __ASCredentialIdentityStore; +#[path = "ASCredentialIdentityStoreState.rs"] +mod __ASCredentialIdentityStoreState; +#[path = "ASCredentialProviderExtensionContext.rs"] +mod __ASCredentialProviderExtensionContext; +#[path = "ASCredentialProviderViewController.rs"] +mod __ASCredentialProviderViewController; +#[path = "ASCredentialServiceIdentifier.rs"] +mod __ASCredentialServiceIdentifier; +#[path = "ASExtensionErrors.rs"] +mod __ASExtensionErrors; +#[path = "ASFoundation.rs"] +mod __ASFoundation; +#[path = "ASPasswordCredential.rs"] +mod __ASPasswordCredential; +#[path = "ASPasswordCredentialIdentity.rs"] +mod __ASPasswordCredentialIdentity; +#[path = "ASPublicKeyCredential.rs"] +mod __ASPublicKeyCredential; +#[path = "ASWebAuthenticationSession.rs"] +mod __ASWebAuthenticationSession; +#[path = "ASWebAuthenticationSessionRequest.rs"] +mod __ASWebAuthenticationSessionRequest; +#[path = "ASWebAuthenticationSessionWebBrowserSessionHandling.rs"] +mod __ASWebAuthenticationSessionWebBrowserSessionHandling; +#[path = "ASWebAuthenticationSessionWebBrowserSessionManager.rs"] +mod __ASWebAuthenticationSessionWebBrowserSessionManager; + +pub use self::__ASAccountAuthenticationModificationController::{ + ASAccountAuthenticationModificationController, + ASAccountAuthenticationModificationControllerDelegate, + ASAccountAuthenticationModificationControllerPresentationContextProviding, +}; +pub use self::__ASAccountAuthenticationModificationExtensionContext::ASAccountAuthenticationModificationExtensionContext; +pub use self::__ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest::ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest; +pub use self::__ASAccountAuthenticationModificationRequest::ASAccountAuthenticationModificationRequest; +pub use self::__ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest::ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest; +pub use self::__ASAccountAuthenticationModificationViewController::ASAccountAuthenticationModificationViewController; +pub use self::__ASAuthorization::{ + ASAuthorization, ASAuthorizationScope, ASAuthorizationScopeEmail, ASAuthorizationScopeFullName, +}; +pub use self::__ASAuthorizationAppleIDButton::{ + ASAuthorizationAppleIDButton, ASAuthorizationAppleIDButtonStyle, + ASAuthorizationAppleIDButtonStyleBlack, ASAuthorizationAppleIDButtonStyleWhite, + ASAuthorizationAppleIDButtonStyleWhiteOutline, ASAuthorizationAppleIDButtonType, + ASAuthorizationAppleIDButtonTypeContinue, ASAuthorizationAppleIDButtonTypeDefault, + ASAuthorizationAppleIDButtonTypeSignIn, ASAuthorizationAppleIDButtonTypeSignUp, +}; +pub use self::__ASAuthorizationAppleIDCredential::{ + ASAuthorizationAppleIDCredential, ASUserDetectionStatus, ASUserDetectionStatusLikelyReal, + ASUserDetectionStatusUnknown, ASUserDetectionStatusUnsupported, +}; +pub use self::__ASAuthorizationAppleIDProvider::{ + ASAuthorizationAppleIDProvider, ASAuthorizationAppleIDProviderCredentialAuthorized, + ASAuthorizationAppleIDProviderCredentialNotFound, + ASAuthorizationAppleIDProviderCredentialRevoked, + ASAuthorizationAppleIDProviderCredentialRevokedNotification, + ASAuthorizationAppleIDProviderCredentialState, + ASAuthorizationAppleIDProviderCredentialTransferred, +}; +pub use self::__ASAuthorizationAppleIDRequest::ASAuthorizationAppleIDRequest; +pub use self::__ASAuthorizationController::{ + ASAuthorizationController, ASAuthorizationControllerDelegate, + ASAuthorizationControllerPresentationContextProviding, +}; +pub use self::__ASAuthorizationCredential::ASAuthorizationCredential; +pub use self::__ASAuthorizationCustomMethod::{ + ASAuthorizationCustomMethod, ASAuthorizationCustomMethodOther, + ASAuthorizationCustomMethodRestorePurchase, ASAuthorizationCustomMethodVideoSubscriberAccount, +}; +pub use self::__ASAuthorizationError::{ + ASAuthorizationError, ASAuthorizationErrorCanceled, ASAuthorizationErrorDomain, + ASAuthorizationErrorFailed, ASAuthorizationErrorInvalidResponse, + ASAuthorizationErrorNotHandled, ASAuthorizationErrorNotInteractive, + ASAuthorizationErrorUnknown, +}; +pub use self::__ASAuthorizationOpenIDRequest::{ + ASAuthorizationOpenIDOperation, ASAuthorizationOpenIDRequest, ASAuthorizationOperationImplicit, + ASAuthorizationOperationLogin, ASAuthorizationOperationLogout, ASAuthorizationOperationRefresh, +}; +pub use self::__ASAuthorizationPasswordProvider::ASAuthorizationPasswordProvider; +pub use self::__ASAuthorizationPasswordRequest::ASAuthorizationPasswordRequest; +pub use self::__ASAuthorizationPlatformPublicKeyCredentialAssertion::ASAuthorizationPlatformPublicKeyCredentialAssertion; +pub use self::__ASAuthorizationPlatformPublicKeyCredentialAssertionRequest::ASAuthorizationPlatformPublicKeyCredentialAssertionRequest; +pub use self::__ASAuthorizationPlatformPublicKeyCredentialDescriptor::ASAuthorizationPlatformPublicKeyCredentialDescriptor; +pub use self::__ASAuthorizationPlatformPublicKeyCredentialProvider::ASAuthorizationPlatformPublicKeyCredentialProvider; +pub use self::__ASAuthorizationPlatformPublicKeyCredentialRegistration::ASAuthorizationPlatformPublicKeyCredentialRegistration; +pub use self::__ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest::ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest; +pub use self::__ASAuthorizationProvider::ASAuthorizationProvider; +pub use self::__ASAuthorizationProviderExtensionAuthorizationRequest::{ + ASAuthorizationProviderAuthorizationOperation, + ASAuthorizationProviderAuthorizationOperationConfigurationRemoved, + ASAuthorizationProviderExtensionAuthorizationRequest, + ASAuthorizationProviderExtensionAuthorizationRequestHandler, +}; +pub use self::__ASAuthorizationProviderExtensionAuthorizationResult::ASAuthorizationProviderExtensionAuthorizationResult; +pub use self::__ASAuthorizationPublicKeyCredentialAssertion::ASAuthorizationPublicKeyCredentialAssertion; +pub use self::__ASAuthorizationPublicKeyCredentialAssertionRequest::ASAuthorizationPublicKeyCredentialAssertionRequest; +pub use self::__ASAuthorizationPublicKeyCredentialConstants::{ + ASAuthorizationPublicKeyCredentialAttestationKind, + ASAuthorizationPublicKeyCredentialAttestationKindDirect, + ASAuthorizationPublicKeyCredentialAttestationKindEnterprise, + ASAuthorizationPublicKeyCredentialAttestationKindIndirect, + ASAuthorizationPublicKeyCredentialAttestationKindNone, + ASAuthorizationPublicKeyCredentialResidentKeyPreference, + ASAuthorizationPublicKeyCredentialResidentKeyPreferenceDiscouraged, + ASAuthorizationPublicKeyCredentialResidentKeyPreferencePreferred, + ASAuthorizationPublicKeyCredentialResidentKeyPreferenceRequired, + ASAuthorizationPublicKeyCredentialUserVerificationPreference, + ASAuthorizationPublicKeyCredentialUserVerificationPreferenceDiscouraged, + ASAuthorizationPublicKeyCredentialUserVerificationPreferencePreferred, + ASAuthorizationPublicKeyCredentialUserVerificationPreferenceRequired, +}; +pub use self::__ASAuthorizationPublicKeyCredentialDescriptor::ASAuthorizationPublicKeyCredentialDescriptor; +pub use self::__ASAuthorizationPublicKeyCredentialParameters::ASAuthorizationPublicKeyCredentialParameters; +pub use self::__ASAuthorizationPublicKeyCredentialRegistration::ASAuthorizationPublicKeyCredentialRegistration; +pub use self::__ASAuthorizationPublicKeyCredentialRegistrationRequest::ASAuthorizationPublicKeyCredentialRegistrationRequest; +pub use self::__ASAuthorizationRequest::ASAuthorizationRequest; +pub use self::__ASAuthorizationSecurityKeyPublicKeyCredentialAssertion::ASAuthorizationSecurityKeyPublicKeyCredentialAssertion; +pub use self::__ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest::ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest; +pub use self::__ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor::{ + ASAuthorizationAllSupportedPublicKeyCredentialDescriptorTransports, + ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor, + ASAuthorizationSecurityKeyPublicKeyCredentialDescriptorTransport, + ASAuthorizationSecurityKeyPublicKeyCredentialDescriptorTransportBluetooth, + ASAuthorizationSecurityKeyPublicKeyCredentialDescriptorTransportNFC, + ASAuthorizationSecurityKeyPublicKeyCredentialDescriptorTransportUSB, +}; +pub use self::__ASAuthorizationSecurityKeyPublicKeyCredentialProvider::ASAuthorizationSecurityKeyPublicKeyCredentialProvider; +pub use self::__ASAuthorizationSecurityKeyPublicKeyCredentialRegistration::ASAuthorizationSecurityKeyPublicKeyCredentialRegistration; +pub use self::__ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest::ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest; +pub use self::__ASAuthorizationSingleSignOnCredential::ASAuthorizationSingleSignOnCredential; +pub use self::__ASAuthorizationSingleSignOnProvider::ASAuthorizationSingleSignOnProvider; +pub use self::__ASAuthorizationSingleSignOnRequest::ASAuthorizationSingleSignOnRequest; +pub use self::__ASCOSEConstants::{ + ASCOSEAlgorithmIdentifier, ASCOSEAlgorithmIdentifierES256, ASCOSEEllipticCurveIdentifier, + ASCOSEEllipticCurveIdentifierP256, +}; +pub use self::__ASCredentialIdentityStore::{ + ASCredentialIdentityStore, ASCredentialIdentityStoreErrorCode, + ASCredentialIdentityStoreErrorCodeInternalError, ASCredentialIdentityStoreErrorCodeStoreBusy, + ASCredentialIdentityStoreErrorCodeStoreDisabled, ASCredentialIdentityStoreErrorDomain, +}; +pub use self::__ASCredentialIdentityStoreState::ASCredentialIdentityStoreState; +pub use self::__ASCredentialProviderExtensionContext::ASCredentialProviderExtensionContext; +pub use self::__ASCredentialProviderViewController::ASCredentialProviderViewController; +pub use self::__ASCredentialServiceIdentifier::{ + ASCredentialServiceIdentifier, ASCredentialServiceIdentifierType, + ASCredentialServiceIdentifierTypeDomain, ASCredentialServiceIdentifierTypeURL, +}; +pub use self::__ASExtensionErrors::{ + ASExtensionErrorCode, ASExtensionErrorCodeCredentialIdentityNotFound, + ASExtensionErrorCodeFailed, ASExtensionErrorCodeUserCanceled, + ASExtensionErrorCodeUserInteractionRequired, ASExtensionErrorDomain, + ASExtensionLocalizedFailureReasonErrorKey, +}; +pub use self::__ASPasswordCredential::ASPasswordCredential; +pub use self::__ASPasswordCredentialIdentity::ASPasswordCredentialIdentity; +pub use self::__ASPublicKeyCredential::ASPublicKeyCredential; +pub use self::__ASWebAuthenticationSession::{ + ASWebAuthenticationPresentationContextProviding, ASWebAuthenticationSession, + ASWebAuthenticationSessionCompletionHandler, ASWebAuthenticationSessionErrorCode, + ASWebAuthenticationSessionErrorCodeCanceledLogin, + ASWebAuthenticationSessionErrorCodePresentationContextInvalid, + ASWebAuthenticationSessionErrorCodePresentationContextNotProvided, + ASWebAuthenticationSessionErrorDomain, +}; +pub use self::__ASWebAuthenticationSessionRequest::{ + ASWebAuthenticationSessionRequest, ASWebAuthenticationSessionRequestDelegate, +}; +pub use self::__ASWebAuthenticationSessionWebBrowserSessionHandling::ASWebAuthenticationSessionWebBrowserSessionHandling; +pub use self::__ASWebAuthenticationSessionWebBrowserSessionManager::ASWebAuthenticationSessionWebBrowserSessionManager; diff --git a/crates/icrate/src/generated/CoreData/CoreDataDefines.rs b/crates/icrate/src/generated/CoreData/CoreDataDefines.rs new file mode 100644 index 000000000..cacfdc74b --- /dev/null +++ b/crates/icrate/src/generated/CoreData/CoreDataDefines.rs @@ -0,0 +1,7 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSCoreDataVersionNumber: c_double); diff --git a/crates/icrate/src/generated/CoreData/CoreDataErrors.rs b/crates/icrate/src/generated/CoreData/CoreDataErrors.rs new file mode 100644 index 000000000..cddf0c517 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/CoreDataErrors.rs @@ -0,0 +1,75 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSDetailedErrorsKey: &'static NSString); + +extern_static!(NSValidationObjectErrorKey: &'static NSString); + +extern_static!(NSValidationKeyErrorKey: &'static NSString); + +extern_static!(NSValidationPredicateErrorKey: &'static NSString); + +extern_static!(NSValidationValueErrorKey: &'static NSString); + +extern_static!(NSAffectedStoresErrorKey: &'static NSString); + +extern_static!(NSAffectedObjectsErrorKey: &'static NSString); + +extern_static!(NSPersistentStoreSaveConflictsErrorKey: &'static NSString); + +extern_static!(NSSQLiteErrorDomain: &'static NSString); + +extern_enum!( + #[underlying(NSInteger)] + pub enum { + NSManagedObjectValidationError = 1550, + NSManagedObjectConstraintValidationError = 1551, + NSValidationMultipleErrorsError = 1560, + NSValidationMissingMandatoryPropertyError = 1570, + NSValidationRelationshipLacksMinimumCountError = 1580, + NSValidationRelationshipExceedsMaximumCountError = 1590, + NSValidationRelationshipDeniedDeleteError = 1600, + NSValidationNumberTooLargeError = 1610, + NSValidationNumberTooSmallError = 1620, + NSValidationDateTooLateError = 1630, + NSValidationDateTooSoonError = 1640, + NSValidationInvalidDateError = 1650, + NSValidationStringTooLongError = 1660, + NSValidationStringTooShortError = 1670, + NSValidationStringPatternMatchingError = 1680, + NSValidationInvalidURIError = 1690, + NSManagedObjectContextLockingError = 132000, + NSPersistentStoreCoordinatorLockingError = 132010, + NSManagedObjectReferentialIntegrityError = 133000, + NSManagedObjectExternalRelationshipError = 133010, + NSManagedObjectMergeError = 133020, + NSManagedObjectConstraintMergeError = 133021, + NSPersistentStoreInvalidTypeError = 134000, + NSPersistentStoreTypeMismatchError = 134010, + NSPersistentStoreIncompatibleSchemaError = 134020, + NSPersistentStoreSaveError = 134030, + NSPersistentStoreIncompleteSaveError = 134040, + NSPersistentStoreSaveConflictsError = 134050, + NSCoreDataError = 134060, + NSPersistentStoreOperationError = 134070, + NSPersistentStoreOpenError = 134080, + NSPersistentStoreTimeoutError = 134090, + NSPersistentStoreUnsupportedRequestTypeError = 134091, + NSPersistentStoreIncompatibleVersionHashError = 134100, + NSMigrationError = 134110, + NSMigrationConstraintViolationError = 134111, + NSMigrationCancelledError = 134120, + NSMigrationMissingSourceModelError = 134130, + NSMigrationMissingMappingModelError = 134140, + NSMigrationManagerSourceStoreError = 134150, + NSMigrationManagerDestinationStoreError = 134160, + NSEntityMigrationPolicyError = 134170, + NSSQLiteError = 134180, + NSInferredMappingModelError = 134190, + NSExternalRecordImportError = 134200, + NSPersistentHistoryTokenExpiredError = 134301, + } +); diff --git a/crates/icrate/src/generated/CoreData/NSAtomicStore.rs b/crates/icrate/src/generated/CoreData/NSAtomicStore.rs new file mode 100644 index 000000000..6973abd7a --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSAtomicStore.rs @@ -0,0 +1,80 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSAtomicStore; + + unsafe impl ClassType for NSAtomicStore { + type Super = NSPersistentStore; + } +); + +extern_methods!( + unsafe impl NSAtomicStore { + #[method_id(@__retain_semantics Init initWithPersistentStoreCoordinator:configurationName:URL:options:)] + pub unsafe fn initWithPersistentStoreCoordinator_configurationName_URL_options( + this: Option>, + coordinator: Option<&NSPersistentStoreCoordinator>, + configurationName: Option<&NSString>, + url: &NSURL, + options: Option<&NSDictionary>, + ) -> Id; + + #[method(load:)] + pub unsafe fn load(&self) -> Result<(), Id>; + + #[method(save:)] + pub unsafe fn save(&self) -> Result<(), Id>; + + #[method_id(@__retain_semantics New newCacheNodeForManagedObject:)] + pub unsafe fn newCacheNodeForManagedObject( + &self, + managedObject: &NSManagedObject, + ) -> Id; + + #[method(updateCacheNode:fromManagedObject:)] + pub unsafe fn updateCacheNode_fromManagedObject( + &self, + node: &NSAtomicStoreCacheNode, + managedObject: &NSManagedObject, + ); + + #[method_id(@__retain_semantics Other cacheNodes)] + pub unsafe fn cacheNodes(&self) -> Id, Shared>; + + #[method(addCacheNodes:)] + pub unsafe fn addCacheNodes(&self, cacheNodes: &NSSet); + + #[method(willRemoveCacheNodes:)] + pub unsafe fn willRemoveCacheNodes(&self, cacheNodes: &NSSet); + + #[method_id(@__retain_semantics Other cacheNodeForObjectID:)] + pub unsafe fn cacheNodeForObjectID( + &self, + objectID: &NSManagedObjectID, + ) -> Option>; + + #[method_id(@__retain_semantics Other objectIDForEntity:referenceObject:)] + pub unsafe fn objectIDForEntity_referenceObject( + &self, + entity: &NSEntityDescription, + data: &Object, + ) -> Id; + + #[method_id(@__retain_semantics New newReferenceObjectForManagedObject:)] + pub unsafe fn newReferenceObjectForManagedObject( + &self, + managedObject: &NSManagedObject, + ) -> Id; + + #[method_id(@__retain_semantics Other referenceObjectForObjectID:)] + pub unsafe fn referenceObjectForObjectID( + &self, + objectID: &NSManagedObjectID, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSAtomicStoreCacheNode.rs b/crates/icrate/src/generated/CoreData/NSAtomicStoreCacheNode.rs new file mode 100644 index 000000000..0cc5b65c7 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSAtomicStoreCacheNode.rs @@ -0,0 +1,44 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSAtomicStoreCacheNode; + + unsafe impl ClassType for NSAtomicStoreCacheNode { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAtomicStoreCacheNode { + #[method_id(@__retain_semantics Init initWithObjectID:)] + pub unsafe fn initWithObjectID( + this: Option>, + moid: &NSManagedObjectID, + ) -> Id; + + #[method_id(@__retain_semantics Other objectID)] + pub unsafe fn objectID(&self) -> Id; + + #[method_id(@__retain_semantics Other propertyCache)] + pub unsafe fn propertyCache( + &self, + ) -> Option, Shared>>; + + #[method(setPropertyCache:)] + pub unsafe fn setPropertyCache( + &self, + propertyCache: Option<&NSMutableDictionary>, + ); + + #[method_id(@__retain_semantics Other valueForKey:)] + pub unsafe fn valueForKey(&self, key: &NSString) -> Option>; + + #[method(setValue:forKey:)] + pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSAttributeDescription.rs b/crates/icrate/src/generated/CoreData/NSAttributeDescription.rs new file mode 100644 index 000000000..e568fc59b --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSAttributeDescription.rs @@ -0,0 +1,90 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSAttributeType { + NSUndefinedAttributeType = 0, + NSInteger16AttributeType = 100, + NSInteger32AttributeType = 200, + NSInteger64AttributeType = 300, + NSDecimalAttributeType = 400, + NSDoubleAttributeType = 500, + NSFloatAttributeType = 600, + NSStringAttributeType = 700, + NSBooleanAttributeType = 800, + NSDateAttributeType = 900, + NSBinaryDataAttributeType = 1000, + NSUUIDAttributeType = 1100, + NSURIAttributeType = 1200, + NSTransformableAttributeType = 1800, + NSObjectIDAttributeType = 2000, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSAttributeDescription; + + unsafe impl ClassType for NSAttributeDescription { + type Super = NSPropertyDescription; + } +); + +extern_methods!( + unsafe impl NSAttributeDescription { + #[method(attributeType)] + pub unsafe fn attributeType(&self) -> NSAttributeType; + + #[method(setAttributeType:)] + pub unsafe fn setAttributeType(&self, attributeType: NSAttributeType); + + #[method_id(@__retain_semantics Other attributeValueClassName)] + pub unsafe fn attributeValueClassName(&self) -> Option>; + + #[method(setAttributeValueClassName:)] + pub unsafe fn setAttributeValueClassName(&self, attributeValueClassName: Option<&NSString>); + + #[method_id(@__retain_semantics Other defaultValue)] + pub unsafe fn defaultValue(&self) -> Option>; + + #[method(setDefaultValue:)] + pub unsafe fn setDefaultValue(&self, defaultValue: Option<&Object>); + + #[method_id(@__retain_semantics Other versionHash)] + pub unsafe fn versionHash(&self) -> Id; + + #[method_id(@__retain_semantics Other valueTransformerName)] + pub unsafe fn valueTransformerName(&self) -> Option>; + + #[method(setValueTransformerName:)] + pub unsafe fn setValueTransformerName(&self, valueTransformerName: Option<&NSString>); + + #[method(allowsExternalBinaryDataStorage)] + pub unsafe fn allowsExternalBinaryDataStorage(&self) -> bool; + + #[method(setAllowsExternalBinaryDataStorage:)] + pub unsafe fn setAllowsExternalBinaryDataStorage( + &self, + allowsExternalBinaryDataStorage: bool, + ); + + #[method(preservesValueInHistoryOnDeletion)] + pub unsafe fn preservesValueInHistoryOnDeletion(&self) -> bool; + + #[method(setPreservesValueInHistoryOnDeletion:)] + pub unsafe fn setPreservesValueInHistoryOnDeletion( + &self, + preservesValueInHistoryOnDeletion: bool, + ); + + #[method(allowsCloudEncryption)] + pub unsafe fn allowsCloudEncryption(&self) -> bool; + + #[method(setAllowsCloudEncryption:)] + pub unsafe fn setAllowsCloudEncryption(&self, allowsCloudEncryption: bool); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSBatchDeleteRequest.rs b/crates/icrate/src/generated/CoreData/NSBatchDeleteRequest.rs new file mode 100644 index 000000000..c506ed766 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSBatchDeleteRequest.rs @@ -0,0 +1,42 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSBatchDeleteRequest; + + unsafe impl ClassType for NSBatchDeleteRequest { + type Super = NSPersistentStoreRequest; + } +); + +extern_methods!( + unsafe impl NSBatchDeleteRequest { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithFetchRequest:)] + pub unsafe fn initWithFetchRequest( + this: Option>, + fetch: &NSFetchRequest, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithObjectIDs:)] + pub unsafe fn initWithObjectIDs( + this: Option>, + objects: &NSArray, + ) -> Id; + + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSBatchDeleteRequestResultType; + + #[method(setResultType:)] + pub unsafe fn setResultType(&self, resultType: NSBatchDeleteRequestResultType); + + #[method_id(@__retain_semantics Other fetchRequest)] + pub unsafe fn fetchRequest(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSBatchInsertRequest.rs b/crates/icrate/src/generated/CoreData/NSBatchInsertRequest.rs new file mode 100644 index 000000000..ef755587d --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSBatchInsertRequest.rs @@ -0,0 +1,126 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSBatchInsertRequest; + + unsafe impl ClassType for NSBatchInsertRequest { + type Super = NSPersistentStoreRequest; + } +); + +extern_methods!( + unsafe impl NSBatchInsertRequest { + #[method_id(@__retain_semantics Other entityName)] + pub unsafe fn entityName(&self) -> Id; + + #[method_id(@__retain_semantics Other entity)] + pub unsafe fn entity(&self) -> Option>; + + #[method_id(@__retain_semantics Other objectsToInsert)] + pub unsafe fn objectsToInsert( + &self, + ) -> Option>, Shared>>; + + #[method(setObjectsToInsert:)] + pub unsafe fn setObjectsToInsert( + &self, + objectsToInsert: Option<&NSArray>>, + ); + + #[method(dictionaryHandler)] + pub unsafe fn dictionaryHandler( + &self, + ) -> *mut Block<(NonNull>,), Bool>; + + #[method(setDictionaryHandler:)] + pub unsafe fn setDictionaryHandler( + &self, + dictionaryHandler: Option< + &Block<(NonNull>,), Bool>, + >, + ); + + #[method(managedObjectHandler)] + pub unsafe fn managedObjectHandler(&self) -> *mut Block<(NonNull,), Bool>; + + #[method(setManagedObjectHandler:)] + pub unsafe fn setManagedObjectHandler( + &self, + managedObjectHandler: Option<&Block<(NonNull,), Bool>>, + ); + + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSBatchInsertRequestResultType; + + #[method(setResultType:)] + pub unsafe fn setResultType(&self, resultType: NSBatchInsertRequestResultType); + + #[method_id(@__retain_semantics Other batchInsertRequestWithEntityName:objects:)] + pub unsafe fn batchInsertRequestWithEntityName_objects( + entityName: &NSString, + dictionaries: &NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Other batchInsertRequestWithEntityName:dictionaryHandler:)] + pub unsafe fn batchInsertRequestWithEntityName_dictionaryHandler( + entityName: &NSString, + handler: &Block<(NonNull>,), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Other batchInsertRequestWithEntityName:managedObjectHandler:)] + pub unsafe fn batchInsertRequestWithEntityName_managedObjectHandler( + entityName: &NSString, + handler: &Block<(NonNull,), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithEntityName:objects:)] + pub unsafe fn initWithEntityName_objects( + this: Option>, + entityName: &NSString, + dictionaries: &NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithEntity:objects:)] + pub unsafe fn initWithEntity_objects( + this: Option>, + entity: &NSEntityDescription, + dictionaries: &NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithEntity:dictionaryHandler:)] + pub unsafe fn initWithEntity_dictionaryHandler( + this: Option>, + entity: &NSEntityDescription, + handler: &Block<(NonNull>,), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithEntity:managedObjectHandler:)] + pub unsafe fn initWithEntity_managedObjectHandler( + this: Option>, + entity: &NSEntityDescription, + handler: &Block<(NonNull,), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithEntityName:dictionaryHandler:)] + pub unsafe fn initWithEntityName_dictionaryHandler( + this: Option>, + entityName: &NSString, + handler: &Block<(NonNull>,), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithEntityName:managedObjectHandler:)] + pub unsafe fn initWithEntityName_managedObjectHandler( + this: Option>, + entityName: &NSString, + handler: &Block<(NonNull,), Bool>, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSBatchUpdateRequest.rs b/crates/icrate/src/generated/CoreData/NSBatchUpdateRequest.rs new file mode 100644 index 000000000..5d5289187 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSBatchUpdateRequest.rs @@ -0,0 +1,63 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSBatchUpdateRequest; + + unsafe impl ClassType for NSBatchUpdateRequest { + type Super = NSPersistentStoreRequest; + } +); + +extern_methods!( + unsafe impl NSBatchUpdateRequest { + #[method_id(@__retain_semantics Other batchUpdateRequestWithEntityName:)] + pub unsafe fn batchUpdateRequestWithEntityName(entityName: &NSString) -> Id; + + #[method_id(@__retain_semantics Init initWithEntityName:)] + pub unsafe fn initWithEntityName( + this: Option>, + entityName: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithEntity:)] + pub unsafe fn initWithEntity( + this: Option>, + entity: &NSEntityDescription, + ) -> Id; + + #[method_id(@__retain_semantics Other entityName)] + pub unsafe fn entityName(&self) -> Id; + + #[method_id(@__retain_semantics Other entity)] + pub unsafe fn entity(&self) -> Id; + + #[method_id(@__retain_semantics Other predicate)] + pub unsafe fn predicate(&self) -> Option>; + + #[method(setPredicate:)] + pub unsafe fn setPredicate(&self, predicate: Option<&NSPredicate>); + + #[method(includesSubentities)] + pub unsafe fn includesSubentities(&self) -> bool; + + #[method(setIncludesSubentities:)] + pub unsafe fn setIncludesSubentities(&self, includesSubentities: bool); + + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSBatchUpdateRequestResultType; + + #[method(setResultType:)] + pub unsafe fn setResultType(&self, resultType: NSBatchUpdateRequestResultType); + + #[method_id(@__retain_semantics Other propertiesToUpdate)] + pub unsafe fn propertiesToUpdate(&self) -> Option>; + + #[method(setPropertiesToUpdate:)] + pub unsafe fn setPropertiesToUpdate(&self, propertiesToUpdate: Option<&NSDictionary>); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSCoreDataCoreSpotlightDelegate.rs b/crates/icrate/src/generated/CoreData/NSCoreDataCoreSpotlightDelegate.rs new file mode 100644 index 000000000..d56370c23 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSCoreDataCoreSpotlightDelegate.rs @@ -0,0 +1,60 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!( + NSCoreDataCoreSpotlightDelegateIndexDidUpdateNotification: &'static NSNotificationName +); + +extern_class!( + #[derive(Debug)] + pub struct NSCoreDataCoreSpotlightDelegate; + + unsafe impl ClassType for NSCoreDataCoreSpotlightDelegate { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCoreDataCoreSpotlightDelegate { + #[method(isIndexingEnabled)] + pub unsafe fn isIndexingEnabled(&self) -> bool; + + #[method_id(@__retain_semantics Other domainIdentifier)] + pub unsafe fn domainIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Other indexName)] + pub unsafe fn indexName(&self) -> Option>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initForStoreWithDescription:coordinator:)] + pub unsafe fn initForStoreWithDescription_coordinator( + this: Option>, + description: &NSPersistentStoreDescription, + psc: &NSPersistentStoreCoordinator, + ) -> Id; + + #[method_id(@__retain_semantics Init initForStoreWithDescription:model:)] + pub unsafe fn initForStoreWithDescription_model( + this: Option>, + description: &NSPersistentStoreDescription, + model: &NSManagedObjectModel, + ) -> Id; + + #[method(startSpotlightIndexing)] + pub unsafe fn startSpotlightIndexing(&self); + + #[method(stopSpotlightIndexing)] + pub unsafe fn stopSpotlightIndexing(&self); + + #[method(deleteSpotlightIndexWithCompletionHandler:)] + pub unsafe fn deleteSpotlightIndexWithCompletionHandler( + &self, + completionHandler: &Block<(*mut NSError,), ()>, + ); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSDerivedAttributeDescription.rs b/crates/icrate/src/generated/CoreData/NSDerivedAttributeDescription.rs new file mode 100644 index 000000000..54a6e6174 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSDerivedAttributeDescription.rs @@ -0,0 +1,24 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSDerivedAttributeDescription; + + unsafe impl ClassType for NSDerivedAttributeDescription { + type Super = NSAttributeDescription; + } +); + +extern_methods!( + unsafe impl NSDerivedAttributeDescription { + #[method_id(@__retain_semantics Other derivationExpression)] + pub unsafe fn derivationExpression(&self) -> Option>; + + #[method(setDerivationExpression:)] + pub unsafe fn setDerivationExpression(&self, derivationExpression: Option<&NSExpression>); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSEntityDescription.rs b/crates/icrate/src/generated/CoreData/NSEntityDescription.rs new file mode 100644 index 000000000..33c824460 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSEntityDescription.rs @@ -0,0 +1,146 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSEntityDescription; + + unsafe impl ClassType for NSEntityDescription { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSEntityDescription { + #[method_id(@__retain_semantics Other entityForName:inManagedObjectContext:)] + pub unsafe fn entityForName_inManagedObjectContext( + entityName: &NSString, + context: &NSManagedObjectContext, + ) -> Option>; + + #[method_id(@__retain_semantics Other insertNewObjectForEntityForName:inManagedObjectContext:)] + pub unsafe fn insertNewObjectForEntityForName_inManagedObjectContext( + entityName: &NSString, + context: &NSManagedObjectContext, + ) -> Id; + + #[method_id(@__retain_semantics Other managedObjectModel)] + pub unsafe fn managedObjectModel(&self) -> Id; + + #[method_id(@__retain_semantics Other managedObjectClassName)] + pub unsafe fn managedObjectClassName(&self) -> Id; + + #[method(setManagedObjectClassName:)] + pub unsafe fn setManagedObjectClassName(&self, managedObjectClassName: Option<&NSString>); + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + + #[method(isAbstract)] + pub unsafe fn isAbstract(&self) -> bool; + + #[method(setAbstract:)] + pub unsafe fn setAbstract(&self, abstract_: bool); + + #[method_id(@__retain_semantics Other subentitiesByName)] + pub unsafe fn subentitiesByName( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other subentities)] + pub unsafe fn subentities(&self) -> Id, Shared>; + + #[method(setSubentities:)] + pub unsafe fn setSubentities(&self, subentities: &NSArray); + + #[method_id(@__retain_semantics Other superentity)] + pub unsafe fn superentity(&self) -> Option>; + + #[method_id(@__retain_semantics Other propertiesByName)] + pub unsafe fn propertiesByName( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other properties)] + pub unsafe fn properties(&self) -> Id, Shared>; + + #[method(setProperties:)] + pub unsafe fn setProperties(&self, properties: &NSArray); + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + + #[method(setUserInfo:)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>); + + #[method_id(@__retain_semantics Other attributesByName)] + pub unsafe fn attributesByName( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other relationshipsByName)] + pub unsafe fn relationshipsByName( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other relationshipsWithDestinationEntity:)] + pub unsafe fn relationshipsWithDestinationEntity( + &self, + entity: &NSEntityDescription, + ) -> Id, Shared>; + + #[method(isKindOfEntity:)] + pub unsafe fn isKindOfEntity(&self, entity: &NSEntityDescription) -> bool; + + #[method_id(@__retain_semantics Other versionHash)] + pub unsafe fn versionHash(&self) -> Id; + + #[method_id(@__retain_semantics Other versionHashModifier)] + pub unsafe fn versionHashModifier(&self) -> Option>; + + #[method(setVersionHashModifier:)] + pub unsafe fn setVersionHashModifier(&self, versionHashModifier: Option<&NSString>); + + #[method_id(@__retain_semantics Other renamingIdentifier)] + pub unsafe fn renamingIdentifier(&self) -> Option>; + + #[method(setRenamingIdentifier:)] + pub unsafe fn setRenamingIdentifier(&self, renamingIdentifier: Option<&NSString>); + + #[method_id(@__retain_semantics Other indexes)] + pub unsafe fn indexes(&self) -> Id, Shared>; + + #[method(setIndexes:)] + pub unsafe fn setIndexes(&self, indexes: &NSArray); + + #[method_id(@__retain_semantics Other uniquenessConstraints)] + pub unsafe fn uniquenessConstraints(&self) -> Id>, Shared>; + + #[method(setUniquenessConstraints:)] + pub unsafe fn setUniquenessConstraints( + &self, + uniquenessConstraints: &NSArray>, + ); + + #[method_id(@__retain_semantics Other compoundIndexes)] + pub unsafe fn compoundIndexes(&self) -> Id>, Shared>; + + #[method(setCompoundIndexes:)] + pub unsafe fn setCompoundIndexes(&self, compoundIndexes: &NSArray>); + + #[method_id(@__retain_semantics Other coreSpotlightDisplayNameExpression)] + pub unsafe fn coreSpotlightDisplayNameExpression(&self) -> Id; + + #[method(setCoreSpotlightDisplayNameExpression:)] + pub unsafe fn setCoreSpotlightDisplayNameExpression( + &self, + coreSpotlightDisplayNameExpression: &NSExpression, + ); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSEntityMapping.rs b/crates/icrate/src/generated/CoreData/NSEntityMapping.rs new file mode 100644 index 000000000..05e8fe5fa --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSEntityMapping.rs @@ -0,0 +1,109 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSEntityMappingType { + NSUndefinedEntityMappingType = 0x00, + NSCustomEntityMappingType = 0x01, + NSAddEntityMappingType = 0x02, + NSRemoveEntityMappingType = 0x03, + NSCopyEntityMappingType = 0x04, + NSTransformEntityMappingType = 0x05, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSEntityMapping; + + unsafe impl ClassType for NSEntityMapping { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSEntityMapping { + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + + #[method(mappingType)] + pub unsafe fn mappingType(&self) -> NSEntityMappingType; + + #[method(setMappingType:)] + pub unsafe fn setMappingType(&self, mappingType: NSEntityMappingType); + + #[method_id(@__retain_semantics Other sourceEntityName)] + pub unsafe fn sourceEntityName(&self) -> Option>; + + #[method(setSourceEntityName:)] + pub unsafe fn setSourceEntityName(&self, sourceEntityName: Option<&NSString>); + + #[method_id(@__retain_semantics Other sourceEntityVersionHash)] + pub unsafe fn sourceEntityVersionHash(&self) -> Option>; + + #[method(setSourceEntityVersionHash:)] + pub unsafe fn setSourceEntityVersionHash(&self, sourceEntityVersionHash: Option<&NSData>); + + #[method_id(@__retain_semantics Other destinationEntityName)] + pub unsafe fn destinationEntityName(&self) -> Option>; + + #[method(setDestinationEntityName:)] + pub unsafe fn setDestinationEntityName(&self, destinationEntityName: Option<&NSString>); + + #[method_id(@__retain_semantics Other destinationEntityVersionHash)] + pub unsafe fn destinationEntityVersionHash(&self) -> Option>; + + #[method(setDestinationEntityVersionHash:)] + pub unsafe fn setDestinationEntityVersionHash( + &self, + destinationEntityVersionHash: Option<&NSData>, + ); + + #[method_id(@__retain_semantics Other attributeMappings)] + pub unsafe fn attributeMappings(&self) -> Option, Shared>>; + + #[method(setAttributeMappings:)] + pub unsafe fn setAttributeMappings( + &self, + attributeMappings: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other relationshipMappings)] + pub unsafe fn relationshipMappings(&self) + -> Option, Shared>>; + + #[method(setRelationshipMappings:)] + pub unsafe fn setRelationshipMappings( + &self, + relationshipMappings: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other sourceExpression)] + pub unsafe fn sourceExpression(&self) -> Option>; + + #[method(setSourceExpression:)] + pub unsafe fn setSourceExpression(&self, sourceExpression: Option<&NSExpression>); + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + + #[method(setUserInfo:)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>); + + #[method_id(@__retain_semantics Other entityMigrationPolicyClassName)] + pub unsafe fn entityMigrationPolicyClassName(&self) -> Option>; + + #[method(setEntityMigrationPolicyClassName:)] + pub unsafe fn setEntityMigrationPolicyClassName( + &self, + entityMigrationPolicyClassName: Option<&NSString>, + ); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSEntityMigrationPolicy.rs b/crates/icrate/src/generated/CoreData/NSEntityMigrationPolicy.rs new file mode 100644 index 000000000..2adf9aa76 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSEntityMigrationPolicy.rs @@ -0,0 +1,81 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSMigrationManagerKey: &'static NSString); + +extern_static!(NSMigrationSourceObjectKey: &'static NSString); + +extern_static!(NSMigrationDestinationObjectKey: &'static NSString); + +extern_static!(NSMigrationEntityMappingKey: &'static NSString); + +extern_static!(NSMigrationPropertyMappingKey: &'static NSString); + +extern_static!(NSMigrationEntityPolicyKey: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSEntityMigrationPolicy; + + unsafe impl ClassType for NSEntityMigrationPolicy { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSEntityMigrationPolicy { + #[method(beginEntityMapping:manager:error:)] + pub unsafe fn beginEntityMapping_manager_error( + &self, + mapping: &NSEntityMapping, + manager: &NSMigrationManager, + ) -> Result<(), Id>; + + #[method(createDestinationInstancesForSourceInstance:entityMapping:manager:error:)] + pub unsafe fn createDestinationInstancesForSourceInstance_entityMapping_manager_error( + &self, + sInstance: &NSManagedObject, + mapping: &NSEntityMapping, + manager: &NSMigrationManager, + ) -> Result<(), Id>; + + #[method(endInstanceCreationForEntityMapping:manager:error:)] + pub unsafe fn endInstanceCreationForEntityMapping_manager_error( + &self, + mapping: &NSEntityMapping, + manager: &NSMigrationManager, + ) -> Result<(), Id>; + + #[method(createRelationshipsForDestinationInstance:entityMapping:manager:error:)] + pub unsafe fn createRelationshipsForDestinationInstance_entityMapping_manager_error( + &self, + dInstance: &NSManagedObject, + mapping: &NSEntityMapping, + manager: &NSMigrationManager, + ) -> Result<(), Id>; + + #[method(endRelationshipCreationForEntityMapping:manager:error:)] + pub unsafe fn endRelationshipCreationForEntityMapping_manager_error( + &self, + mapping: &NSEntityMapping, + manager: &NSMigrationManager, + ) -> Result<(), Id>; + + #[method(performCustomValidationForEntityMapping:manager:error:)] + pub unsafe fn performCustomValidationForEntityMapping_manager_error( + &self, + mapping: &NSEntityMapping, + manager: &NSMigrationManager, + ) -> Result<(), Id>; + + #[method(endEntityMapping:manager:error:)] + pub unsafe fn endEntityMapping_manager_error( + &self, + mapping: &NSEntityMapping, + manager: &NSMigrationManager, + ) -> Result<(), Id>; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSExpressionDescription.rs b/crates/icrate/src/generated/CoreData/NSExpressionDescription.rs new file mode 100644 index 000000000..de7ee2785 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSExpressionDescription.rs @@ -0,0 +1,30 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSExpressionDescription; + + unsafe impl ClassType for NSExpressionDescription { + type Super = NSPropertyDescription; + } +); + +extern_methods!( + unsafe impl NSExpressionDescription { + #[method_id(@__retain_semantics Other expression)] + pub unsafe fn expression(&self) -> Option>; + + #[method(setExpression:)] + pub unsafe fn setExpression(&self, expression: Option<&NSExpression>); + + #[method(expressionResultType)] + pub unsafe fn expressionResultType(&self) -> NSAttributeType; + + #[method(setExpressionResultType:)] + pub unsafe fn setExpressionResultType(&self, expressionResultType: NSAttributeType); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSFetchIndexDescription.rs b/crates/icrate/src/generated/CoreData/NSFetchIndexDescription.rs new file mode 100644 index 000000000..b3a703859 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSFetchIndexDescription.rs @@ -0,0 +1,46 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSFetchIndexDescription; + + unsafe impl ClassType for NSFetchIndexDescription { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFetchIndexDescription { + #[method_id(@__retain_semantics Init initWithName:elements:)] + pub unsafe fn initWithName_elements( + this: Option>, + name: &NSString, + elements: Option<&NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method(setName:)] + pub unsafe fn setName(&self, name: &NSString); + + #[method_id(@__retain_semantics Other elements)] + pub unsafe fn elements(&self) -> Id, Shared>; + + #[method(setElements:)] + pub unsafe fn setElements(&self, elements: &NSArray); + + #[method_id(@__retain_semantics Other entity)] + pub unsafe fn entity(&self) -> Option>; + + #[method_id(@__retain_semantics Other partialIndexPredicate)] + pub unsafe fn partialIndexPredicate(&self) -> Option>; + + #[method(setPartialIndexPredicate:)] + pub unsafe fn setPartialIndexPredicate(&self, partialIndexPredicate: Option<&NSPredicate>); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSFetchIndexElementDescription.rs b/crates/icrate/src/generated/CoreData/NSFetchIndexElementDescription.rs new file mode 100644 index 000000000..9aa6bade5 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSFetchIndexElementDescription.rs @@ -0,0 +1,54 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSFetchIndexElementType { + NSFetchIndexElementTypeBinary = 0, + NSFetchIndexElementTypeRTree = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSFetchIndexElementDescription; + + unsafe impl ClassType for NSFetchIndexElementDescription { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFetchIndexElementDescription { + #[method_id(@__retain_semantics Init initWithProperty:collationType:)] + pub unsafe fn initWithProperty_collationType( + this: Option>, + property: &NSPropertyDescription, + collationType: NSFetchIndexElementType, + ) -> Id; + + #[method_id(@__retain_semantics Other property)] + pub unsafe fn property(&self) -> Option>; + + #[method_id(@__retain_semantics Other propertyName)] + pub unsafe fn propertyName(&self) -> Option>; + + #[method(collationType)] + pub unsafe fn collationType(&self) -> NSFetchIndexElementType; + + #[method(setCollationType:)] + pub unsafe fn setCollationType(&self, collationType: NSFetchIndexElementType); + + #[method(isAscending)] + pub unsafe fn isAscending(&self) -> bool; + + #[method(setAscending:)] + pub unsafe fn setAscending(&self, ascending: bool); + + #[method_id(@__retain_semantics Other indexDescription)] + pub unsafe fn indexDescription(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSFetchRequest.rs b/crates/icrate/src/generated/CoreData/NSFetchRequest.rs new file mode 100644 index 000000000..a1f072d78 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSFetchRequest.rs @@ -0,0 +1,231 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFetchRequestResultType { + NSManagedObjectResultType = 0x00, + NSManagedObjectIDResultType = 0x01, + NSDictionaryResultType = 0x02, + NSCountResultType = 0x04, + } +); + +extern_protocol!( + pub struct NSFetchRequestResult; + + unsafe impl NSFetchRequestResult {} +); + +extern_methods!( + /// NSFetchedResultSupport + unsafe impl NSNumber {} +); + +extern_methods!( + /// NSFetchedResultSupport + unsafe impl NSDictionary {} +); + +extern_methods!( + /// NSFetchedResultSupport + unsafe impl NSManagedObject {} +); + +extern_methods!( + /// NSFetchedResultSupport + unsafe impl NSManagedObjectID {} +); + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSFetchRequest { + _inner0: PhantomData<*mut ResultType>, + } + + unsafe impl ClassType for NSFetchRequest { + type Super = NSPersistentStoreRequest; + } +); + +extern_methods!( + unsafe impl NSFetchRequest { + #[method_id(@__retain_semantics Other fetchRequestWithEntityName:)] + pub unsafe fn fetchRequestWithEntityName(entityName: &NSString) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithEntityName:)] + pub unsafe fn initWithEntityName( + this: Option>, + entityName: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other execute:)] + pub unsafe fn execute( + &self, + ) -> Result, Shared>, Id>; + + #[method_id(@__retain_semantics Other entity)] + pub unsafe fn entity(&self) -> Option>; + + #[method(setEntity:)] + pub unsafe fn setEntity(&self, entity: Option<&NSEntityDescription>); + + #[method_id(@__retain_semantics Other entityName)] + pub unsafe fn entityName(&self) -> Option>; + + #[method_id(@__retain_semantics Other predicate)] + pub unsafe fn predicate(&self) -> Option>; + + #[method(setPredicate:)] + pub unsafe fn setPredicate(&self, predicate: Option<&NSPredicate>); + + #[method_id(@__retain_semantics Other sortDescriptors)] + pub unsafe fn sortDescriptors(&self) -> Option, Shared>>; + + #[method(setSortDescriptors:)] + pub unsafe fn setSortDescriptors( + &self, + sortDescriptors: Option<&NSArray>, + ); + + #[method(fetchLimit)] + pub unsafe fn fetchLimit(&self) -> NSUInteger; + + #[method(setFetchLimit:)] + pub unsafe fn setFetchLimit(&self, fetchLimit: NSUInteger); + + #[method_id(@__retain_semantics Other affectedStores)] + pub unsafe fn affectedStores(&self) -> Option, Shared>>; + + #[method(setAffectedStores:)] + pub unsafe fn setAffectedStores(&self, affectedStores: Option<&NSArray>); + + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSFetchRequestResultType; + + #[method(setResultType:)] + pub unsafe fn setResultType(&self, resultType: NSFetchRequestResultType); + + #[method(includesSubentities)] + pub unsafe fn includesSubentities(&self) -> bool; + + #[method(setIncludesSubentities:)] + pub unsafe fn setIncludesSubentities(&self, includesSubentities: bool); + + #[method(includesPropertyValues)] + pub unsafe fn includesPropertyValues(&self) -> bool; + + #[method(setIncludesPropertyValues:)] + pub unsafe fn setIncludesPropertyValues(&self, includesPropertyValues: bool); + + #[method(returnsObjectsAsFaults)] + pub unsafe fn returnsObjectsAsFaults(&self) -> bool; + + #[method(setReturnsObjectsAsFaults:)] + pub unsafe fn setReturnsObjectsAsFaults(&self, returnsObjectsAsFaults: bool); + + #[method_id(@__retain_semantics Other relationshipKeyPathsForPrefetching)] + pub unsafe fn relationshipKeyPathsForPrefetching( + &self, + ) -> Option, Shared>>; + + #[method(setRelationshipKeyPathsForPrefetching:)] + pub unsafe fn setRelationshipKeyPathsForPrefetching( + &self, + relationshipKeyPathsForPrefetching: Option<&NSArray>, + ); + + #[method(includesPendingChanges)] + pub unsafe fn includesPendingChanges(&self) -> bool; + + #[method(setIncludesPendingChanges:)] + pub unsafe fn setIncludesPendingChanges(&self, includesPendingChanges: bool); + + #[method(returnsDistinctResults)] + pub unsafe fn returnsDistinctResults(&self) -> bool; + + #[method(setReturnsDistinctResults:)] + pub unsafe fn setReturnsDistinctResults(&self, returnsDistinctResults: bool); + + #[method_id(@__retain_semantics Other propertiesToFetch)] + pub unsafe fn propertiesToFetch(&self) -> Option>; + + #[method(setPropertiesToFetch:)] + pub unsafe fn setPropertiesToFetch(&self, propertiesToFetch: Option<&NSArray>); + + #[method(fetchOffset)] + pub unsafe fn fetchOffset(&self) -> NSUInteger; + + #[method(setFetchOffset:)] + pub unsafe fn setFetchOffset(&self, fetchOffset: NSUInteger); + + #[method(fetchBatchSize)] + pub unsafe fn fetchBatchSize(&self) -> NSUInteger; + + #[method(setFetchBatchSize:)] + pub unsafe fn setFetchBatchSize(&self, fetchBatchSize: NSUInteger); + + #[method(shouldRefreshRefetchedObjects)] + pub unsafe fn shouldRefreshRefetchedObjects(&self) -> bool; + + #[method(setShouldRefreshRefetchedObjects:)] + pub unsafe fn setShouldRefreshRefetchedObjects(&self, shouldRefreshRefetchedObjects: bool); + + #[method_id(@__retain_semantics Other propertiesToGroupBy)] + pub unsafe fn propertiesToGroupBy(&self) -> Option>; + + #[method(setPropertiesToGroupBy:)] + pub unsafe fn setPropertiesToGroupBy(&self, propertiesToGroupBy: Option<&NSArray>); + + #[method_id(@__retain_semantics Other havingPredicate)] + pub unsafe fn havingPredicate(&self) -> Option>; + + #[method(setHavingPredicate:)] + pub unsafe fn setHavingPredicate(&self, havingPredicate: Option<&NSPredicate>); + } +); + +pub type NSPersistentStoreAsynchronousFetchResultCompletionBlock = + *mut Block<(NonNull,), ()>; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSAsynchronousFetchRequest { + _inner0: PhantomData<*mut ResultType>, + } + + unsafe impl ClassType for NSAsynchronousFetchRequest { + type Super = NSPersistentStoreRequest; + } +); + +extern_methods!( + unsafe impl NSAsynchronousFetchRequest { + #[method_id(@__retain_semantics Other fetchRequest)] + pub unsafe fn fetchRequest(&self) -> Id, Shared>; + + #[method(completionBlock)] + pub unsafe fn completionBlock( + &self, + ) -> NSPersistentStoreAsynchronousFetchResultCompletionBlock; + + #[method(estimatedResultCount)] + pub unsafe fn estimatedResultCount(&self) -> NSInteger; + + #[method(setEstimatedResultCount:)] + pub unsafe fn setEstimatedResultCount(&self, estimatedResultCount: NSInteger); + + #[method_id(@__retain_semantics Init initWithFetchRequest:completionBlock:)] + pub unsafe fn initWithFetchRequest_completionBlock( + this: Option>, + request: &NSFetchRequest, + blk: Option<&Block<(NonNull>,), ()>>, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSFetchRequestExpression.rs b/crates/icrate/src/generated/CoreData/NSFetchRequestExpression.rs new file mode 100644 index 000000000..42d4a6488 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSFetchRequestExpression.rs @@ -0,0 +1,36 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSFetchRequestExpressionType: NSExpressionType = 50); + +extern_class!( + #[derive(Debug)] + pub struct NSFetchRequestExpression; + + unsafe impl ClassType for NSFetchRequestExpression { + type Super = NSExpression; + } +); + +extern_methods!( + unsafe impl NSFetchRequestExpression { + #[method_id(@__retain_semantics Other expressionForFetch:context:countOnly:)] + pub unsafe fn expressionForFetch_context_countOnly( + fetch: &NSExpression, + context: &NSExpression, + countFlag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other requestExpression)] + pub unsafe fn requestExpression(&self) -> Id; + + #[method_id(@__retain_semantics Other contextExpression)] + pub unsafe fn contextExpression(&self) -> Id; + + #[method(isCountOnlyRequest)] + pub unsafe fn isCountOnlyRequest(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSFetchedPropertyDescription.rs b/crates/icrate/src/generated/CoreData/NSFetchedPropertyDescription.rs new file mode 100644 index 000000000..82b8eacb1 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSFetchedPropertyDescription.rs @@ -0,0 +1,24 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSFetchedPropertyDescription; + + unsafe impl ClassType for NSFetchedPropertyDescription { + type Super = NSPropertyDescription; + } +); + +extern_methods!( + unsafe impl NSFetchedPropertyDescription { + #[method_id(@__retain_semantics Other fetchRequest)] + pub unsafe fn fetchRequest(&self) -> Option>; + + #[method(setFetchRequest:)] + pub unsafe fn setFetchRequest(&self, fetchRequest: Option<&NSFetchRequest>); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSFetchedResultsController.rs b/crates/icrate/src/generated/CoreData/NSFetchedResultsController.rs new file mode 100644 index 000000000..443f53abf --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSFetchedResultsController.rs @@ -0,0 +1,171 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSFetchedResultsController { + _inner0: PhantomData<*mut ResultType>, + } + + unsafe impl ClassType for NSFetchedResultsController { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFetchedResultsController { + #[method_id(@__retain_semantics Init initWithFetchRequest:managedObjectContext:sectionNameKeyPath:cacheName:)] + pub unsafe fn initWithFetchRequest_managedObjectContext_sectionNameKeyPath_cacheName( + this: Option>, + fetchRequest: &NSFetchRequest, + context: &NSManagedObjectContext, + sectionNameKeyPath: Option<&NSString>, + name: Option<&NSString>, + ) -> Id; + + #[method(performFetch:)] + pub unsafe fn performFetch(&self) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other fetchRequest)] + pub unsafe fn fetchRequest(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other managedObjectContext)] + pub unsafe fn managedObjectContext(&self) -> Id; + + #[method_id(@__retain_semantics Other sectionNameKeyPath)] + pub unsafe fn sectionNameKeyPath(&self) -> Option>; + + #[method_id(@__retain_semantics Other cacheName)] + pub unsafe fn cacheName(&self) -> Option>; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSFetchedResultsControllerDelegate>); + + #[method(deleteCacheWithName:)] + pub unsafe fn deleteCacheWithName(name: Option<&NSString>); + + #[method_id(@__retain_semantics Other fetchedObjects)] + pub unsafe fn fetchedObjects(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other objectAtIndexPath:)] + pub unsafe fn objectAtIndexPath(&self, indexPath: &NSIndexPath) -> Id; + + #[method_id(@__retain_semantics Other indexPathForObject:)] + pub unsafe fn indexPathForObject( + &self, + object: &ResultType, + ) -> Option>; + + #[method_id(@__retain_semantics Other sectionIndexTitleForSectionName:)] + pub unsafe fn sectionIndexTitleForSectionName( + &self, + sectionName: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other sectionIndexTitles)] + pub unsafe fn sectionIndexTitles(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other sections)] + pub unsafe fn sections(&self) -> Option, Shared>>; + + #[method(sectionForSectionIndexTitle:atIndex:)] + pub unsafe fn sectionForSectionIndexTitle_atIndex( + &self, + title: &NSString, + sectionIndex: NSInteger, + ) -> NSInteger; + } +); + +extern_protocol!( + pub struct NSFetchedResultsSectionInfo; + + unsafe impl NSFetchedResultsSectionInfo { + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other indexTitle)] + pub unsafe fn indexTitle(&self) -> Option>; + + #[method(numberOfObjects)] + pub unsafe fn numberOfObjects(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other objects)] + pub unsafe fn objects(&self) -> Option>; + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSFetchedResultsChangeType { + NSFetchedResultsChangeInsert = 1, + NSFetchedResultsChangeDelete = 2, + NSFetchedResultsChangeMove = 3, + NSFetchedResultsChangeUpdate = 4, + } +); + +extern_protocol!( + pub struct NSFetchedResultsControllerDelegate; + + unsafe impl NSFetchedResultsControllerDelegate { + #[optional] + #[method(controller:didChangeContentWithSnapshot:)] + pub unsafe fn controller_didChangeContentWithSnapshot( + &self, + controller: &NSFetchedResultsController, + snapshot: &NSDiffableDataSourceSnapshot, + ); + + #[optional] + #[method(controller:didChangeContentWithDifference:)] + pub unsafe fn controller_didChangeContentWithDifference( + &self, + controller: &NSFetchedResultsController, + diff: &NSOrderedCollectionDifference, + ); + + #[optional] + #[method(controller:didChangeObject:atIndexPath:forChangeType:newIndexPath:)] + pub unsafe fn controller_didChangeObject_atIndexPath_forChangeType_newIndexPath( + &self, + controller: &NSFetchedResultsController, + anObject: &Object, + indexPath: Option<&NSIndexPath>, + type_: NSFetchedResultsChangeType, + newIndexPath: Option<&NSIndexPath>, + ); + + #[optional] + #[method(controller:didChangeSection:atIndex:forChangeType:)] + pub unsafe fn controller_didChangeSection_atIndex_forChangeType( + &self, + controller: &NSFetchedResultsController, + sectionInfo: &NSFetchedResultsSectionInfo, + sectionIndex: NSUInteger, + type_: NSFetchedResultsChangeType, + ); + + #[optional] + #[method(controllerWillChangeContent:)] + pub unsafe fn controllerWillChangeContent(&self, controller: &NSFetchedResultsController); + + #[optional] + #[method(controllerDidChangeContent:)] + pub unsafe fn controllerDidChangeContent(&self, controller: &NSFetchedResultsController); + + #[optional] + #[method_id(@__retain_semantics Other controller:sectionIndexTitleForSectionName:)] + pub unsafe fn controller_sectionIndexTitleForSectionName( + &self, + controller: &NSFetchedResultsController, + sectionName: &NSString, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSIncrementalStore.rs b/crates/icrate/src/generated/CoreData/NSIncrementalStore.rs new file mode 100644 index 000000000..3adeecb15 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSIncrementalStore.rs @@ -0,0 +1,77 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSIncrementalStore; + + unsafe impl ClassType for NSIncrementalStore { + type Super = NSPersistentStore; + } +); + +extern_methods!( + unsafe impl NSIncrementalStore { + #[method(loadMetadata:)] + pub unsafe fn loadMetadata(&self) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other executeRequest:withContext:error:)] + pub unsafe fn executeRequest_withContext_error( + &self, + request: &NSPersistentStoreRequest, + context: Option<&NSManagedObjectContext>, + ) -> Result, Id>; + + #[method_id(@__retain_semantics New newValuesForObjectWithID:withContext:error:)] + pub unsafe fn newValuesForObjectWithID_withContext_error( + &self, + objectID: &NSManagedObjectID, + context: &NSManagedObjectContext, + ) -> Result, Id>; + + #[method_id(@__retain_semantics New newValueForRelationship:forObjectWithID:withContext:error:)] + pub unsafe fn newValueForRelationship_forObjectWithID_withContext_error( + &self, + relationship: &NSRelationshipDescription, + objectID: &NSManagedObjectID, + context: Option<&NSManagedObjectContext>, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other identifierForNewStoreAtURL:)] + pub unsafe fn identifierForNewStoreAtURL(storeURL: &NSURL) -> Id; + + #[method_id(@__retain_semantics Other obtainPermanentIDsForObjects:error:)] + pub unsafe fn obtainPermanentIDsForObjects_error( + &self, + array: &NSArray, + ) -> Result, Shared>, Id>; + + #[method(managedObjectContextDidRegisterObjectsWithIDs:)] + pub unsafe fn managedObjectContextDidRegisterObjectsWithIDs( + &self, + objectIDs: &NSArray, + ); + + #[method(managedObjectContextDidUnregisterObjectsWithIDs:)] + pub unsafe fn managedObjectContextDidUnregisterObjectsWithIDs( + &self, + objectIDs: &NSArray, + ); + + #[method_id(@__retain_semantics New newObjectIDForEntity:referenceObject:)] + pub unsafe fn newObjectIDForEntity_referenceObject( + &self, + entity: &NSEntityDescription, + data: &Object, + ) -> Id; + + #[method_id(@__retain_semantics Other referenceObjectForObjectID:)] + pub unsafe fn referenceObjectForObjectID( + &self, + objectID: &NSManagedObjectID, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSIncrementalStoreNode.rs b/crates/icrate/src/generated/CoreData/NSIncrementalStoreNode.rs new file mode 100644 index 000000000..d58e8b5f3 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSIncrementalStoreNode.rs @@ -0,0 +1,45 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSIncrementalStoreNode; + + unsafe impl ClassType for NSIncrementalStoreNode { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSIncrementalStoreNode { + #[method_id(@__retain_semantics Init initWithObjectID:withValues:version:)] + pub unsafe fn initWithObjectID_withValues_version( + this: Option>, + objectID: &NSManagedObjectID, + values: &NSDictionary, + version: u64, + ) -> Id; + + #[method(updateWithValues:version:)] + pub unsafe fn updateWithValues_version( + &self, + values: &NSDictionary, + version: u64, + ); + + #[method_id(@__retain_semantics Other objectID)] + pub unsafe fn objectID(&self) -> Id; + + #[method(version)] + pub unsafe fn version(&self) -> u64; + + #[method_id(@__retain_semantics Other valueForPropertyDescription:)] + pub unsafe fn valueForPropertyDescription( + &self, + prop: &NSPropertyDescription, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSManagedObject.rs b/crates/icrate/src/generated/CoreData/NSManagedObject.rs new file mode 100644 index 000000000..2cc33af74 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSManagedObject.rs @@ -0,0 +1,188 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSSnapshotEventType { + NSSnapshotEventUndoInsertion = 1 << 1, + NSSnapshotEventUndoDeletion = 1 << 2, + NSSnapshotEventUndoUpdate = 1 << 3, + NSSnapshotEventRollback = 1 << 4, + NSSnapshotEventRefresh = 1 << 5, + NSSnapshotEventMergePolicy = 1 << 6, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSManagedObject; + + unsafe impl ClassType for NSManagedObject { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSManagedObject { + #[method(contextShouldIgnoreUnmodeledPropertyChanges)] + pub unsafe fn contextShouldIgnoreUnmodeledPropertyChanges() -> bool; + + #[method_id(@__retain_semantics Other fetchRequest)] + pub unsafe fn fetchRequest() -> Id; + + #[method_id(@__retain_semantics Init initWithEntity:insertIntoManagedObjectContext:)] + pub unsafe fn initWithEntity_insertIntoManagedObjectContext( + this: Option>, + entity: &NSEntityDescription, + context: Option<&NSManagedObjectContext>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithContext:)] + pub unsafe fn initWithContext( + this: Option>, + moc: &NSManagedObjectContext, + ) -> Id; + + #[method_id(@__retain_semantics Other managedObjectContext)] + pub unsafe fn managedObjectContext(&self) -> Option>; + + #[method_id(@__retain_semantics Other entity)] + pub unsafe fn entity(&self) -> Id; + + #[method_id(@__retain_semantics Other objectID)] + pub unsafe fn objectID(&self) -> Id; + + #[method(isInserted)] + pub unsafe fn isInserted(&self) -> bool; + + #[method(isUpdated)] + pub unsafe fn isUpdated(&self) -> bool; + + #[method(isDeleted)] + pub unsafe fn isDeleted(&self) -> bool; + + #[method(hasChanges)] + pub unsafe fn hasChanges(&self) -> bool; + + #[method(hasPersistentChangedValues)] + pub unsafe fn hasPersistentChangedValues(&self) -> bool; + + #[method(isFault)] + pub unsafe fn isFault(&self) -> bool; + + #[method(hasFaultForRelationshipNamed:)] + pub unsafe fn hasFaultForRelationshipNamed(&self, key: &NSString) -> bool; + + #[method_id(@__retain_semantics Other objectIDsForRelationshipNamed:)] + pub unsafe fn objectIDsForRelationshipNamed( + &self, + key: &NSString, + ) -> Id, Shared>; + + #[method(faultingState)] + pub unsafe fn faultingState(&self) -> NSUInteger; + + #[method(willAccessValueForKey:)] + pub unsafe fn willAccessValueForKey(&self, key: Option<&NSString>); + + #[method(didAccessValueForKey:)] + pub unsafe fn didAccessValueForKey(&self, key: Option<&NSString>); + + #[method(willChangeValueForKey:)] + pub unsafe fn willChangeValueForKey(&self, key: &NSString); + + #[method(didChangeValueForKey:)] + pub unsafe fn didChangeValueForKey(&self, key: &NSString); + + #[method(willChangeValueForKey:withSetMutation:usingObjects:)] + pub unsafe fn willChangeValueForKey_withSetMutation_usingObjects( + &self, + inKey: &NSString, + inMutationKind: NSKeyValueSetMutationKind, + inObjects: &NSSet, + ); + + #[method(didChangeValueForKey:withSetMutation:usingObjects:)] + pub unsafe fn didChangeValueForKey_withSetMutation_usingObjects( + &self, + inKey: &NSString, + inMutationKind: NSKeyValueSetMutationKind, + inObjects: &NSSet, + ); + + #[method(awakeFromFetch)] + pub unsafe fn awakeFromFetch(&self); + + #[method(awakeFromInsert)] + pub unsafe fn awakeFromInsert(&self); + + #[method(awakeFromSnapshotEvents:)] + pub unsafe fn awakeFromSnapshotEvents(&self, flags: NSSnapshotEventType); + + #[method(prepareForDeletion)] + pub unsafe fn prepareForDeletion(&self); + + #[method(willSave)] + pub unsafe fn willSave(&self); + + #[method(didSave)] + pub unsafe fn didSave(&self); + + #[method(willTurnIntoFault)] + pub unsafe fn willTurnIntoFault(&self); + + #[method(didTurnIntoFault)] + pub unsafe fn didTurnIntoFault(&self); + + #[method_id(@__retain_semantics Other valueForKey:)] + pub unsafe fn valueForKey(&self, key: &NSString) -> Option>; + + #[method(setValue:forKey:)] + pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString); + + #[method_id(@__retain_semantics Other primitiveValueForKey:)] + pub unsafe fn primitiveValueForKey(&self, key: &NSString) -> Option>; + + #[method(setPrimitiveValue:forKey:)] + pub unsafe fn setPrimitiveValue_forKey(&self, value: Option<&Object>, key: &NSString); + + #[method_id(@__retain_semantics Other committedValuesForKeys:)] + pub unsafe fn committedValuesForKeys( + &self, + keys: Option<&NSArray>, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other changedValues)] + pub unsafe fn changedValues(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other changedValuesForCurrentEvent)] + pub unsafe fn changedValuesForCurrentEvent( + &self, + ) -> Id, Shared>; + + #[method(validateValue:forKey:error:)] + pub unsafe fn validateValue_forKey_error( + &self, + value: NonNull<*mut Object>, + key: &NSString, + ) -> Result<(), Id>; + + #[method(validateForDelete:)] + pub unsafe fn validateForDelete(&self) -> Result<(), Id>; + + #[method(validateForInsert:)] + pub unsafe fn validateForInsert(&self) -> Result<(), Id>; + + #[method(validateForUpdate:)] + pub unsafe fn validateForUpdate(&self) -> Result<(), Id>; + + #[method(setObservationInfo:)] + pub unsafe fn setObservationInfo(&self, inObservationInfo: *mut c_void); + + #[method(observationInfo)] + pub unsafe fn observationInfo(&self) -> *mut c_void; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSManagedObjectContext.rs b/crates/icrate/src/generated/CoreData/NSManagedObjectContext.rs new file mode 100644 index 000000000..2e7d1f3b2 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSManagedObjectContext.rs @@ -0,0 +1,300 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSManagedObjectContextWillSaveNotification: &'static NSString); + +extern_static!(NSManagedObjectContextDidSaveNotification: &'static NSString); + +extern_static!(NSManagedObjectContextObjectsDidChangeNotification: &'static NSString); + +extern_static!(NSManagedObjectContextDidSaveObjectIDsNotification: &'static NSString); + +extern_static!(NSManagedObjectContextDidMergeChangesObjectIDsNotification: &'static NSString); + +extern_static!(NSInsertedObjectsKey: &'static NSString); + +extern_static!(NSUpdatedObjectsKey: &'static NSString); + +extern_static!(NSDeletedObjectsKey: &'static NSString); + +extern_static!(NSRefreshedObjectsKey: &'static NSString); + +extern_static!(NSInvalidatedObjectsKey: &'static NSString); + +extern_static!(NSManagedObjectContextQueryGenerationKey: &'static NSString); + +extern_static!(NSInvalidatedAllObjectsKey: &'static NSString); + +extern_static!(NSInsertedObjectIDsKey: &'static NSString); + +extern_static!(NSUpdatedObjectIDsKey: &'static NSString); + +extern_static!(NSDeletedObjectIDsKey: &'static NSString); + +extern_static!(NSRefreshedObjectIDsKey: &'static NSString); + +extern_static!(NSInvalidatedObjectIDsKey: &'static NSString); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSManagedObjectContextConcurrencyType { + NSConfinementConcurrencyType = 0x00, + NSPrivateQueueConcurrencyType = 0x01, + NSMainQueueConcurrencyType = 0x02, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSManagedObjectContext; + + unsafe impl ClassType for NSManagedObjectContext { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSManagedObjectContext { + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithConcurrencyType:)] + pub unsafe fn initWithConcurrencyType( + this: Option>, + ct: NSManagedObjectContextConcurrencyType, + ) -> Id; + + #[method(performBlock:)] + pub unsafe fn performBlock(&self, block: &Block<(), ()>); + + #[method(performBlockAndWait:)] + pub unsafe fn performBlockAndWait(&self, block: &Block<(), ()>); + + #[method_id(@__retain_semantics Other persistentStoreCoordinator)] + pub unsafe fn persistentStoreCoordinator( + &self, + ) -> Option>; + + #[method(setPersistentStoreCoordinator:)] + pub unsafe fn setPersistentStoreCoordinator( + &self, + persistentStoreCoordinator: Option<&NSPersistentStoreCoordinator>, + ); + + #[method_id(@__retain_semantics Other parentContext)] + pub unsafe fn parentContext(&self) -> Option>; + + #[method(setParentContext:)] + pub unsafe fn setParentContext(&self, parentContext: Option<&NSManagedObjectContext>); + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + + #[method_id(@__retain_semantics Other undoManager)] + pub unsafe fn undoManager(&self) -> Option>; + + #[method(setUndoManager:)] + pub unsafe fn setUndoManager(&self, undoManager: Option<&NSUndoManager>); + + #[method(hasChanges)] + pub unsafe fn hasChanges(&self) -> bool; + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Id; + + #[method(concurrencyType)] + pub unsafe fn concurrencyType(&self) -> NSManagedObjectContextConcurrencyType; + + #[method_id(@__retain_semantics Other objectRegisteredForID:)] + pub unsafe fn objectRegisteredForID( + &self, + objectID: &NSManagedObjectID, + ) -> Option>; + + #[method_id(@__retain_semantics Other objectWithID:)] + pub unsafe fn objectWithID( + &self, + objectID: &NSManagedObjectID, + ) -> Id; + + #[method_id(@__retain_semantics Other existingObjectWithID:error:)] + pub unsafe fn existingObjectWithID_error( + &self, + objectID: &NSManagedObjectID, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other executeFetchRequest:error:)] + pub unsafe fn executeFetchRequest_error( + &self, + request: &NSFetchRequest, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other executeRequest:error:)] + pub unsafe fn executeRequest_error( + &self, + request: &NSPersistentStoreRequest, + ) -> Result, Id>; + + #[method(insertObject:)] + pub unsafe fn insertObject(&self, object: &NSManagedObject); + + #[method(deleteObject:)] + pub unsafe fn deleteObject(&self, object: &NSManagedObject); + + #[method(refreshObject:mergeChanges:)] + pub unsafe fn refreshObject_mergeChanges(&self, object: &NSManagedObject, flag: bool); + + #[method(detectConflictsForObject:)] + pub unsafe fn detectConflictsForObject(&self, object: &NSManagedObject); + + #[method(observeValueForKeyPath:ofObject:change:context:)] + pub unsafe fn observeValueForKeyPath_ofObject_change_context( + &self, + keyPath: Option<&NSString>, + object: Option<&Object>, + change: Option<&NSDictionary>, + context: *mut c_void, + ); + + #[method(processPendingChanges)] + pub unsafe fn processPendingChanges(&self); + + #[method(assignObject:toPersistentStore:)] + pub unsafe fn assignObject_toPersistentStore( + &self, + object: &Object, + store: &NSPersistentStore, + ); + + #[method_id(@__retain_semantics Other insertedObjects)] + pub unsafe fn insertedObjects(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other updatedObjects)] + pub unsafe fn updatedObjects(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other deletedObjects)] + pub unsafe fn deletedObjects(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other registeredObjects)] + pub unsafe fn registeredObjects(&self) -> Id, Shared>; + + #[method(undo)] + pub unsafe fn undo(&self); + + #[method(redo)] + pub unsafe fn redo(&self); + + #[method(reset)] + pub unsafe fn reset(&self); + + #[method(rollback)] + pub unsafe fn rollback(&self); + + #[method(save:)] + pub unsafe fn save(&self) -> Result<(), Id>; + + #[method(refreshAllObjects)] + pub unsafe fn refreshAllObjects(&self); + + #[method(lock)] + pub unsafe fn lock(&self); + + #[method(unlock)] + pub unsafe fn unlock(&self); + + #[method(tryLock)] + pub unsafe fn tryLock(&self) -> bool; + + #[method(propagatesDeletesAtEndOfEvent)] + pub unsafe fn propagatesDeletesAtEndOfEvent(&self) -> bool; + + #[method(setPropagatesDeletesAtEndOfEvent:)] + pub unsafe fn setPropagatesDeletesAtEndOfEvent(&self, propagatesDeletesAtEndOfEvent: bool); + + #[method(retainsRegisteredObjects)] + pub unsafe fn retainsRegisteredObjects(&self) -> bool; + + #[method(setRetainsRegisteredObjects:)] + pub unsafe fn setRetainsRegisteredObjects(&self, retainsRegisteredObjects: bool); + + #[method(shouldDeleteInaccessibleFaults)] + pub unsafe fn shouldDeleteInaccessibleFaults(&self) -> bool; + + #[method(setShouldDeleteInaccessibleFaults:)] + pub unsafe fn setShouldDeleteInaccessibleFaults( + &self, + shouldDeleteInaccessibleFaults: bool, + ); + + #[method(shouldHandleInaccessibleFault:forObjectID:triggeredByProperty:)] + pub unsafe fn shouldHandleInaccessibleFault_forObjectID_triggeredByProperty( + &self, + fault: &NSManagedObject, + oid: &NSManagedObjectID, + property: Option<&NSPropertyDescription>, + ) -> bool; + + #[method(stalenessInterval)] + pub unsafe fn stalenessInterval(&self) -> NSTimeInterval; + + #[method(setStalenessInterval:)] + pub unsafe fn setStalenessInterval(&self, stalenessInterval: NSTimeInterval); + + #[method_id(@__retain_semantics Other mergePolicy)] + pub unsafe fn mergePolicy(&self) -> Id; + + #[method(setMergePolicy:)] + pub unsafe fn setMergePolicy(&self, mergePolicy: &Object); + + #[method(obtainPermanentIDsForObjects:error:)] + pub unsafe fn obtainPermanentIDsForObjects_error( + &self, + objects: &NSArray, + ) -> Result<(), Id>; + + #[method(mergeChangesFromContextDidSaveNotification:)] + pub unsafe fn mergeChangesFromContextDidSaveNotification( + &self, + notification: &NSNotification, + ); + + #[method(mergeChangesFromRemoteContextSave:intoContexts:)] + pub unsafe fn mergeChangesFromRemoteContextSave_intoContexts( + changeNotificationData: &NSDictionary, + contexts: &NSArray, + ); + + #[method_id(@__retain_semantics Other queryGenerationToken)] + pub unsafe fn queryGenerationToken(&self) -> Option>; + + #[method(setQueryGenerationFromToken:error:)] + pub unsafe fn setQueryGenerationFromToken_error( + &self, + generation: Option<&NSQueryGenerationToken>, + ) -> Result<(), Id>; + + #[method(automaticallyMergesChangesFromParent)] + pub unsafe fn automaticallyMergesChangesFromParent(&self) -> bool; + + #[method(setAutomaticallyMergesChangesFromParent:)] + pub unsafe fn setAutomaticallyMergesChangesFromParent( + &self, + automaticallyMergesChangesFromParent: bool, + ); + + #[method_id(@__retain_semantics Other transactionAuthor)] + pub unsafe fn transactionAuthor(&self) -> Option>; + + #[method(setTransactionAuthor:)] + pub unsafe fn setTransactionAuthor(&self, transactionAuthor: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSManagedObjectID.rs b/crates/icrate/src/generated/CoreData/NSManagedObjectID.rs new file mode 100644 index 000000000..62b171570 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSManagedObjectID.rs @@ -0,0 +1,30 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSManagedObjectID; + + unsafe impl ClassType for NSManagedObjectID { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSManagedObjectID { + #[method_id(@__retain_semantics Other entity)] + pub unsafe fn entity(&self) -> Id; + + #[method_id(@__retain_semantics Other persistentStore)] + pub unsafe fn persistentStore(&self) -> Option>; + + #[method(isTemporaryID)] + pub unsafe fn isTemporaryID(&self) -> bool; + + #[method_id(@__retain_semantics Other URIRepresentation)] + pub unsafe fn URIRepresentation(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSManagedObjectModel.rs b/crates/icrate/src/generated/CoreData/NSManagedObjectModel.rs new file mode 100644 index 000000000..0b2673546 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSManagedObjectModel.rs @@ -0,0 +1,130 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSManagedObjectModel; + + unsafe impl ClassType for NSManagedObjectModel { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSManagedObjectModel { + #[method_id(@__retain_semantics Other mergedModelFromBundles:)] + pub unsafe fn mergedModelFromBundles( + bundles: Option<&NSArray>, + ) -> Option>; + + #[method_id(@__retain_semantics Other modelByMergingModels:)] + pub unsafe fn modelByMergingModels( + models: Option<&NSArray>, + ) -> Option>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:)] + pub unsafe fn initWithContentsOfURL( + this: Option>, + url: &NSURL, + ) -> Option>; + + #[method_id(@__retain_semantics Other entitiesByName)] + pub unsafe fn entitiesByName( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other entities)] + pub unsafe fn entities(&self) -> Id, Shared>; + + #[method(setEntities:)] + pub unsafe fn setEntities(&self, entities: &NSArray); + + #[method_id(@__retain_semantics Other configurations)] + pub unsafe fn configurations(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other entitiesForConfiguration:)] + pub unsafe fn entitiesForConfiguration( + &self, + configuration: Option<&NSString>, + ) -> Option, Shared>>; + + #[method(setEntities:forConfiguration:)] + pub unsafe fn setEntities_forConfiguration( + &self, + entities: &NSArray, + configuration: &NSString, + ); + + #[method(setFetchRequestTemplate:forName:)] + pub unsafe fn setFetchRequestTemplate_forName( + &self, + fetchRequestTemplate: Option<&NSFetchRequest>, + name: &NSString, + ); + + #[method_id(@__retain_semantics Other fetchRequestTemplateForName:)] + pub unsafe fn fetchRequestTemplateForName( + &self, + name: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other fetchRequestFromTemplateWithName:substitutionVariables:)] + pub unsafe fn fetchRequestFromTemplateWithName_substitutionVariables( + &self, + name: &NSString, + variables: &NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Other localizationDictionary)] + pub unsafe fn localizationDictionary( + &self, + ) -> Option, Shared>>; + + #[method(setLocalizationDictionary:)] + pub unsafe fn setLocalizationDictionary( + &self, + localizationDictionary: Option<&NSDictionary>, + ); + + #[method_id(@__retain_semantics Other mergedModelFromBundles:forStoreMetadata:)] + pub unsafe fn mergedModelFromBundles_forStoreMetadata( + bundles: Option<&NSArray>, + metadata: &NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Other modelByMergingModels:forStoreMetadata:)] + pub unsafe fn modelByMergingModels_forStoreMetadata( + models: &NSArray, + metadata: &NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Other fetchRequestTemplatesByName)] + pub unsafe fn fetchRequestTemplatesByName( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other versionIdentifiers)] + pub unsafe fn versionIdentifiers(&self) -> Id; + + #[method(setVersionIdentifiers:)] + pub unsafe fn setVersionIdentifiers(&self, versionIdentifiers: &NSSet); + + #[method(isConfiguration:compatibleWithStoreMetadata:)] + pub unsafe fn isConfiguration_compatibleWithStoreMetadata( + &self, + configuration: Option<&NSString>, + metadata: &NSDictionary, + ) -> bool; + + #[method_id(@__retain_semantics Other entityVersionHashesByName)] + pub unsafe fn entityVersionHashesByName( + &self, + ) -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSMappingModel.rs b/crates/icrate/src/generated/CoreData/NSMappingModel.rs new file mode 100644 index 000000000..358e16d3d --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSMappingModel.rs @@ -0,0 +1,48 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSMappingModel; + + unsafe impl ClassType for NSMappingModel { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMappingModel { + #[method_id(@__retain_semantics Other mappingModelFromBundles:forSourceModel:destinationModel:)] + pub unsafe fn mappingModelFromBundles_forSourceModel_destinationModel( + bundles: Option<&NSArray>, + sourceModel: Option<&NSManagedObjectModel>, + destinationModel: Option<&NSManagedObjectModel>, + ) -> Option>; + + #[method_id(@__retain_semantics Other inferredMappingModelForSourceModel:destinationModel:error:)] + pub unsafe fn inferredMappingModelForSourceModel_destinationModel_error( + sourceModel: &NSManagedObjectModel, + destinationModel: &NSManagedObjectModel, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:)] + pub unsafe fn initWithContentsOfURL( + this: Option>, + url: Option<&NSURL>, + ) -> Option>; + + #[method_id(@__retain_semantics Other entityMappings)] + pub unsafe fn entityMappings(&self) -> Option, Shared>>; + + #[method(setEntityMappings:)] + pub unsafe fn setEntityMappings(&self, entityMappings: Option<&NSArray>); + + #[method_id(@__retain_semantics Other entityMappingsByName)] + pub unsafe fn entityMappingsByName( + &self, + ) -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSMergePolicy.rs b/crates/icrate/src/generated/CoreData/NSMergePolicy.rs new file mode 100644 index 000000000..3e228063e --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSMergePolicy.rs @@ -0,0 +1,162 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSMergePolicyType { + NSErrorMergePolicyType = 0x00, + NSMergeByPropertyStoreTrumpMergePolicyType = 0x01, + NSMergeByPropertyObjectTrumpMergePolicyType = 0x02, + NSOverwriteMergePolicyType = 0x03, + NSRollbackMergePolicyType = 0x04, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMergeConflict; + + unsafe impl ClassType for NSMergeConflict { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMergeConflict { + #[method_id(@__retain_semantics Other sourceObject)] + pub unsafe fn sourceObject(&self) -> Id; + + #[method_id(@__retain_semantics Other objectSnapshot)] + pub unsafe fn objectSnapshot(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other cachedSnapshot)] + pub unsafe fn cachedSnapshot(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other persistedSnapshot)] + pub unsafe fn persistedSnapshot( + &self, + ) -> Option, Shared>>; + + #[method(newVersionNumber)] + pub unsafe fn newVersionNumber(&self) -> NSUInteger; + + #[method(oldVersionNumber)] + pub unsafe fn oldVersionNumber(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Init initWithSource:newVersion:oldVersion:cachedSnapshot:persistedSnapshot:)] + pub unsafe fn initWithSource_newVersion_oldVersion_cachedSnapshot_persistedSnapshot( + this: Option>, + srcObject: &NSManagedObject, + newvers: NSUInteger, + oldvers: NSUInteger, + cachesnap: Option<&NSDictionary>, + persnap: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSConstraintConflict; + + unsafe impl ClassType for NSConstraintConflict { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSConstraintConflict { + #[method_id(@__retain_semantics Other constraint)] + pub unsafe fn constraint(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other constraintValues)] + pub unsafe fn constraintValues(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other databaseObject)] + pub unsafe fn databaseObject(&self) -> Option>; + + #[method_id(@__retain_semantics Other databaseSnapshot)] + pub unsafe fn databaseSnapshot(&self) + -> Option, Shared>>; + + #[method_id(@__retain_semantics Other conflictingObjects)] + pub unsafe fn conflictingObjects(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other conflictingSnapshots)] + pub unsafe fn conflictingSnapshots(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Init initWithConstraint:databaseObject:databaseSnapshot:conflictingObjects:conflictingSnapshots:)] + pub unsafe fn initWithConstraint_databaseObject_databaseSnapshot_conflictingObjects_conflictingSnapshots( + this: Option>, + contraint: &NSArray, + databaseObject: Option<&NSManagedObject>, + databaseSnapshot: Option<&NSDictionary>, + conflictingObjects: &NSArray, + conflictingSnapshots: &NSArray, + ) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMergePolicy; + + unsafe impl ClassType for NSMergePolicy { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMergePolicy { + #[method_id(@__retain_semantics Other errorMergePolicy)] + pub unsafe fn errorMergePolicy() -> Id; + + #[method_id(@__retain_semantics Other rollbackMergePolicy)] + pub unsafe fn rollbackMergePolicy() -> Id; + + #[method_id(@__retain_semantics Other overwriteMergePolicy)] + pub unsafe fn overwriteMergePolicy() -> Id; + + #[method_id(@__retain_semantics Other mergeByPropertyObjectTrumpMergePolicy)] + pub unsafe fn mergeByPropertyObjectTrumpMergePolicy() -> Id; + + #[method_id(@__retain_semantics Other mergeByPropertyStoreTrumpMergePolicy)] + pub unsafe fn mergeByPropertyStoreTrumpMergePolicy() -> Id; + + #[method(mergeType)] + pub unsafe fn mergeType(&self) -> NSMergePolicyType; + + #[method_id(@__retain_semantics Init initWithMergeType:)] + pub unsafe fn initWithMergeType( + this: Option>, + ty: NSMergePolicyType, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(resolveConflicts:error:)] + pub unsafe fn resolveConflicts_error( + &self, + list: &NSArray, + ) -> Result<(), Id>; + + #[method(resolveOptimisticLockingVersionConflicts:error:)] + pub unsafe fn resolveOptimisticLockingVersionConflicts_error( + &self, + list: &NSArray, + ) -> Result<(), Id>; + + #[method(resolveConstraintConflicts:error:)] + pub unsafe fn resolveConstraintConflicts_error( + &self, + list: &NSArray, + ) -> Result<(), Id>; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSMigrationManager.rs b/crates/icrate/src/generated/CoreData/NSMigrationManager.rs new file mode 100644 index 000000000..f4c497e8c --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSMigrationManager.rs @@ -0,0 +1,113 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSMigrationManager; + + unsafe impl ClassType for NSMigrationManager { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMigrationManager { + #[method_id(@__retain_semantics Init initWithSourceModel:destinationModel:)] + pub unsafe fn initWithSourceModel_destinationModel( + this: Option>, + sourceModel: &NSManagedObjectModel, + destinationModel: &NSManagedObjectModel, + ) -> Id; + + #[method(migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:)] + pub unsafe fn migrateStoreFromURL_type_options_withMappingModel_toDestinationURL_destinationType_destinationOptions_error( + &self, + sourceURL: &NSURL, + sStoreType: &NSString, + sOptions: Option<&NSDictionary>, + mappings: Option<&NSMappingModel>, + dURL: &NSURL, + dStoreType: &NSString, + dOptions: Option<&NSDictionary>, + ) -> Result<(), Id>; + + #[method(usesStoreSpecificMigrationManager)] + pub unsafe fn usesStoreSpecificMigrationManager(&self) -> bool; + + #[method(setUsesStoreSpecificMigrationManager:)] + pub unsafe fn setUsesStoreSpecificMigrationManager( + &self, + usesStoreSpecificMigrationManager: bool, + ); + + #[method(reset)] + pub unsafe fn reset(&self); + + #[method_id(@__retain_semantics Other mappingModel)] + pub unsafe fn mappingModel(&self) -> Id; + + #[method_id(@__retain_semantics Other sourceModel)] + pub unsafe fn sourceModel(&self) -> Id; + + #[method_id(@__retain_semantics Other destinationModel)] + pub unsafe fn destinationModel(&self) -> Id; + + #[method_id(@__retain_semantics Other sourceContext)] + pub unsafe fn sourceContext(&self) -> Id; + + #[method_id(@__retain_semantics Other destinationContext)] + pub unsafe fn destinationContext(&self) -> Id; + + #[method_id(@__retain_semantics Other sourceEntityForEntityMapping:)] + pub unsafe fn sourceEntityForEntityMapping( + &self, + mEntity: &NSEntityMapping, + ) -> Option>; + + #[method_id(@__retain_semantics Other destinationEntityForEntityMapping:)] + pub unsafe fn destinationEntityForEntityMapping( + &self, + mEntity: &NSEntityMapping, + ) -> Option>; + + #[method(associateSourceInstance:withDestinationInstance:forEntityMapping:)] + pub unsafe fn associateSourceInstance_withDestinationInstance_forEntityMapping( + &self, + sourceInstance: &NSManagedObject, + destinationInstance: &NSManagedObject, + entityMapping: &NSEntityMapping, + ); + + #[method_id(@__retain_semantics Other destinationInstancesForEntityMappingNamed:sourceInstances:)] + pub unsafe fn destinationInstancesForEntityMappingNamed_sourceInstances( + &self, + mappingName: &NSString, + sourceInstances: Option<&NSArray>, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other sourceInstancesForEntityMappingNamed:destinationInstances:)] + pub unsafe fn sourceInstancesForEntityMappingNamed_destinationInstances( + &self, + mappingName: &NSString, + destinationInstances: Option<&NSArray>, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other currentEntityMapping)] + pub unsafe fn currentEntityMapping(&self) -> Id; + + #[method(migrationProgress)] + pub unsafe fn migrationProgress(&self) -> c_float; + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + + #[method(setUserInfo:)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>); + + #[method(cancelMigrationWithError:)] + pub unsafe fn cancelMigrationWithError(&self, error: &NSError); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentCloudKitContainer.rs b/crates/icrate/src/generated/CoreData/NSPersistentCloudKitContainer.rs new file mode 100644 index 000000000..41ece3901 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentCloudKitContainer.rs @@ -0,0 +1,48 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSPersistentCloudKitContainerSchemaInitializationOptions { + NSPersistentCloudKitContainerSchemaInitializationOptionsNone = 0, + NSPersistentCloudKitContainerSchemaInitializationOptionsDryRun = 1 << 1, + NSPersistentCloudKitContainerSchemaInitializationOptionsPrintSchema = 1 << 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentCloudKitContainer; + + unsafe impl ClassType for NSPersistentCloudKitContainer { + type Super = NSPersistentContainer; + } +); + +extern_methods!( + unsafe impl NSPersistentCloudKitContainer { + #[method(initializeCloudKitSchemaWithOptions:error:)] + pub unsafe fn initializeCloudKitSchemaWithOptions_error( + &self, + options: NSPersistentCloudKitContainerSchemaInitializationOptions, + ) -> Result<(), Id>; + + #[method(canUpdateRecordForManagedObjectWithID:)] + pub unsafe fn canUpdateRecordForManagedObjectWithID( + &self, + objectID: &NSManagedObjectID, + ) -> bool; + + #[method(canDeleteRecordForManagedObjectWithID:)] + pub unsafe fn canDeleteRecordForManagedObjectWithID( + &self, + objectID: &NSManagedObjectID, + ) -> bool; + + #[method(canModifyManagedObjectsInStore:)] + pub unsafe fn canModifyManagedObjectsInStore(&self, store: &NSPersistentStore) -> bool; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentCloudKitContainerEvent.rs b/crates/icrate/src/generated/CoreData/NSPersistentCloudKitContainerEvent.rs new file mode 100644 index 000000000..529c0c0f1 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentCloudKitContainerEvent.rs @@ -0,0 +1,58 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPersistentCloudKitContainerEventType { + NSPersistentCloudKitContainerEventTypeSetup = 0, + NSPersistentCloudKitContainerEventTypeImport = 1, + NSPersistentCloudKitContainerEventTypeExport = 2, + } +); + +extern_static!(NSPersistentCloudKitContainerEventChangedNotification: &'static NSNotificationName); + +extern_static!(NSPersistentCloudKitContainerEventUserInfoKey: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentCloudKitContainerEvent; + + unsafe impl ClassType for NSPersistentCloudKitContainerEvent { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPersistentCloudKitContainerEvent { + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Id; + + #[method_id(@__retain_semantics Other storeIdentifier)] + pub unsafe fn storeIdentifier(&self) -> Id; + + #[method(type)] + pub unsafe fn type_(&self) -> NSPersistentCloudKitContainerEventType; + + #[method_id(@__retain_semantics Other startDate)] + pub unsafe fn startDate(&self) -> Id; + + #[method_id(@__retain_semantics Other endDate)] + pub unsafe fn endDate(&self) -> Option>; + + #[method(succeeded)] + pub unsafe fn succeeded(&self) -> bool; + + #[method_id(@__retain_semantics Other error)] + pub unsafe fn error(&self) -> Option>; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentCloudKitContainerEventRequest.rs b/crates/icrate/src/generated/CoreData/NSPersistentCloudKitContainerEventRequest.rs new file mode 100644 index 000000000..fe1add1d4 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentCloudKitContainerEventRequest.rs @@ -0,0 +1,43 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentCloudKitContainerEventRequest; + + unsafe impl ClassType for NSPersistentCloudKitContainerEventRequest { + type Super = NSPersistentStoreRequest; + } +); + +extern_methods!( + unsafe impl NSPersistentCloudKitContainerEventRequest { + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSPersistentCloudKitContainerEventResultType; + + #[method(setResultType:)] + pub unsafe fn setResultType( + &self, + resultType: NSPersistentCloudKitContainerEventResultType, + ); + + #[method_id(@__retain_semantics Other fetchEventsAfterDate:)] + pub unsafe fn fetchEventsAfterDate(date: &NSDate) -> Id; + + #[method_id(@__retain_semantics Other fetchEventsAfterEvent:)] + pub unsafe fn fetchEventsAfterEvent( + event: Option<&NSPersistentCloudKitContainerEvent>, + ) -> Id; + + #[method_id(@__retain_semantics Other fetchEventsMatchingFetchRequest:)] + pub unsafe fn fetchEventsMatchingFetchRequest( + fetchRequest: &NSFetchRequest, + ) -> Id; + + #[method_id(@__retain_semantics Other fetchRequestForEvents)] + pub unsafe fn fetchRequestForEvents() -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentCloudKitContainerOptions.rs b/crates/icrate/src/generated/CoreData/NSPersistentCloudKitContainerOptions.rs new file mode 100644 index 000000000..78f2d5a68 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentCloudKitContainerOptions.rs @@ -0,0 +1,30 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentCloudKitContainerOptions; + + unsafe impl ClassType for NSPersistentCloudKitContainerOptions { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPersistentCloudKitContainerOptions { + #[method_id(@__retain_semantics Other containerIdentifier)] + pub unsafe fn containerIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithContainerIdentifier:)] + pub unsafe fn initWithContainerIdentifier( + this: Option>, + containerIdentifier: &NSString, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentContainer.rs b/crates/icrate/src/generated/CoreData/NSPersistentContainer.rs new file mode 100644 index 000000000..f6196b4d9 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentContainer.rs @@ -0,0 +1,82 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentContainer; + + unsafe impl ClassType for NSPersistentContainer { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPersistentContainer { + #[method_id(@__retain_semantics Other persistentContainerWithName:)] + pub unsafe fn persistentContainerWithName(name: &NSString) -> Id; + + #[method_id(@__retain_semantics Other persistentContainerWithName:managedObjectModel:)] + pub unsafe fn persistentContainerWithName_managedObjectModel( + name: &NSString, + model: &NSManagedObjectModel, + ) -> Id; + + #[method_id(@__retain_semantics Other defaultDirectoryURL)] + pub unsafe fn defaultDirectoryURL() -> Id; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other viewContext)] + pub unsafe fn viewContext(&self) -> Id; + + #[method_id(@__retain_semantics Other managedObjectModel)] + pub unsafe fn managedObjectModel(&self) -> Id; + + #[method_id(@__retain_semantics Other persistentStoreCoordinator)] + pub unsafe fn persistentStoreCoordinator(&self) + -> Id; + + #[method_id(@__retain_semantics Other persistentStoreDescriptions)] + pub unsafe fn persistentStoreDescriptions( + &self, + ) -> Id, Shared>; + + #[method(setPersistentStoreDescriptions:)] + pub unsafe fn setPersistentStoreDescriptions( + &self, + persistentStoreDescriptions: &NSArray, + ); + + #[method_id(@__retain_semantics Init initWithName:)] + pub unsafe fn initWithName( + this: Option>, + name: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithName:managedObjectModel:)] + pub unsafe fn initWithName_managedObjectModel( + this: Option>, + name: &NSString, + model: &NSManagedObjectModel, + ) -> Id; + + #[method(loadPersistentStoresWithCompletionHandler:)] + pub unsafe fn loadPersistentStoresWithCompletionHandler( + &self, + block: &Block<(NonNull, *mut NSError), ()>, + ); + + #[method_id(@__retain_semantics New newBackgroundContext)] + pub unsafe fn newBackgroundContext(&self) -> Id; + + #[method(performBackgroundTask:)] + pub unsafe fn performBackgroundTask( + &self, + block: &Block<(NonNull,), ()>, + ); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentHistoryChange.rs b/crates/icrate/src/generated/CoreData/NSPersistentHistoryChange.rs new file mode 100644 index 000000000..1e635d1fd --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentHistoryChange.rs @@ -0,0 +1,56 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPersistentHistoryChangeType { + NSPersistentHistoryChangeTypeInsert = 0, + NSPersistentHistoryChangeTypeUpdate = 1, + NSPersistentHistoryChangeTypeDelete = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentHistoryChange; + + unsafe impl ClassType for NSPersistentHistoryChange { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPersistentHistoryChange { + #[method_id(@__retain_semantics Other entityDescriptionWithContext:)] + pub unsafe fn entityDescriptionWithContext( + context: &NSManagedObjectContext, + ) -> Option>; + + #[method_id(@__retain_semantics Other entityDescription)] + pub unsafe fn entityDescription() -> Option>; + + #[method_id(@__retain_semantics Other fetchRequest)] + pub unsafe fn fetchRequest() -> Option>; + + #[method(changeID)] + pub unsafe fn changeID(&self) -> i64; + + #[method_id(@__retain_semantics Other changedObjectID)] + pub unsafe fn changedObjectID(&self) -> Id; + + #[method(changeType)] + pub unsafe fn changeType(&self) -> NSPersistentHistoryChangeType; + + #[method_id(@__retain_semantics Other tombstone)] + pub unsafe fn tombstone(&self) -> Option>; + + #[method_id(@__retain_semantics Other transaction)] + pub unsafe fn transaction(&self) -> Option>; + + #[method_id(@__retain_semantics Other updatedProperties)] + pub unsafe fn updatedProperties(&self) -> Option, Shared>>; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentHistoryChangeRequest.rs b/crates/icrate/src/generated/CoreData/NSPersistentHistoryChangeRequest.rs new file mode 100644 index 000000000..4f1107926 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentHistoryChangeRequest.rs @@ -0,0 +1,64 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentHistoryChangeRequest; + + unsafe impl ClassType for NSPersistentHistoryChangeRequest { + type Super = NSPersistentStoreRequest; + } +); + +extern_methods!( + unsafe impl NSPersistentHistoryChangeRequest { + #[method_id(@__retain_semantics Other fetchHistoryAfterDate:)] + pub unsafe fn fetchHistoryAfterDate(date: &NSDate) -> Id; + + #[method_id(@__retain_semantics Other fetchHistoryAfterToken:)] + pub unsafe fn fetchHistoryAfterToken( + token: Option<&NSPersistentHistoryToken>, + ) -> Id; + + #[method_id(@__retain_semantics Other fetchHistoryAfterTransaction:)] + pub unsafe fn fetchHistoryAfterTransaction( + transaction: Option<&NSPersistentHistoryTransaction>, + ) -> Id; + + #[method_id(@__retain_semantics Other fetchHistoryWithFetchRequest:)] + pub unsafe fn fetchHistoryWithFetchRequest( + fetchRequest: &NSFetchRequest, + ) -> Id; + + #[method_id(@__retain_semantics Other deleteHistoryBeforeDate:)] + pub unsafe fn deleteHistoryBeforeDate(date: &NSDate) -> Id; + + #[method_id(@__retain_semantics Other deleteHistoryBeforeToken:)] + pub unsafe fn deleteHistoryBeforeToken( + token: Option<&NSPersistentHistoryToken>, + ) -> Id; + + #[method_id(@__retain_semantics Other deleteHistoryBeforeTransaction:)] + pub unsafe fn deleteHistoryBeforeTransaction( + transaction: Option<&NSPersistentHistoryTransaction>, + ) -> Id; + + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSPersistentHistoryResultType; + + #[method(setResultType:)] + pub unsafe fn setResultType(&self, resultType: NSPersistentHistoryResultType); + + #[method_id(@__retain_semantics Other token)] + pub unsafe fn token(&self) -> Option>; + + #[method_id(@__retain_semantics Other fetchRequest)] + pub unsafe fn fetchRequest(&self) -> Option>; + + #[method(setFetchRequest:)] + pub unsafe fn setFetchRequest(&self, fetchRequest: Option<&NSFetchRequest>); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentHistoryToken.rs b/crates/icrate/src/generated/CoreData/NSPersistentHistoryToken.rs new file mode 100644 index 000000000..fbdabcab1 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentHistoryToken.rs @@ -0,0 +1,18 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentHistoryToken; + + unsafe impl ClassType for NSPersistentHistoryToken { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPersistentHistoryToken {} +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentHistoryTransaction.rs b/crates/icrate/src/generated/CoreData/NSPersistentHistoryTransaction.rs new file mode 100644 index 000000000..546f70976 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentHistoryTransaction.rs @@ -0,0 +1,59 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentHistoryTransaction; + + unsafe impl ClassType for NSPersistentHistoryTransaction { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPersistentHistoryTransaction { + #[method_id(@__retain_semantics Other entityDescriptionWithContext:)] + pub unsafe fn entityDescriptionWithContext( + context: &NSManagedObjectContext, + ) -> Option>; + + #[method_id(@__retain_semantics Other entityDescription)] + pub unsafe fn entityDescription() -> Option>; + + #[method_id(@__retain_semantics Other fetchRequest)] + pub unsafe fn fetchRequest() -> Option>; + + #[method_id(@__retain_semantics Other timestamp)] + pub unsafe fn timestamp(&self) -> Id; + + #[method_id(@__retain_semantics Other changes)] + pub unsafe fn changes(&self) -> Option, Shared>>; + + #[method(transactionNumber)] + pub unsafe fn transactionNumber(&self) -> i64; + + #[method_id(@__retain_semantics Other storeID)] + pub unsafe fn storeID(&self) -> Id; + + #[method_id(@__retain_semantics Other bundleID)] + pub unsafe fn bundleID(&self) -> Id; + + #[method_id(@__retain_semantics Other processID)] + pub unsafe fn processID(&self) -> Id; + + #[method_id(@__retain_semantics Other contextName)] + pub unsafe fn contextName(&self) -> Option>; + + #[method_id(@__retain_semantics Other author)] + pub unsafe fn author(&self) -> Option>; + + #[method_id(@__retain_semantics Other token)] + pub unsafe fn token(&self) -> Id; + + #[method_id(@__retain_semantics Other objectIDNotification)] + pub unsafe fn objectIDNotification(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentStore.rs b/crates/icrate/src/generated/CoreData/NSPersistentStore.rs new file mode 100644 index 000000000..f6202602f --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentStore.rs @@ -0,0 +1,100 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentStore; + + unsafe impl ClassType for NSPersistentStore { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPersistentStore { + #[method_id(@__retain_semantics Other metadataForPersistentStoreWithURL:error:)] + pub unsafe fn metadataForPersistentStoreWithURL_error( + url: &NSURL, + ) -> Result, Shared>, Id>; + + #[method(setMetadata:forPersistentStoreWithURL:error:)] + pub unsafe fn setMetadata_forPersistentStoreWithURL_error( + metadata: Option<&NSDictionary>, + url: &NSURL, + ) -> Result<(), Id>; + + #[method(migrationManagerClass)] + pub unsafe fn migrationManagerClass() -> &'static Class; + + #[method_id(@__retain_semantics Init initWithPersistentStoreCoordinator:configurationName:URL:options:)] + pub unsafe fn initWithPersistentStoreCoordinator_configurationName_URL_options( + this: Option>, + root: Option<&NSPersistentStoreCoordinator>, + name: Option<&NSString>, + url: &NSURL, + options: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(loadMetadata:)] + pub unsafe fn loadMetadata(&self) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other persistentStoreCoordinator)] + pub unsafe fn persistentStoreCoordinator( + &self, + ) -> Option>; + + #[method_id(@__retain_semantics Other configurationName)] + pub unsafe fn configurationName(&self) -> Id; + + #[method_id(@__retain_semantics Other options)] + pub unsafe fn options(&self) -> Option>; + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + + #[method(setURL:)] + pub unsafe fn setURL(&self, URL: Option<&NSURL>); + + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Id; + + #[method(setIdentifier:)] + pub unsafe fn setIdentifier(&self, identifier: Option<&NSString>); + + #[method_id(@__retain_semantics Other type)] + pub unsafe fn type_(&self) -> Id; + + #[method(isReadOnly)] + pub unsafe fn isReadOnly(&self) -> bool; + + #[method(setReadOnly:)] + pub unsafe fn setReadOnly(&self, readOnly: bool); + + #[method_id(@__retain_semantics Other metadata)] + pub unsafe fn metadata(&self) -> Option, Shared>>; + + #[method(setMetadata:)] + pub unsafe fn setMetadata(&self, metadata: Option<&NSDictionary>); + + #[method(didAddToPersistentStoreCoordinator:)] + pub unsafe fn didAddToPersistentStoreCoordinator( + &self, + coordinator: &NSPersistentStoreCoordinator, + ); + + #[method(willRemoveFromPersistentStoreCoordinator:)] + pub unsafe fn willRemoveFromPersistentStoreCoordinator( + &self, + coordinator: Option<&NSPersistentStoreCoordinator>, + ); + + #[method_id(@__retain_semantics Other coreSpotlightExporter)] + pub unsafe fn coreSpotlightExporter(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentStoreCoordinator.rs b/crates/icrate/src/generated/CoreData/NSPersistentStoreCoordinator.rs new file mode 100644 index 000000000..43cc5eb03 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentStoreCoordinator.rs @@ -0,0 +1,327 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_static!(NSSQLiteStoreType: &'static NSString); + +extern_static!(NSXMLStoreType: &'static NSString); + +extern_static!(NSBinaryStoreType: &'static NSString); + +extern_static!(NSInMemoryStoreType: &'static NSString); + +extern_static!(NSStoreTypeKey: &'static NSString); + +extern_static!(NSStoreUUIDKey: &'static NSString); + +extern_static!(NSPersistentStoreCoordinatorStoresWillChangeNotification: &'static NSString); + +extern_static!(NSPersistentStoreCoordinatorStoresDidChangeNotification: &'static NSString); + +extern_static!(NSPersistentStoreCoordinatorWillRemoveStoreNotification: &'static NSString); + +extern_static!(NSAddedPersistentStoresKey: &'static NSString); + +extern_static!(NSRemovedPersistentStoresKey: &'static NSString); + +extern_static!(NSUUIDChangedPersistentStoresKey: &'static NSString); + +extern_static!(NSReadOnlyPersistentStoreOption: &'static NSString); + +extern_static!(NSValidateXMLStoreOption: &'static NSString); + +extern_static!(NSPersistentStoreTimeoutOption: &'static NSString); + +extern_static!(NSSQLitePragmasOption: &'static NSString); + +extern_static!(NSSQLiteAnalyzeOption: &'static NSString); + +extern_static!(NSSQLiteManualVacuumOption: &'static NSString); + +extern_static!(NSIgnorePersistentStoreVersioningOption: &'static NSString); + +extern_static!(NSMigratePersistentStoresAutomaticallyOption: &'static NSString); + +extern_static!(NSInferMappingModelAutomaticallyOption: &'static NSString); + +extern_static!(NSStoreModelVersionHashesKey: &'static NSString); + +extern_static!(NSStoreModelVersionIdentifiersKey: &'static NSString); + +extern_static!(NSPersistentStoreOSCompatibility: &'static NSString); + +extern_static!(NSPersistentStoreConnectionPoolMaxSizeKey: &'static NSString); + +extern_static!(NSCoreDataCoreSpotlightExporter: &'static NSString); + +extern_static!(NSXMLExternalRecordType: &'static NSString); + +extern_static!(NSBinaryExternalRecordType: &'static NSString); + +extern_static!(NSExternalRecordsFileFormatOption: &'static NSString); + +extern_static!(NSExternalRecordsDirectoryOption: &'static NSString); + +extern_static!(NSExternalRecordExtensionOption: &'static NSString); + +extern_static!(NSEntityNameInPathKey: &'static NSString); + +extern_static!(NSStoreUUIDInPathKey: &'static NSString); + +extern_static!(NSStorePathKey: &'static NSString); + +extern_static!(NSModelPathKey: &'static NSString); + +extern_static!(NSObjectURIKey: &'static NSString); + +extern_static!(NSPersistentStoreForceDestroyOption: &'static NSString); + +extern_static!(NSPersistentStoreFileProtectionKey: &'static NSString); + +extern_static!(NSPersistentHistoryTrackingKey: &'static NSString); + +extern_static!(NSBinaryStoreSecureDecodingClasses: &'static NSString); + +extern_static!(NSBinaryStoreInsecureDecodingCompatibilityOption: &'static NSString); + +extern_static!(NSPersistentStoreRemoteChangeNotificationPostOptionKey: &'static NSString); + +extern_static!(NSPersistentStoreRemoteChangeNotification: &'static NSString); + +extern_static!(NSPersistentStoreURLKey: &'static NSString); + +extern_static!(NSPersistentHistoryTokenKey: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentStoreCoordinator; + + unsafe impl ClassType for NSPersistentStoreCoordinator { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPersistentStoreCoordinator { + #[method_id(@__retain_semantics Init initWithManagedObjectModel:)] + pub unsafe fn initWithManagedObjectModel( + this: Option>, + model: &NSManagedObjectModel, + ) -> Id; + + #[method_id(@__retain_semantics Other managedObjectModel)] + pub unsafe fn managedObjectModel(&self) -> Id; + + #[method_id(@__retain_semantics Other persistentStores)] + pub unsafe fn persistentStores(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + + #[method_id(@__retain_semantics Other persistentStoreForURL:)] + pub unsafe fn persistentStoreForURL( + &self, + URL: &NSURL, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLForPersistentStore:)] + pub unsafe fn URLForPersistentStore(&self, store: &NSPersistentStore) -> Id; + + #[method(setURL:forPersistentStore:)] + pub unsafe fn setURL_forPersistentStore( + &self, + url: &NSURL, + store: &NSPersistentStore, + ) -> bool; + + #[method_id(@__retain_semantics Other addPersistentStoreWithType:configuration:URL:options:error:)] + pub unsafe fn addPersistentStoreWithType_configuration_URL_options_error( + &self, + storeType: &NSString, + configuration: Option<&NSString>, + storeURL: Option<&NSURL>, + options: Option<&NSDictionary>, + ) -> Result, Id>; + + #[method(addPersistentStoreWithDescription:completionHandler:)] + pub unsafe fn addPersistentStoreWithDescription_completionHandler( + &self, + storeDescription: &NSPersistentStoreDescription, + block: &Block<(NonNull, *mut NSError), ()>, + ); + + #[method(removePersistentStore:error:)] + pub unsafe fn removePersistentStore_error( + &self, + store: &NSPersistentStore, + ) -> Result<(), Id>; + + #[method(setMetadata:forPersistentStore:)] + pub unsafe fn setMetadata_forPersistentStore( + &self, + metadata: Option<&NSDictionary>, + store: &NSPersistentStore, + ); + + #[method_id(@__retain_semantics Other metadataForPersistentStore:)] + pub unsafe fn metadataForPersistentStore( + &self, + store: &NSPersistentStore, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other managedObjectIDForURIRepresentation:)] + pub unsafe fn managedObjectIDForURIRepresentation( + &self, + url: &NSURL, + ) -> Option>; + + #[method_id(@__retain_semantics Other executeRequest:withContext:error:)] + pub unsafe fn executeRequest_withContext_error( + &self, + request: &NSPersistentStoreRequest, + context: &NSManagedObjectContext, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other registeredStoreTypes)] + pub unsafe fn registeredStoreTypes() -> Id, Shared>; + + #[method(registerStoreClass:forStoreType:)] + pub unsafe fn registerStoreClass_forStoreType( + storeClass: Option<&Class>, + storeType: &NSString, + ); + + #[method_id(@__retain_semantics Other metadataForPersistentStoreOfType:URL:options:error:)] + pub unsafe fn metadataForPersistentStoreOfType_URL_options_error( + storeType: &NSString, + url: &NSURL, + options: Option<&NSDictionary>, + ) -> Result, Shared>, Id>; + + #[method(setMetadata:forPersistentStoreOfType:URL:options:error:)] + pub unsafe fn setMetadata_forPersistentStoreOfType_URL_options_error( + metadata: Option<&NSDictionary>, + storeType: &NSString, + url: &NSURL, + options: Option<&NSDictionary>, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other elementsDerivedFromExternalRecordURL:)] + pub unsafe fn elementsDerivedFromExternalRecordURL( + fileURL: &NSURL, + ) -> Id; + + #[method_id(@__retain_semantics Other importStoreWithIdentifier:fromExternalRecordsDirectory:toURL:options:withType:error:)] + pub unsafe fn importStoreWithIdentifier_fromExternalRecordsDirectory_toURL_options_withType_error( + &self, + storeIdentifier: Option<&NSString>, + externalRecordsURL: &NSURL, + destinationURL: &NSURL, + options: Option<&NSDictionary>, + storeType: &NSString, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other migratePersistentStore:toURL:options:withType:error:)] + pub unsafe fn migratePersistentStore_toURL_options_withType_error( + &self, + store: &NSPersistentStore, + URL: &NSURL, + options: Option<&NSDictionary>, + storeType: &NSString, + ) -> Result, Id>; + + #[method(destroyPersistentStoreAtURL:withType:options:error:)] + pub unsafe fn destroyPersistentStoreAtURL_withType_options_error( + &self, + url: &NSURL, + storeType: &NSString, + options: Option<&NSDictionary>, + ) -> Result<(), Id>; + + #[method(replacePersistentStoreAtURL:destinationOptions:withPersistentStoreFromURL:sourceOptions:storeType:error:)] + pub unsafe fn replacePersistentStoreAtURL_destinationOptions_withPersistentStoreFromURL_sourceOptions_storeType_error( + &self, + destinationURL: &NSURL, + destinationOptions: Option<&NSDictionary>, + sourceURL: &NSURL, + sourceOptions: Option<&NSDictionary>, + storeType: &NSString, + ) -> Result<(), Id>; + + #[method(performBlock:)] + pub unsafe fn performBlock(&self, block: &Block<(), ()>); + + #[method(performBlockAndWait:)] + pub unsafe fn performBlockAndWait(&self, block: &Block<(), ()>); + + #[method_id(@__retain_semantics Other currentPersistentHistoryTokenFromStores:)] + pub unsafe fn currentPersistentHistoryTokenFromStores( + &self, + stores: Option<&NSArray>, + ) -> Option>; + + #[method_id(@__retain_semantics Other metadataForPersistentStoreWithURL:error:)] + pub unsafe fn metadataForPersistentStoreWithURL_error( + url: &NSURL, + ) -> Result, Id>; + + #[method(lock)] + pub unsafe fn lock(&self); + + #[method(unlock)] + pub unsafe fn unlock(&self); + + #[method(tryLock)] + pub unsafe fn tryLock(&self) -> bool; + + #[method_id(@__retain_semantics Other metadataForPersistentStoreOfType:URL:error:)] + pub unsafe fn metadataForPersistentStoreOfType_URL_error( + storeType: Option<&NSString>, + url: &NSURL, + ) -> Result, Shared>, Id>; + + #[method(setMetadata:forPersistentStoreOfType:URL:error:)] + pub unsafe fn setMetadata_forPersistentStoreOfType_URL_error( + metadata: Option<&NSDictionary>, + storeType: Option<&NSString>, + url: &NSURL, + ) -> Result<(), Id>; + + #[method(removeUbiquitousContentAndPersistentStoreAtURL:options:error:)] + pub unsafe fn removeUbiquitousContentAndPersistentStoreAtURL_options_error( + storeURL: &NSURL, + options: Option<&NSDictionary>, + ) -> Result<(), Id>; + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSPersistentStoreUbiquitousTransitionType { + NSPersistentStoreUbiquitousTransitionTypeAccountAdded = 1, + NSPersistentStoreUbiquitousTransitionTypeAccountRemoved = 2, + NSPersistentStoreUbiquitousTransitionTypeContentRemoved = 3, + NSPersistentStoreUbiquitousTransitionTypeInitialImportCompleted = 4, + } +); + +extern_static!(NSPersistentStoreUbiquitousContentNameKey: &'static NSString); + +extern_static!(NSPersistentStoreUbiquitousContentURLKey: &'static NSString); + +extern_static!(NSPersistentStoreDidImportUbiquitousContentChangesNotification: &'static NSString); + +extern_static!(NSPersistentStoreUbiquitousTransitionTypeKey: &'static NSString); + +extern_static!(NSPersistentStoreUbiquitousPeerTokenOption: &'static NSString); + +extern_static!(NSPersistentStoreRemoveUbiquitousMetadataOption: &'static NSString); + +extern_static!(NSPersistentStoreUbiquitousContainerIdentifierKey: &'static NSString); + +extern_static!(NSPersistentStoreRebuildFromUbiquitousContentOption: &'static NSString); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentStoreDescription.rs b/crates/icrate/src/generated/CoreData/NSPersistentStoreDescription.rs new file mode 100644 index 000000000..c271e0eea --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentStoreDescription.rs @@ -0,0 +1,106 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentStoreDescription; + + unsafe impl ClassType for NSPersistentStoreDescription { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPersistentStoreDescription { + #[method_id(@__retain_semantics Other persistentStoreDescriptionWithURL:)] + pub unsafe fn persistentStoreDescriptionWithURL(URL: &NSURL) -> Id; + + #[method_id(@__retain_semantics Other type)] + pub unsafe fn type_(&self) -> Id; + + #[method(setType:)] + pub unsafe fn setType(&self, type_: &NSString); + + #[method_id(@__retain_semantics Other configuration)] + pub unsafe fn configuration(&self) -> Option>; + + #[method(setConfiguration:)] + pub unsafe fn setConfiguration(&self, configuration: Option<&NSString>); + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + + #[method(setURL:)] + pub unsafe fn setURL(&self, URL: Option<&NSURL>); + + #[method_id(@__retain_semantics Other options)] + pub unsafe fn options(&self) -> Id, Shared>; + + #[method(setOption:forKey:)] + pub unsafe fn setOption_forKey(&self, option: Option<&NSObject>, key: &NSString); + + #[method(isReadOnly)] + pub unsafe fn isReadOnly(&self) -> bool; + + #[method(setReadOnly:)] + pub unsafe fn setReadOnly(&self, readOnly: bool); + + #[method(timeout)] + pub unsafe fn timeout(&self) -> NSTimeInterval; + + #[method(setTimeout:)] + pub unsafe fn setTimeout(&self, timeout: NSTimeInterval); + + #[method_id(@__retain_semantics Other sqlitePragmas)] + pub unsafe fn sqlitePragmas(&self) -> Id, Shared>; + + #[method(setValue:forPragmaNamed:)] + pub unsafe fn setValue_forPragmaNamed(&self, value: Option<&NSObject>, name: &NSString); + + #[method(shouldAddStoreAsynchronously)] + pub unsafe fn shouldAddStoreAsynchronously(&self) -> bool; + + #[method(setShouldAddStoreAsynchronously:)] + pub unsafe fn setShouldAddStoreAsynchronously(&self, shouldAddStoreAsynchronously: bool); + + #[method(shouldMigrateStoreAutomatically)] + pub unsafe fn shouldMigrateStoreAutomatically(&self) -> bool; + + #[method(setShouldMigrateStoreAutomatically:)] + pub unsafe fn setShouldMigrateStoreAutomatically( + &self, + shouldMigrateStoreAutomatically: bool, + ); + + #[method(shouldInferMappingModelAutomatically)] + pub unsafe fn shouldInferMappingModelAutomatically(&self) -> bool; + + #[method(setShouldInferMappingModelAutomatically:)] + pub unsafe fn setShouldInferMappingModelAutomatically( + &self, + shouldInferMappingModelAutomatically: bool, + ); + + #[method_id(@__retain_semantics Init initWithURL:)] + pub unsafe fn initWithURL(this: Option>, url: &NSURL) -> Id; + } +); + +extern_methods!( + /// NSPersistentCloudKitContainerAdditions + unsafe impl NSPersistentStoreDescription { + #[method_id(@__retain_semantics Other cloudKitContainerOptions)] + pub unsafe fn cloudKitContainerOptions( + &self, + ) -> Option>; + + #[method(setCloudKitContainerOptions:)] + pub unsafe fn setCloudKitContainerOptions( + &self, + cloudKitContainerOptions: Option<&NSPersistentCloudKitContainerOptions>, + ); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentStoreRequest.rs b/crates/icrate/src/generated/CoreData/NSPersistentStoreRequest.rs new file mode 100644 index 000000000..84711a576 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentStoreRequest.rs @@ -0,0 +1,38 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSPersistentStoreRequestType { + NSFetchRequestType = 1, + NSSaveRequestType = 2, + NSBatchInsertRequestType = 5, + NSBatchUpdateRequestType = 6, + NSBatchDeleteRequestType = 7, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentStoreRequest; + + unsafe impl ClassType for NSPersistentStoreRequest { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPersistentStoreRequest { + #[method_id(@__retain_semantics Other affectedStores)] + pub unsafe fn affectedStores(&self) -> Option, Shared>>; + + #[method(setAffectedStores:)] + pub unsafe fn setAffectedStores(&self, affectedStores: Option<&NSArray>); + + #[method(requestType)] + pub unsafe fn requestType(&self) -> NSPersistentStoreRequestType; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPersistentStoreResult.rs b/crates/icrate/src/generated/CoreData/NSPersistentStoreResult.rs new file mode 100644 index 000000000..980786b68 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPersistentStoreResult.rs @@ -0,0 +1,212 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSBatchInsertRequestResultType { + NSBatchInsertRequestResultTypeStatusOnly = 0x0, + NSBatchInsertRequestResultTypeObjectIDs = 0x1, + NSBatchInsertRequestResultTypeCount = 0x2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSBatchUpdateRequestResultType { + NSStatusOnlyResultType = 0x0, + NSUpdatedObjectIDsResultType = 0x1, + NSUpdatedObjectsCountResultType = 0x2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSBatchDeleteRequestResultType { + NSBatchDeleteResultTypeStatusOnly = 0x0, + NSBatchDeleteResultTypeObjectIDs = 0x1, + NSBatchDeleteResultTypeCount = 0x2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPersistentHistoryResultType { + NSPersistentHistoryResultTypeStatusOnly = 0x0, + NSPersistentHistoryResultTypeObjectIDs = 0x1, + NSPersistentHistoryResultTypeCount = 0x2, + NSPersistentHistoryResultTypeTransactionsOnly = 0x3, + NSPersistentHistoryResultTypeChangesOnly = 0x4, + NSPersistentHistoryResultTypeTransactionsAndChanges = 0x5, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentStoreResult; + + unsafe impl ClassType for NSPersistentStoreResult { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPersistentStoreResult {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentStoreAsynchronousResult; + + unsafe impl ClassType for NSPersistentStoreAsynchronousResult { + type Super = NSPersistentStoreResult; + } +); + +extern_methods!( + unsafe impl NSPersistentStoreAsynchronousResult { + #[method_id(@__retain_semantics Other managedObjectContext)] + pub unsafe fn managedObjectContext(&self) -> Id; + + #[method_id(@__retain_semantics Other operationError)] + pub unsafe fn operationError(&self) -> Option>; + + #[method_id(@__retain_semantics Other progress)] + pub unsafe fn progress(&self) -> Option>; + + #[method(cancel)] + pub unsafe fn cancel(&self); + } +); + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSAsynchronousFetchResult { + _inner0: PhantomData<*mut ResultType>, + } + + unsafe impl ClassType for NSAsynchronousFetchResult { + type Super = NSPersistentStoreAsynchronousResult; + } +); + +extern_methods!( + unsafe impl NSAsynchronousFetchResult { + #[method_id(@__retain_semantics Other fetchRequest)] + pub unsafe fn fetchRequest(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other finalResult)] + pub unsafe fn finalResult(&self) -> Option, Shared>>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSBatchInsertResult; + + unsafe impl ClassType for NSBatchInsertResult { + type Super = NSPersistentStoreResult; + } +); + +extern_methods!( + unsafe impl NSBatchInsertResult { + #[method_id(@__retain_semantics Other result)] + pub unsafe fn result(&self) -> Option>; + + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSBatchInsertRequestResultType; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSBatchUpdateResult; + + unsafe impl ClassType for NSBatchUpdateResult { + type Super = NSPersistentStoreResult; + } +); + +extern_methods!( + unsafe impl NSBatchUpdateResult { + #[method_id(@__retain_semantics Other result)] + pub unsafe fn result(&self) -> Option>; + + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSBatchUpdateRequestResultType; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSBatchDeleteResult; + + unsafe impl ClassType for NSBatchDeleteResult { + type Super = NSPersistentStoreResult; + } +); + +extern_methods!( + unsafe impl NSBatchDeleteResult { + #[method_id(@__retain_semantics Other result)] + pub unsafe fn result(&self) -> Option>; + + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSBatchDeleteRequestResultType; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentHistoryResult; + + unsafe impl ClassType for NSPersistentHistoryResult { + type Super = NSPersistentStoreResult; + } +); + +extern_methods!( + unsafe impl NSPersistentHistoryResult { + #[method_id(@__retain_semantics Other result)] + pub unsafe fn result(&self) -> Option>; + + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSPersistentHistoryResultType; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPersistentCloudKitContainerEventResultType { + NSPersistentCloudKitContainerEventResultTypeEvents = 0, + NSPersistentCloudKitContainerEventResultTypeCountEvents = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPersistentCloudKitContainerEventResult; + + unsafe impl ClassType for NSPersistentCloudKitContainerEventResult { + type Super = NSPersistentStoreResult; + } +); + +extern_methods!( + unsafe impl NSPersistentCloudKitContainerEventResult { + #[method_id(@__retain_semantics Other result)] + pub unsafe fn result(&self) -> Option>; + + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSPersistentCloudKitContainerEventResultType; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPropertyDescription.rs b/crates/icrate/src/generated/CoreData/NSPropertyDescription.rs new file mode 100644 index 000000000..d43dcb671 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPropertyDescription.rs @@ -0,0 +1,91 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPropertyDescription; + + unsafe impl ClassType for NSPropertyDescription { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPropertyDescription { + #[method_id(@__retain_semantics Other entity)] + pub unsafe fn entity(&self) -> Id; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method(setName:)] + pub unsafe fn setName(&self, name: &NSString); + + #[method(isOptional)] + pub unsafe fn isOptional(&self) -> bool; + + #[method(setOptional:)] + pub unsafe fn setOptional(&self, optional: bool); + + #[method(isTransient)] + pub unsafe fn isTransient(&self) -> bool; + + #[method(setTransient:)] + pub unsafe fn setTransient(&self, transient: bool); + + #[method_id(@__retain_semantics Other validationPredicates)] + pub unsafe fn validationPredicates(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other validationWarnings)] + pub unsafe fn validationWarnings(&self) -> Id; + + #[method(setValidationPredicates:withValidationWarnings:)] + pub unsafe fn setValidationPredicates_withValidationWarnings( + &self, + validationPredicates: Option<&NSArray>, + validationWarnings: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + + #[method(setUserInfo:)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>); + + #[method(isIndexed)] + pub unsafe fn isIndexed(&self) -> bool; + + #[method(setIndexed:)] + pub unsafe fn setIndexed(&self, indexed: bool); + + #[method_id(@__retain_semantics Other versionHash)] + pub unsafe fn versionHash(&self) -> Id; + + #[method_id(@__retain_semantics Other versionHashModifier)] + pub unsafe fn versionHashModifier(&self) -> Option>; + + #[method(setVersionHashModifier:)] + pub unsafe fn setVersionHashModifier(&self, versionHashModifier: Option<&NSString>); + + #[method(isIndexedBySpotlight)] + pub unsafe fn isIndexedBySpotlight(&self) -> bool; + + #[method(setIndexedBySpotlight:)] + pub unsafe fn setIndexedBySpotlight(&self, indexedBySpotlight: bool); + + #[method(isStoredInExternalRecord)] + pub unsafe fn isStoredInExternalRecord(&self) -> bool; + + #[method(setStoredInExternalRecord:)] + pub unsafe fn setStoredInExternalRecord(&self, storedInExternalRecord: bool); + + #[method_id(@__retain_semantics Other renamingIdentifier)] + pub unsafe fn renamingIdentifier(&self) -> Option>; + + #[method(setRenamingIdentifier:)] + pub unsafe fn setRenamingIdentifier(&self, renamingIdentifier: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSPropertyMapping.rs b/crates/icrate/src/generated/CoreData/NSPropertyMapping.rs new file mode 100644 index 000000000..8633f9aae --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSPropertyMapping.rs @@ -0,0 +1,36 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPropertyMapping; + + unsafe impl ClassType for NSPropertyMapping { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPropertyMapping { + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + + #[method_id(@__retain_semantics Other valueExpression)] + pub unsafe fn valueExpression(&self) -> Option>; + + #[method(setValueExpression:)] + pub unsafe fn setValueExpression(&self, valueExpression: Option<&NSExpression>); + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + + #[method(setUserInfo:)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSQueryGenerationToken.rs b/crates/icrate/src/generated/CoreData/NSQueryGenerationToken.rs new file mode 100644 index 000000000..c9449570a --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSQueryGenerationToken.rs @@ -0,0 +1,21 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSQueryGenerationToken; + + unsafe impl ClassType for NSQueryGenerationToken { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSQueryGenerationToken { + #[method_id(@__retain_semantics Other currentQueryGenerationToken)] + pub unsafe fn currentQueryGenerationToken() -> Id; + } +); diff --git a/crates/icrate/src/generated/CoreData/NSRelationshipDescription.rs b/crates/icrate/src/generated/CoreData/NSRelationshipDescription.rs new file mode 100644 index 000000000..b2719e072 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSRelationshipDescription.rs @@ -0,0 +1,73 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSDeleteRule { + NSNoActionDeleteRule = 0, + NSNullifyDeleteRule = 1, + NSCascadeDeleteRule = 2, + NSDenyDeleteRule = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSRelationshipDescription; + + unsafe impl ClassType for NSRelationshipDescription { + type Super = NSPropertyDescription; + } +); + +extern_methods!( + unsafe impl NSRelationshipDescription { + #[method_id(@__retain_semantics Other destinationEntity)] + pub unsafe fn destinationEntity(&self) -> Option>; + + #[method(setDestinationEntity:)] + pub unsafe fn setDestinationEntity(&self, destinationEntity: Option<&NSEntityDescription>); + + #[method_id(@__retain_semantics Other inverseRelationship)] + pub unsafe fn inverseRelationship(&self) -> Option>; + + #[method(setInverseRelationship:)] + pub unsafe fn setInverseRelationship( + &self, + inverseRelationship: Option<&NSRelationshipDescription>, + ); + + #[method(maxCount)] + pub unsafe fn maxCount(&self) -> NSUInteger; + + #[method(setMaxCount:)] + pub unsafe fn setMaxCount(&self, maxCount: NSUInteger); + + #[method(minCount)] + pub unsafe fn minCount(&self) -> NSUInteger; + + #[method(setMinCount:)] + pub unsafe fn setMinCount(&self, minCount: NSUInteger); + + #[method(deleteRule)] + pub unsafe fn deleteRule(&self) -> NSDeleteRule; + + #[method(setDeleteRule:)] + pub unsafe fn setDeleteRule(&self, deleteRule: NSDeleteRule); + + #[method(isToMany)] + pub unsafe fn isToMany(&self) -> bool; + + #[method_id(@__retain_semantics Other versionHash)] + pub unsafe fn versionHash(&self) -> Id; + + #[method(isOrdered)] + pub unsafe fn isOrdered(&self) -> bool; + + #[method(setOrdered:)] + pub unsafe fn setOrdered(&self, ordered: bool); + } +); diff --git a/crates/icrate/src/generated/CoreData/NSSaveChangesRequest.rs b/crates/icrate/src/generated/CoreData/NSSaveChangesRequest.rs new file mode 100644 index 000000000..ec77bddb9 --- /dev/null +++ b/crates/icrate/src/generated/CoreData/NSSaveChangesRequest.rs @@ -0,0 +1,39 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::CoreData::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSSaveChangesRequest; + + unsafe impl ClassType for NSSaveChangesRequest { + type Super = NSPersistentStoreRequest; + } +); + +extern_methods!( + unsafe impl NSSaveChangesRequest { + #[method_id(@__retain_semantics Init initWithInsertedObjects:updatedObjects:deletedObjects:lockedObjects:)] + pub unsafe fn initWithInsertedObjects_updatedObjects_deletedObjects_lockedObjects( + this: Option>, + insertedObjects: Option<&NSSet>, + updatedObjects: Option<&NSSet>, + deletedObjects: Option<&NSSet>, + lockedObjects: Option<&NSSet>, + ) -> Id; + + #[method_id(@__retain_semantics Other insertedObjects)] + pub unsafe fn insertedObjects(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other updatedObjects)] + pub unsafe fn updatedObjects(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other deletedObjects)] + pub unsafe fn deletedObjects(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other lockedObjects)] + pub unsafe fn lockedObjects(&self) -> Option, Shared>>; + } +); diff --git a/crates/icrate/src/generated/CoreData/mod.rs b/crates/icrate/src/generated/CoreData/mod.rs new file mode 100644 index 000000000..33638b61b --- /dev/null +++ b/crates/icrate/src/generated/CoreData/mod.rs @@ -0,0 +1,283 @@ +#[path = "CoreDataDefines.rs"] +mod __CoreDataDefines; +#[path = "CoreDataErrors.rs"] +mod __CoreDataErrors; +#[path = "NSAtomicStore.rs"] +mod __NSAtomicStore; +#[path = "NSAtomicStoreCacheNode.rs"] +mod __NSAtomicStoreCacheNode; +#[path = "NSAttributeDescription.rs"] +mod __NSAttributeDescription; +#[path = "NSBatchDeleteRequest.rs"] +mod __NSBatchDeleteRequest; +#[path = "NSBatchInsertRequest.rs"] +mod __NSBatchInsertRequest; +#[path = "NSBatchUpdateRequest.rs"] +mod __NSBatchUpdateRequest; +#[path = "NSCoreDataCoreSpotlightDelegate.rs"] +mod __NSCoreDataCoreSpotlightDelegate; +#[path = "NSDerivedAttributeDescription.rs"] +mod __NSDerivedAttributeDescription; +#[path = "NSEntityDescription.rs"] +mod __NSEntityDescription; +#[path = "NSEntityMapping.rs"] +mod __NSEntityMapping; +#[path = "NSEntityMigrationPolicy.rs"] +mod __NSEntityMigrationPolicy; +#[path = "NSExpressionDescription.rs"] +mod __NSExpressionDescription; +#[path = "NSFetchIndexDescription.rs"] +mod __NSFetchIndexDescription; +#[path = "NSFetchIndexElementDescription.rs"] +mod __NSFetchIndexElementDescription; +#[path = "NSFetchRequest.rs"] +mod __NSFetchRequest; +#[path = "NSFetchRequestExpression.rs"] +mod __NSFetchRequestExpression; +#[path = "NSFetchedPropertyDescription.rs"] +mod __NSFetchedPropertyDescription; +#[path = "NSFetchedResultsController.rs"] +mod __NSFetchedResultsController; +#[path = "NSIncrementalStore.rs"] +mod __NSIncrementalStore; +#[path = "NSIncrementalStoreNode.rs"] +mod __NSIncrementalStoreNode; +#[path = "NSManagedObject.rs"] +mod __NSManagedObject; +#[path = "NSManagedObjectContext.rs"] +mod __NSManagedObjectContext; +#[path = "NSManagedObjectID.rs"] +mod __NSManagedObjectID; +#[path = "NSManagedObjectModel.rs"] +mod __NSManagedObjectModel; +#[path = "NSMappingModel.rs"] +mod __NSMappingModel; +#[path = "NSMergePolicy.rs"] +mod __NSMergePolicy; +#[path = "NSMigrationManager.rs"] +mod __NSMigrationManager; +#[path = "NSPersistentCloudKitContainer.rs"] +mod __NSPersistentCloudKitContainer; +#[path = "NSPersistentCloudKitContainerEvent.rs"] +mod __NSPersistentCloudKitContainerEvent; +#[path = "NSPersistentCloudKitContainerEventRequest.rs"] +mod __NSPersistentCloudKitContainerEventRequest; +#[path = "NSPersistentCloudKitContainerOptions.rs"] +mod __NSPersistentCloudKitContainerOptions; +#[path = "NSPersistentContainer.rs"] +mod __NSPersistentContainer; +#[path = "NSPersistentHistoryChange.rs"] +mod __NSPersistentHistoryChange; +#[path = "NSPersistentHistoryChangeRequest.rs"] +mod __NSPersistentHistoryChangeRequest; +#[path = "NSPersistentHistoryToken.rs"] +mod __NSPersistentHistoryToken; +#[path = "NSPersistentHistoryTransaction.rs"] +mod __NSPersistentHistoryTransaction; +#[path = "NSPersistentStore.rs"] +mod __NSPersistentStore; +#[path = "NSPersistentStoreCoordinator.rs"] +mod __NSPersistentStoreCoordinator; +#[path = "NSPersistentStoreDescription.rs"] +mod __NSPersistentStoreDescription; +#[path = "NSPersistentStoreRequest.rs"] +mod __NSPersistentStoreRequest; +#[path = "NSPersistentStoreResult.rs"] +mod __NSPersistentStoreResult; +#[path = "NSPropertyDescription.rs"] +mod __NSPropertyDescription; +#[path = "NSPropertyMapping.rs"] +mod __NSPropertyMapping; +#[path = "NSQueryGenerationToken.rs"] +mod __NSQueryGenerationToken; +#[path = "NSRelationshipDescription.rs"] +mod __NSRelationshipDescription; +#[path = "NSSaveChangesRequest.rs"] +mod __NSSaveChangesRequest; + +pub use self::__CoreDataDefines::NSCoreDataVersionNumber; +pub use self::__CoreDataErrors::{ + NSAffectedObjectsErrorKey, NSAffectedStoresErrorKey, NSCoreDataError, NSDetailedErrorsKey, + NSEntityMigrationPolicyError, NSExternalRecordImportError, NSInferredMappingModelError, + NSManagedObjectConstraintMergeError, NSManagedObjectConstraintValidationError, + NSManagedObjectContextLockingError, NSManagedObjectExternalRelationshipError, + NSManagedObjectMergeError, NSManagedObjectReferentialIntegrityError, + NSManagedObjectValidationError, NSMigrationCancelledError, NSMigrationConstraintViolationError, + NSMigrationError, NSMigrationManagerDestinationStoreError, NSMigrationManagerSourceStoreError, + NSMigrationMissingMappingModelError, NSMigrationMissingSourceModelError, + NSPersistentHistoryTokenExpiredError, NSPersistentStoreCoordinatorLockingError, + NSPersistentStoreIncompatibleSchemaError, NSPersistentStoreIncompatibleVersionHashError, + NSPersistentStoreIncompleteSaveError, NSPersistentStoreInvalidTypeError, + NSPersistentStoreOpenError, NSPersistentStoreOperationError, + NSPersistentStoreSaveConflictsError, NSPersistentStoreSaveConflictsErrorKey, + NSPersistentStoreSaveError, NSPersistentStoreTimeoutError, NSPersistentStoreTypeMismatchError, + NSPersistentStoreUnsupportedRequestTypeError, NSSQLiteError, NSSQLiteErrorDomain, + NSValidationDateTooLateError, NSValidationDateTooSoonError, NSValidationInvalidDateError, + NSValidationInvalidURIError, NSValidationKeyErrorKey, + NSValidationMissingMandatoryPropertyError, NSValidationMultipleErrorsError, + NSValidationNumberTooLargeError, NSValidationNumberTooSmallError, NSValidationObjectErrorKey, + NSValidationPredicateErrorKey, NSValidationRelationshipDeniedDeleteError, + NSValidationRelationshipExceedsMaximumCountError, + NSValidationRelationshipLacksMinimumCountError, NSValidationStringPatternMatchingError, + NSValidationStringTooLongError, NSValidationStringTooShortError, NSValidationValueErrorKey, +}; +pub use self::__NSAtomicStore::NSAtomicStore; +pub use self::__NSAtomicStoreCacheNode::NSAtomicStoreCacheNode; +pub use self::__NSAttributeDescription::{ + NSAttributeDescription, NSAttributeType, NSBinaryDataAttributeType, NSBooleanAttributeType, + NSDateAttributeType, NSDecimalAttributeType, NSDoubleAttributeType, NSFloatAttributeType, + NSInteger16AttributeType, NSInteger32AttributeType, NSInteger64AttributeType, + NSObjectIDAttributeType, NSStringAttributeType, NSTransformableAttributeType, + NSURIAttributeType, NSUUIDAttributeType, NSUndefinedAttributeType, +}; +pub use self::__NSBatchDeleteRequest::NSBatchDeleteRequest; +pub use self::__NSBatchInsertRequest::NSBatchInsertRequest; +pub use self::__NSBatchUpdateRequest::NSBatchUpdateRequest; +pub use self::__NSCoreDataCoreSpotlightDelegate::{ + NSCoreDataCoreSpotlightDelegate, NSCoreDataCoreSpotlightDelegateIndexDidUpdateNotification, +}; +pub use self::__NSDerivedAttributeDescription::NSDerivedAttributeDescription; +pub use self::__NSEntityDescription::NSEntityDescription; +pub use self::__NSEntityMapping::{ + NSAddEntityMappingType, NSCopyEntityMappingType, NSCustomEntityMappingType, NSEntityMapping, + NSEntityMappingType, NSRemoveEntityMappingType, NSTransformEntityMappingType, + NSUndefinedEntityMappingType, +}; +pub use self::__NSEntityMigrationPolicy::{ + NSEntityMigrationPolicy, NSMigrationDestinationObjectKey, NSMigrationEntityMappingKey, + NSMigrationEntityPolicyKey, NSMigrationManagerKey, NSMigrationPropertyMappingKey, + NSMigrationSourceObjectKey, +}; +pub use self::__NSExpressionDescription::NSExpressionDescription; +pub use self::__NSFetchIndexDescription::NSFetchIndexDescription; +pub use self::__NSFetchIndexElementDescription::{ + NSFetchIndexElementDescription, NSFetchIndexElementType, NSFetchIndexElementTypeBinary, + NSFetchIndexElementTypeRTree, +}; +pub use self::__NSFetchRequest::{ + NSAsynchronousFetchRequest, NSCountResultType, NSDictionaryResultType, NSFetchRequest, + NSFetchRequestResult, NSFetchRequestResultType, NSManagedObjectIDResultType, + NSManagedObjectResultType, NSPersistentStoreAsynchronousFetchResultCompletionBlock, +}; +pub use self::__NSFetchRequestExpression::{ + NSFetchRequestExpression, NSFetchRequestExpressionType, +}; +pub use self::__NSFetchedPropertyDescription::NSFetchedPropertyDescription; +pub use self::__NSFetchedResultsController::{ + NSFetchedResultsChangeDelete, NSFetchedResultsChangeInsert, NSFetchedResultsChangeMove, + NSFetchedResultsChangeType, NSFetchedResultsChangeUpdate, NSFetchedResultsController, + NSFetchedResultsControllerDelegate, NSFetchedResultsSectionInfo, +}; +pub use self::__NSIncrementalStore::NSIncrementalStore; +pub use self::__NSIncrementalStoreNode::NSIncrementalStoreNode; +pub use self::__NSManagedObject::{ + NSManagedObject, NSSnapshotEventMergePolicy, NSSnapshotEventRefresh, NSSnapshotEventRollback, + NSSnapshotEventType, NSSnapshotEventUndoDeletion, NSSnapshotEventUndoInsertion, + NSSnapshotEventUndoUpdate, +}; +pub use self::__NSManagedObjectContext::{ + NSConfinementConcurrencyType, NSDeletedObjectIDsKey, NSDeletedObjectsKey, + NSInsertedObjectIDsKey, NSInsertedObjectsKey, NSInvalidatedAllObjectsKey, + NSInvalidatedObjectIDsKey, NSInvalidatedObjectsKey, NSMainQueueConcurrencyType, + NSManagedObjectContext, NSManagedObjectContextConcurrencyType, + NSManagedObjectContextDidMergeChangesObjectIDsNotification, + NSManagedObjectContextDidSaveNotification, NSManagedObjectContextDidSaveObjectIDsNotification, + NSManagedObjectContextObjectsDidChangeNotification, NSManagedObjectContextQueryGenerationKey, + NSManagedObjectContextWillSaveNotification, NSPrivateQueueConcurrencyType, + NSRefreshedObjectIDsKey, NSRefreshedObjectsKey, NSUpdatedObjectIDsKey, NSUpdatedObjectsKey, +}; +pub use self::__NSManagedObjectID::NSManagedObjectID; +pub use self::__NSManagedObjectModel::NSManagedObjectModel; +pub use self::__NSMappingModel::NSMappingModel; +pub use self::__NSMergePolicy::{ + NSConstraintConflict, NSErrorMergePolicyType, NSMergeByPropertyObjectTrumpMergePolicyType, + NSMergeByPropertyStoreTrumpMergePolicyType, NSMergeConflict, NSMergePolicy, NSMergePolicyType, + NSOverwriteMergePolicyType, NSRollbackMergePolicyType, +}; +pub use self::__NSMigrationManager::NSMigrationManager; +pub use self::__NSPersistentCloudKitContainer::{ + NSPersistentCloudKitContainer, NSPersistentCloudKitContainerSchemaInitializationOptions, + NSPersistentCloudKitContainerSchemaInitializationOptionsDryRun, + NSPersistentCloudKitContainerSchemaInitializationOptionsNone, + NSPersistentCloudKitContainerSchemaInitializationOptionsPrintSchema, +}; +pub use self::__NSPersistentCloudKitContainerEvent::{ + NSPersistentCloudKitContainerEvent, NSPersistentCloudKitContainerEventChangedNotification, + NSPersistentCloudKitContainerEventType, NSPersistentCloudKitContainerEventTypeExport, + NSPersistentCloudKitContainerEventTypeImport, NSPersistentCloudKitContainerEventTypeSetup, + NSPersistentCloudKitContainerEventUserInfoKey, +}; +pub use self::__NSPersistentCloudKitContainerEventRequest::NSPersistentCloudKitContainerEventRequest; +pub use self::__NSPersistentCloudKitContainerOptions::NSPersistentCloudKitContainerOptions; +pub use self::__NSPersistentContainer::NSPersistentContainer; +pub use self::__NSPersistentHistoryChange::{ + NSPersistentHistoryChange, NSPersistentHistoryChangeType, NSPersistentHistoryChangeTypeDelete, + NSPersistentHistoryChangeTypeInsert, NSPersistentHistoryChangeTypeUpdate, +}; +pub use self::__NSPersistentHistoryChangeRequest::NSPersistentHistoryChangeRequest; +pub use self::__NSPersistentHistoryToken::NSPersistentHistoryToken; +pub use self::__NSPersistentHistoryTransaction::NSPersistentHistoryTransaction; +pub use self::__NSPersistentStore::NSPersistentStore; +pub use self::__NSPersistentStoreCoordinator::{ + NSAddedPersistentStoresKey, NSBinaryExternalRecordType, + NSBinaryStoreInsecureDecodingCompatibilityOption, NSBinaryStoreSecureDecodingClasses, + NSBinaryStoreType, NSCoreDataCoreSpotlightExporter, NSEntityNameInPathKey, + NSExternalRecordExtensionOption, NSExternalRecordsDirectoryOption, + NSExternalRecordsFileFormatOption, NSIgnorePersistentStoreVersioningOption, + NSInMemoryStoreType, NSInferMappingModelAutomaticallyOption, + NSMigratePersistentStoresAutomaticallyOption, NSModelPathKey, NSObjectURIKey, + NSPersistentHistoryTokenKey, NSPersistentHistoryTrackingKey, + NSPersistentStoreConnectionPoolMaxSizeKey, NSPersistentStoreCoordinator, + NSPersistentStoreCoordinatorStoresDidChangeNotification, + NSPersistentStoreCoordinatorStoresWillChangeNotification, + NSPersistentStoreCoordinatorWillRemoveStoreNotification, + NSPersistentStoreDidImportUbiquitousContentChangesNotification, + NSPersistentStoreFileProtectionKey, NSPersistentStoreForceDestroyOption, + NSPersistentStoreOSCompatibility, NSPersistentStoreRebuildFromUbiquitousContentOption, + NSPersistentStoreRemoteChangeNotification, + NSPersistentStoreRemoteChangeNotificationPostOptionKey, + NSPersistentStoreRemoveUbiquitousMetadataOption, NSPersistentStoreTimeoutOption, + NSPersistentStoreURLKey, NSPersistentStoreUbiquitousContainerIdentifierKey, + NSPersistentStoreUbiquitousContentNameKey, NSPersistentStoreUbiquitousContentURLKey, + NSPersistentStoreUbiquitousPeerTokenOption, NSPersistentStoreUbiquitousTransitionType, + NSPersistentStoreUbiquitousTransitionTypeAccountAdded, + NSPersistentStoreUbiquitousTransitionTypeAccountRemoved, + NSPersistentStoreUbiquitousTransitionTypeContentRemoved, + NSPersistentStoreUbiquitousTransitionTypeInitialImportCompleted, + NSPersistentStoreUbiquitousTransitionTypeKey, NSReadOnlyPersistentStoreOption, + NSRemovedPersistentStoresKey, NSSQLiteAnalyzeOption, NSSQLiteManualVacuumOption, + NSSQLitePragmasOption, NSSQLiteStoreType, NSStoreModelVersionHashesKey, + NSStoreModelVersionIdentifiersKey, NSStorePathKey, NSStoreTypeKey, NSStoreUUIDInPathKey, + NSStoreUUIDKey, NSUUIDChangedPersistentStoresKey, NSValidateXMLStoreOption, + NSXMLExternalRecordType, NSXMLStoreType, +}; +pub use self::__NSPersistentStoreDescription::NSPersistentStoreDescription; +pub use self::__NSPersistentStoreRequest::{ + NSBatchDeleteRequestType, NSBatchInsertRequestType, NSBatchUpdateRequestType, + NSFetchRequestType, NSPersistentStoreRequest, NSPersistentStoreRequestType, NSSaveRequestType, +}; +pub use self::__NSPersistentStoreResult::{ + NSAsynchronousFetchResult, NSBatchDeleteRequestResultType, NSBatchDeleteResult, + NSBatchDeleteResultTypeCount, NSBatchDeleteResultTypeObjectIDs, + NSBatchDeleteResultTypeStatusOnly, NSBatchInsertRequestResultType, + NSBatchInsertRequestResultTypeCount, NSBatchInsertRequestResultTypeObjectIDs, + NSBatchInsertRequestResultTypeStatusOnly, NSBatchInsertResult, NSBatchUpdateRequestResultType, + NSBatchUpdateResult, NSPersistentCloudKitContainerEventResult, + NSPersistentCloudKitContainerEventResultType, + NSPersistentCloudKitContainerEventResultTypeCountEvents, + NSPersistentCloudKitContainerEventResultTypeEvents, NSPersistentHistoryResult, + NSPersistentHistoryResultType, NSPersistentHistoryResultTypeChangesOnly, + NSPersistentHistoryResultTypeCount, NSPersistentHistoryResultTypeObjectIDs, + NSPersistentHistoryResultTypeStatusOnly, NSPersistentHistoryResultTypeTransactionsAndChanges, + NSPersistentHistoryResultTypeTransactionsOnly, NSPersistentStoreAsynchronousResult, + NSPersistentStoreResult, NSStatusOnlyResultType, NSUpdatedObjectIDsResultType, + NSUpdatedObjectsCountResultType, +}; +pub use self::__NSPropertyDescription::NSPropertyDescription; +pub use self::__NSPropertyMapping::NSPropertyMapping; +pub use self::__NSQueryGenerationToken::NSQueryGenerationToken; +pub use self::__NSRelationshipDescription::{ + NSCascadeDeleteRule, NSDeleteRule, NSDenyDeleteRule, NSNoActionDeleteRule, NSNullifyDeleteRule, + NSRelationshipDescription, +}; +pub use self::__NSSaveChangesRequest::NSSaveChangesRequest; diff --git a/crates/icrate/src/generated/Foundation/FoundationErrors.rs b/crates/icrate/src/generated/Foundation/FoundationErrors.rs new file mode 100644 index 000000000..93081e7da --- /dev/null +++ b/crates/icrate/src/generated/Foundation/FoundationErrors.rs @@ -0,0 +1,93 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_error_enum!( + #[underlying(NSInteger)] + pub enum { + NSFileNoSuchFileError = 4, + NSFileLockingError = 255, + NSFileReadUnknownError = 256, + NSFileReadNoPermissionError = 257, + NSFileReadInvalidFileNameError = 258, + NSFileReadCorruptFileError = 259, + NSFileReadNoSuchFileError = 260, + NSFileReadInapplicableStringEncodingError = 261, + NSFileReadUnsupportedSchemeError = 262, + NSFileReadTooLargeError = 263, + NSFileReadUnknownStringEncodingError = 264, + NSFileWriteUnknownError = 512, + NSFileWriteNoPermissionError = 513, + NSFileWriteInvalidFileNameError = 514, + NSFileWriteFileExistsError = 516, + NSFileWriteInapplicableStringEncodingError = 517, + NSFileWriteUnsupportedSchemeError = 518, + NSFileWriteOutOfSpaceError = 640, + NSFileWriteVolumeReadOnlyError = 642, + NSFileManagerUnmountUnknownError = 768, + NSFileManagerUnmountBusyError = 769, + NSKeyValueValidationError = 1024, + NSFormattingError = 2048, + NSUserCancelledError = 3072, + NSFeatureUnsupportedError = 3328, + NSExecutableNotLoadableError = 3584, + NSExecutableArchitectureMismatchError = 3585, + NSExecutableRuntimeMismatchError = 3586, + NSExecutableLoadError = 3587, + NSExecutableLinkError = 3588, + NSFileErrorMinimum = 0, + NSFileErrorMaximum = 1023, + NSValidationErrorMinimum = 1024, + NSValidationErrorMaximum = 2047, + NSExecutableErrorMinimum = 3584, + NSExecutableErrorMaximum = 3839, + NSFormattingErrorMinimum = 2048, + NSFormattingErrorMaximum = 2559, + NSPropertyListReadCorruptError = 3840, + NSPropertyListReadUnknownVersionError = 3841, + NSPropertyListReadStreamError = 3842, + NSPropertyListWriteStreamError = 3851, + NSPropertyListWriteInvalidError = 3852, + NSPropertyListErrorMinimum = 3840, + NSPropertyListErrorMaximum = 4095, + NSXPCConnectionInterrupted = 4097, + NSXPCConnectionInvalid = 4099, + NSXPCConnectionReplyInvalid = 4101, + NSXPCConnectionErrorMinimum = 4096, + NSXPCConnectionErrorMaximum = 4224, + NSUbiquitousFileUnavailableError = 4353, + NSUbiquitousFileNotUploadedDueToQuotaError = 4354, + NSUbiquitousFileUbiquityServerNotAvailable = 4355, + NSUbiquitousFileErrorMinimum = 4352, + NSUbiquitousFileErrorMaximum = 4607, + NSUserActivityHandoffFailedError = 4608, + NSUserActivityConnectionUnavailableError = 4609, + NSUserActivityRemoteApplicationTimedOutError = 4610, + NSUserActivityHandoffUserInfoTooLargeError = 4611, + NSUserActivityErrorMinimum = 4608, + NSUserActivityErrorMaximum = 4863, + NSCoderReadCorruptError = 4864, + NSCoderValueNotFoundError = 4865, + NSCoderInvalidValueError = 4866, + NSCoderErrorMinimum = 4864, + NSCoderErrorMaximum = 4991, + NSBundleErrorMinimum = 4992, + NSBundleErrorMaximum = 5119, + NSBundleOnDemandResourceOutOfSpaceError = 4992, + NSBundleOnDemandResourceExceededMaximumSizeError = 4993, + NSBundleOnDemandResourceInvalidTagError = 4994, + NSCloudSharingNetworkFailureError = 5120, + NSCloudSharingQuotaExceededError = 5121, + NSCloudSharingTooManyParticipantsError = 5122, + NSCloudSharingConflictError = 5123, + NSCloudSharingNoPermissionError = 5124, + NSCloudSharingOtherError = 5375, + NSCloudSharingErrorMinimum = 5120, + NSCloudSharingErrorMaximum = 5375, + NSCompressionFailedError = 5376, + NSDecompressionFailedError = 5377, + NSCompressionErrorMinimum = 5376, + NSCompressionErrorMaximum = 5503, + } +); diff --git a/crates/icrate/src/generated/Foundation/FoundationLegacySwiftCompatibility.rs b/crates/icrate/src/generated/Foundation/FoundationLegacySwiftCompatibility.rs new file mode 100644 index 000000000..bbc1e79ac --- /dev/null +++ b/crates/icrate/src/generated/Foundation/FoundationLegacySwiftCompatibility.rs @@ -0,0 +1,4 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; diff --git a/crates/icrate/src/generated/Foundation/NSAffineTransform.rs b/crates/icrate/src/generated/Foundation/NSAffineTransform.rs new file mode 100644 index 000000000..6dc22f2a7 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSAffineTransform.rs @@ -0,0 +1,76 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_struct!( + pub struct NSAffineTransformStruct { + pub m11: CGFloat, + pub m12: CGFloat, + pub m21: CGFloat, + pub m22: CGFloat, + pub tX: CGFloat, + pub tY: CGFloat, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSAffineTransform; + + unsafe impl ClassType for NSAffineTransform { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAffineTransform { + #[method_id(@__retain_semantics Other transform)] + pub unsafe fn transform() -> Id; + + #[method_id(@__retain_semantics Init initWithTransform:)] + pub unsafe fn initWithTransform( + this: Option>, + transform: &NSAffineTransform, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(translateXBy:yBy:)] + pub unsafe fn translateXBy_yBy(&self, deltaX: CGFloat, deltaY: CGFloat); + + #[method(rotateByDegrees:)] + pub unsafe fn rotateByDegrees(&self, angle: CGFloat); + + #[method(rotateByRadians:)] + pub unsafe fn rotateByRadians(&self, angle: CGFloat); + + #[method(scaleBy:)] + pub unsafe fn scaleBy(&self, scale: CGFloat); + + #[method(scaleXBy:yBy:)] + pub unsafe fn scaleXBy_yBy(&self, scaleX: CGFloat, scaleY: CGFloat); + + #[method(invert)] + pub unsafe fn invert(&self); + + #[method(appendTransform:)] + pub unsafe fn appendTransform(&self, transform: &NSAffineTransform); + + #[method(prependTransform:)] + pub unsafe fn prependTransform(&self, transform: &NSAffineTransform); + + #[method(transformPoint:)] + pub unsafe fn transformPoint(&self, aPoint: NSPoint) -> NSPoint; + + #[method(transformSize:)] + pub unsafe fn transformSize(&self, aSize: NSSize) -> NSSize; + + #[method(transformStruct)] + pub unsafe fn transformStruct(&self) -> NSAffineTransformStruct; + + #[method(setTransformStruct:)] + pub unsafe fn setTransformStruct(&self, transformStruct: NSAffineTransformStruct); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSAppleEventDescriptor.rs b/crates/icrate/src/generated/Foundation/NSAppleEventDescriptor.rs new file mode 100644 index 000000000..0756bed4e --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSAppleEventDescriptor.rs @@ -0,0 +1,143 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSAppleEventSendOptions { + NSAppleEventSendNoReply = 1, + NSAppleEventSendQueueReply = 2, + NSAppleEventSendWaitForReply = 3, + NSAppleEventSendNeverInteract = 16, + NSAppleEventSendCanInteract = 32, + NSAppleEventSendAlwaysInteract = 48, + NSAppleEventSendCanSwitchLayer = 64, + NSAppleEventSendDontRecord = 4096, + NSAppleEventSendDontExecute = 8192, + NSAppleEventSendDontAnnotate = 65536, + NSAppleEventSendDefaultOptions = 35, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSAppleEventDescriptor; + + unsafe impl ClassType for NSAppleEventDescriptor { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAppleEventDescriptor { + #[method_id(@__retain_semantics Other nullDescriptor)] + pub unsafe fn nullDescriptor() -> Id; + + #[method_id(@__retain_semantics Other descriptorWithBoolean:)] + pub unsafe fn descriptorWithBoolean(boolean: Boolean) + -> Id; + + #[method_id(@__retain_semantics Other descriptorWithEnumCode:)] + pub unsafe fn descriptorWithEnumCode( + enumerator: OSType, + ) -> Id; + + #[method_id(@__retain_semantics Other descriptorWithInt32:)] + pub unsafe fn descriptorWithInt32(signedInt: i32) -> Id; + + #[method_id(@__retain_semantics Other descriptorWithDouble:)] + pub unsafe fn descriptorWithDouble( + doubleValue: c_double, + ) -> Id; + + #[method_id(@__retain_semantics Other descriptorWithTypeCode:)] + pub unsafe fn descriptorWithTypeCode( + typeCode: OSType, + ) -> Id; + + #[method_id(@__retain_semantics Other descriptorWithString:)] + pub unsafe fn descriptorWithString(string: &NSString) + -> Id; + + #[method_id(@__retain_semantics Other descriptorWithDate:)] + pub unsafe fn descriptorWithDate(date: &NSDate) -> Id; + + #[method_id(@__retain_semantics Other descriptorWithFileURL:)] + pub unsafe fn descriptorWithFileURL(fileURL: &NSURL) -> Id; + + #[method_id(@__retain_semantics Other listDescriptor)] + pub unsafe fn listDescriptor() -> Id; + + #[method_id(@__retain_semantics Other recordDescriptor)] + pub unsafe fn recordDescriptor() -> Id; + + #[method_id(@__retain_semantics Other currentProcessDescriptor)] + pub unsafe fn currentProcessDescriptor() -> Id; + + #[method_id(@__retain_semantics Other descriptorWithBundleIdentifier:)] + pub unsafe fn descriptorWithBundleIdentifier( + bundleIdentifier: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other descriptorWithApplicationURL:)] + pub unsafe fn descriptorWithApplicationURL( + applicationURL: &NSURL, + ) -> Id; + + #[method_id(@__retain_semantics Init initListDescriptor)] + pub unsafe fn initListDescriptor(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initRecordDescriptor)] + pub unsafe fn initRecordDescriptor(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other data)] + pub unsafe fn data(&self) -> Id; + + #[method(booleanValue)] + pub unsafe fn booleanValue(&self) -> Boolean; + + #[method(enumCodeValue)] + pub unsafe fn enumCodeValue(&self) -> OSType; + + #[method(int32Value)] + pub unsafe fn int32Value(&self) -> i32; + + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + + #[method(typeCodeValue)] + pub unsafe fn typeCodeValue(&self) -> OSType; + + #[method_id(@__retain_semantics Other stringValue)] + pub unsafe fn stringValue(&self) -> Option>; + + #[method_id(@__retain_semantics Other dateValue)] + pub unsafe fn dateValue(&self) -> Option>; + + #[method_id(@__retain_semantics Other fileURLValue)] + pub unsafe fn fileURLValue(&self) -> Option>; + + #[method(isRecordDescriptor)] + pub unsafe fn isRecordDescriptor(&self) -> bool; + + #[method(numberOfItems)] + pub unsafe fn numberOfItems(&self) -> NSInteger; + + #[method(insertDescriptor:atIndex:)] + pub unsafe fn insertDescriptor_atIndex( + &self, + descriptor: &NSAppleEventDescriptor, + index: NSInteger, + ); + + #[method_id(@__retain_semantics Other descriptorAtIndex:)] + pub unsafe fn descriptorAtIndex( + &self, + index: NSInteger, + ) -> Option>; + + #[method(removeDescriptorAtIndex:)] + pub unsafe fn removeDescriptorAtIndex(&self, index: NSInteger); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSAppleEventManager.rs b/crates/icrate/src/generated/Foundation/NSAppleEventManager.rs new file mode 100644 index 000000000..15f00dce4 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSAppleEventManager.rs @@ -0,0 +1,58 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSAppleEventManagerSuspensionID = *mut c_void; + +extern_static!(NSAppleEventTimeOutDefault: c_double); + +extern_static!(NSAppleEventTimeOutNone: c_double); + +extern_static!(NSAppleEventManagerWillProcessFirstEventNotification: &'static NSNotificationName); + +extern_class!( + #[derive(Debug)] + pub struct NSAppleEventManager; + + unsafe impl ClassType for NSAppleEventManager { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAppleEventManager { + #[method_id(@__retain_semantics Other sharedAppleEventManager)] + pub unsafe fn sharedAppleEventManager() -> Id; + + #[method_id(@__retain_semantics Other currentAppleEvent)] + pub unsafe fn currentAppleEvent(&self) -> Option>; + + #[method_id(@__retain_semantics Other currentReplyAppleEvent)] + pub unsafe fn currentReplyAppleEvent(&self) -> Option>; + + #[method(suspendCurrentAppleEvent)] + pub unsafe fn suspendCurrentAppleEvent(&self) -> NSAppleEventManagerSuspensionID; + + #[method_id(@__retain_semantics Other appleEventForSuspensionID:)] + pub unsafe fn appleEventForSuspensionID( + &self, + suspensionID: NSAppleEventManagerSuspensionID, + ) -> Id; + + #[method_id(@__retain_semantics Other replyAppleEventForSuspensionID:)] + pub unsafe fn replyAppleEventForSuspensionID( + &self, + suspensionID: NSAppleEventManagerSuspensionID, + ) -> Id; + + #[method(setCurrentAppleEventAndReplyEventWithSuspensionID:)] + pub unsafe fn setCurrentAppleEventAndReplyEventWithSuspensionID( + &self, + suspensionID: NSAppleEventManagerSuspensionID, + ); + + #[method(resumeWithSuspensionID:)] + pub unsafe fn resumeWithSuspensionID(&self, suspensionID: NSAppleEventManagerSuspensionID); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSAppleScript.rs b/crates/icrate/src/generated/Foundation/NSAppleScript.rs new file mode 100644 index 000000000..b8b91c17e --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSAppleScript.rs @@ -0,0 +1,65 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSAppleScriptErrorMessage: &'static NSString); + +extern_static!(NSAppleScriptErrorNumber: &'static NSString); + +extern_static!(NSAppleScriptErrorAppName: &'static NSString); + +extern_static!(NSAppleScriptErrorBriefMessage: &'static NSString); + +extern_static!(NSAppleScriptErrorRange: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSAppleScript; + + unsafe impl ClassType for NSAppleScript { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAppleScript { + #[method_id(@__retain_semantics Init initWithContentsOfURL:error:)] + pub unsafe fn initWithContentsOfURL_error( + this: Option>, + url: &NSURL, + errorInfo: *mut *mut NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithSource:)] + pub unsafe fn initWithSource( + this: Option>, + source: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other source)] + pub unsafe fn source(&self) -> Option>; + + #[method(isCompiled)] + pub unsafe fn isCompiled(&self) -> bool; + + #[method(compileAndReturnError:)] + pub unsafe fn compileAndReturnError( + &self, + errorInfo: *mut *mut NSDictionary, + ) -> bool; + + #[method_id(@__retain_semantics Other executeAndReturnError:)] + pub unsafe fn executeAndReturnError( + &self, + errorInfo: *mut *mut NSDictionary, + ) -> Id; + + #[method_id(@__retain_semantics Other executeAppleEvent:error:)] + pub unsafe fn executeAppleEvent_error( + &self, + event: &NSAppleEventDescriptor, + errorInfo: *mut *mut NSDictionary, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSArchiver.rs b/crates/icrate/src/generated/Foundation/NSArchiver.rs new file mode 100644 index 000000000..89859917c --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSArchiver.rs @@ -0,0 +1,108 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSArchiver; + + unsafe impl ClassType for NSArchiver { + type Super = NSCoder; + } +); + +extern_methods!( + unsafe impl NSArchiver { + #[method_id(@__retain_semantics Init initForWritingWithMutableData:)] + pub unsafe fn initForWritingWithMutableData( + this: Option>, + mdata: &NSMutableData, + ) -> Id; + + #[method_id(@__retain_semantics Other archiverData)] + pub unsafe fn archiverData(&self) -> Id; + + #[method(encodeRootObject:)] + pub unsafe fn encodeRootObject(&self, rootObject: &Object); + + #[method(encodeConditionalObject:)] + pub unsafe fn encodeConditionalObject(&self, object: Option<&Object>); + + #[method_id(@__retain_semantics Other archivedDataWithRootObject:)] + pub unsafe fn archivedDataWithRootObject(rootObject: &Object) -> Id; + + #[method(archiveRootObject:toFile:)] + pub unsafe fn archiveRootObject_toFile(rootObject: &Object, path: &NSString) -> bool; + + #[method(encodeClassName:intoClassName:)] + pub unsafe fn encodeClassName_intoClassName( + &self, + trueName: &NSString, + inArchiveName: &NSString, + ); + + #[method_id(@__retain_semantics Other classNameEncodedForTrueClassName:)] + pub unsafe fn classNameEncodedForTrueClassName( + &self, + trueName: &NSString, + ) -> Option>; + + #[method(replaceObject:withObject:)] + pub unsafe fn replaceObject_withObject(&self, object: &Object, newObject: &Object); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnarchiver; + + unsafe impl ClassType for NSUnarchiver { + type Super = NSCoder; + } +); + +extern_methods!( + unsafe impl NSUnarchiver { + #[method_id(@__retain_semantics Init initForReadingWithData:)] + pub unsafe fn initForReadingWithData( + this: Option>, + data: &NSData, + ) -> Option>; + + #[method(setObjectZone:)] + pub unsafe fn setObjectZone(&self, zone: *mut NSZone); + + #[method(objectZone)] + pub unsafe fn objectZone(&self) -> *mut NSZone; + + #[method(isAtEnd)] + pub unsafe fn isAtEnd(&self) -> bool; + + #[method(systemVersion)] + pub unsafe fn systemVersion(&self) -> c_uint; + + #[method_id(@__retain_semantics Other unarchiveObjectWithData:)] + pub unsafe fn unarchiveObjectWithData(data: &NSData) -> Option>; + + #[method_id(@__retain_semantics Other unarchiveObjectWithFile:)] + pub unsafe fn unarchiveObjectWithFile(path: &NSString) -> Option>; + + #[method(replaceObject:withObject:)] + pub unsafe fn replaceObject_withObject(&self, object: &Object, newObject: &Object); + } +); + +extern_methods!( + /// NSArchiverCallback + unsafe impl NSObject { + #[method(classForArchiver)] + pub unsafe fn classForArchiver(&self) -> Option<&'static Class>; + + #[method_id(@__retain_semantics Other replacementObjectForArchiver:)] + pub unsafe fn replacementObjectForArchiver( + &self, + archiver: &NSArchiver, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSArray.rs b/crates/icrate/src/generated/Foundation/NSArray.rs new file mode 100644 index 000000000..2ff4e4607 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSArray.rs @@ -0,0 +1,589 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSArray { + _inner0: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSArray { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSArray { + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other objectAtIndex:)] + pub unsafe fn objectAtIndex(&self, index: NSUInteger) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithObjects:count:)] + pub unsafe fn initWithObjects_count( + this: Option>, + objects: *mut NonNull, + cnt: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSBinarySearchingOptions { + NSBinarySearchingFirstEqual = 1 << 8, + NSBinarySearchingLastEqual = 1 << 9, + NSBinarySearchingInsertionIndex = 1 << 10, + } +); + +extern_methods!( + /// NSExtendedArray + unsafe impl NSArray { + #[method_id(@__retain_semantics Other arrayByAddingObject:)] + pub unsafe fn arrayByAddingObject( + &self, + anObject: &ObjectType, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other arrayByAddingObjectsFromArray:)] + pub unsafe fn arrayByAddingObjectsFromArray( + &self, + otherArray: &NSArray, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other componentsJoinedByString:)] + pub unsafe fn componentsJoinedByString(&self, separator: &NSString) + -> Id; + + #[method(containsObject:)] + pub unsafe fn containsObject(&self, anObject: &ObjectType) -> bool; + + #[method_id(@__retain_semantics Other description)] + pub unsafe fn description(&self) -> Id; + + #[method_id(@__retain_semantics Other descriptionWithLocale:)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + + #[method_id(@__retain_semantics Other descriptionWithLocale:indent:)] + pub unsafe fn descriptionWithLocale_indent( + &self, + locale: Option<&Object>, + level: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other firstObjectCommonWithArray:)] + pub unsafe fn firstObjectCommonWithArray( + &self, + otherArray: &NSArray, + ) -> Option>; + + #[method(getObjects:range:)] + pub unsafe fn getObjects_range( + &self, + objects: NonNull>, + range: NSRange, + ); + + #[method(indexOfObject:)] + pub unsafe fn indexOfObject(&self, anObject: &ObjectType) -> NSUInteger; + + #[method(indexOfObject:inRange:)] + pub unsafe fn indexOfObject_inRange( + &self, + anObject: &ObjectType, + range: NSRange, + ) -> NSUInteger; + + #[method(indexOfObjectIdenticalTo:)] + pub unsafe fn indexOfObjectIdenticalTo(&self, anObject: &ObjectType) -> NSUInteger; + + #[method(indexOfObjectIdenticalTo:inRange:)] + pub unsafe fn indexOfObjectIdenticalTo_inRange( + &self, + anObject: &ObjectType, + range: NSRange, + ) -> NSUInteger; + + #[method(isEqualToArray:)] + pub unsafe fn isEqualToArray(&self, otherArray: &NSArray) -> bool; + + #[method_id(@__retain_semantics Other firstObject)] + pub unsafe fn firstObject(&self) -> Option>; + + #[method_id(@__retain_semantics Other lastObject)] + pub unsafe fn lastObject(&self) -> Option>; + + #[method_id(@__retain_semantics Other objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other reverseObjectEnumerator)] + pub unsafe fn reverseObjectEnumerator(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other sortedArrayHint)] + pub unsafe fn sortedArrayHint(&self) -> Id; + + #[method_id(@__retain_semantics Other sortedArrayUsingFunction:context:)] + pub unsafe fn sortedArrayUsingFunction_context( + &self, + comparator: unsafe extern "C" fn( + NonNull, + NonNull, + *mut c_void, + ) -> NSInteger, + context: *mut c_void, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other sortedArrayUsingFunction:context:hint:)] + pub unsafe fn sortedArrayUsingFunction_context_hint( + &self, + comparator: unsafe extern "C" fn( + NonNull, + NonNull, + *mut c_void, + ) -> NSInteger, + context: *mut c_void, + hint: Option<&NSData>, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other sortedArrayUsingSelector:)] + pub unsafe fn sortedArrayUsingSelector( + &self, + comparator: Sel, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other subarrayWithRange:)] + pub unsafe fn subarrayWithRange(&self, range: NSRange) -> Id, Shared>; + + #[method(writeToURL:error:)] + pub unsafe fn writeToURL_error(&self, url: &NSURL) -> Result<(), Id>; + + #[method(makeObjectsPerformSelector:)] + pub unsafe fn makeObjectsPerformSelector(&self, aSelector: Sel); + + #[method(makeObjectsPerformSelector:withObject:)] + pub unsafe fn makeObjectsPerformSelector_withObject( + &self, + aSelector: Sel, + argument: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other objectsAtIndexes:)] + pub unsafe fn objectsAtIndexes( + &self, + indexes: &NSIndexSet, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other objectAtIndexedSubscript:)] + pub unsafe fn objectAtIndexedSubscript(&self, idx: NSUInteger) -> Id; + + #[method(enumerateObjectsUsingBlock:)] + pub unsafe fn enumerateObjectsUsingBlock( + &self, + block: &Block<(NonNull, NSUInteger, NonNull), ()>, + ); + + #[method(enumerateObjectsWithOptions:usingBlock:)] + pub unsafe fn enumerateObjectsWithOptions_usingBlock( + &self, + opts: NSEnumerationOptions, + block: &Block<(NonNull, NSUInteger, NonNull), ()>, + ); + + #[method(enumerateObjectsAtIndexes:options:usingBlock:)] + pub unsafe fn enumerateObjectsAtIndexes_options_usingBlock( + &self, + s: &NSIndexSet, + opts: NSEnumerationOptions, + block: &Block<(NonNull, NSUInteger, NonNull), ()>, + ); + + #[method(indexOfObjectPassingTest:)] + pub unsafe fn indexOfObjectPassingTest( + &self, + predicate: &Block<(NonNull, NSUInteger, NonNull), Bool>, + ) -> NSUInteger; + + #[method(indexOfObjectWithOptions:passingTest:)] + pub unsafe fn indexOfObjectWithOptions_passingTest( + &self, + opts: NSEnumerationOptions, + predicate: &Block<(NonNull, NSUInteger, NonNull), Bool>, + ) -> NSUInteger; + + #[method(indexOfObjectAtIndexes:options:passingTest:)] + pub unsafe fn indexOfObjectAtIndexes_options_passingTest( + &self, + s: &NSIndexSet, + opts: NSEnumerationOptions, + predicate: &Block<(NonNull, NSUInteger, NonNull), Bool>, + ) -> NSUInteger; + + #[method_id(@__retain_semantics Other indexesOfObjectsPassingTest:)] + pub unsafe fn indexesOfObjectsPassingTest( + &self, + predicate: &Block<(NonNull, NSUInteger, NonNull), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Other indexesOfObjectsWithOptions:passingTest:)] + pub unsafe fn indexesOfObjectsWithOptions_passingTest( + &self, + opts: NSEnumerationOptions, + predicate: &Block<(NonNull, NSUInteger, NonNull), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Other indexesOfObjectsAtIndexes:options:passingTest:)] + pub unsafe fn indexesOfObjectsAtIndexes_options_passingTest( + &self, + s: &NSIndexSet, + opts: NSEnumerationOptions, + predicate: &Block<(NonNull, NSUInteger, NonNull), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Other sortedArrayUsingComparator:)] + pub unsafe fn sortedArrayUsingComparator( + &self, + cmptr: NSComparator, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other sortedArrayWithOptions:usingComparator:)] + pub unsafe fn sortedArrayWithOptions_usingComparator( + &self, + opts: NSSortOptions, + cmptr: NSComparator, + ) -> Id, Shared>; + + #[method(indexOfObject:inSortedRange:options:usingComparator:)] + pub unsafe fn indexOfObject_inSortedRange_options_usingComparator( + &self, + obj: &ObjectType, + r: NSRange, + opts: NSBinarySearchingOptions, + cmp: NSComparator, + ) -> NSUInteger; + } +); + +extern_methods!( + /// NSArrayCreation + unsafe impl NSArray { + #[method_id(@__retain_semantics Other array)] + pub unsafe fn array() -> Id; + + #[method_id(@__retain_semantics Other arrayWithObject:)] + pub unsafe fn arrayWithObject(anObject: &ObjectType) -> Id; + + #[method_id(@__retain_semantics Other arrayWithObjects:count:)] + pub unsafe fn arrayWithObjects_count( + objects: NonNull>, + cnt: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other arrayWithArray:)] + pub unsafe fn arrayWithArray(array: &NSArray) -> Id; + + #[method_id(@__retain_semantics Init initWithArray:)] + pub unsafe fn initWithArray( + this: Option>, + array: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithArray:copyItems:)] + pub unsafe fn initWithArray_copyItems( + this: Option>, + array: &NSArray, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:error:)] + pub unsafe fn initWithContentsOfURL_error( + this: Option>, + url: &NSURL, + ) -> Result, Shared>, Id>; + + #[method_id(@__retain_semantics Other arrayWithContentsOfURL:error:)] + pub unsafe fn arrayWithContentsOfURL_error( + url: &NSURL, + ) -> Result, Shared>, Id>; + } +); + +extern_methods!( + /// NSArrayDiffing + unsafe impl NSArray { + #[method_id(@__retain_semantics Other differenceFromArray:withOptions:usingEquivalenceTest:)] + pub unsafe fn differenceFromArray_withOptions_usingEquivalenceTest( + &self, + other: &NSArray, + options: NSOrderedCollectionDifferenceCalculationOptions, + block: &Block<(NonNull, NonNull), Bool>, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other differenceFromArray:withOptions:)] + pub unsafe fn differenceFromArray_withOptions( + &self, + other: &NSArray, + options: NSOrderedCollectionDifferenceCalculationOptions, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other differenceFromArray:)] + pub unsafe fn differenceFromArray( + &self, + other: &NSArray, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other arrayByApplyingDifference:)] + pub unsafe fn arrayByApplyingDifference( + &self, + difference: &NSOrderedCollectionDifference, + ) -> Option, Shared>>; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSArray { + #[method(getObjects:)] + pub unsafe fn getObjects(&self, objects: NonNull>); + + #[method_id(@__retain_semantics Other arrayWithContentsOfFile:)] + pub unsafe fn arrayWithContentsOfFile( + path: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other arrayWithContentsOfURL:)] + pub unsafe fn arrayWithContentsOfURL( + url: &NSURL, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Init initWithContentsOfFile:)] + pub unsafe fn initWithContentsOfFile( + this: Option>, + path: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:)] + pub unsafe fn initWithContentsOfURL( + this: Option>, + url: &NSURL, + ) -> Option, Shared>>; + + #[method(writeToFile:atomically:)] + pub unsafe fn writeToFile_atomically( + &self, + path: &NSString, + useAuxiliaryFile: bool, + ) -> bool; + + #[method(writeToURL:atomically:)] + pub unsafe fn writeToURL_atomically(&self, url: &NSURL, atomically: bool) -> bool; + } +); + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSMutableArray { + _inner0: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSMutableArray { + type Super = NSArray; + } +); + +extern_methods!( + unsafe impl NSMutableArray { + #[method(addObject:)] + pub unsafe fn addObject(&self, anObject: &ObjectType); + + #[method(insertObject:atIndex:)] + pub unsafe fn insertObject_atIndex(&self, anObject: &ObjectType, index: NSUInteger); + + #[method(removeLastObject)] + pub unsafe fn removeLastObject(&self); + + #[method(removeObjectAtIndex:)] + pub unsafe fn removeObjectAtIndex(&self, index: NSUInteger); + + #[method(replaceObjectAtIndex:withObject:)] + pub unsafe fn replaceObjectAtIndex_withObject( + &self, + index: NSUInteger, + anObject: &ObjectType, + ); + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCapacity:)] + pub unsafe fn initWithCapacity( + this: Option>, + numItems: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_methods!( + /// NSExtendedMutableArray + unsafe impl NSMutableArray { + #[method(addObjectsFromArray:)] + pub unsafe fn addObjectsFromArray(&self, otherArray: &NSArray); + + #[method(exchangeObjectAtIndex:withObjectAtIndex:)] + pub unsafe fn exchangeObjectAtIndex_withObjectAtIndex( + &self, + idx1: NSUInteger, + idx2: NSUInteger, + ); + + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + + #[method(removeObject:inRange:)] + pub unsafe fn removeObject_inRange(&self, anObject: &ObjectType, range: NSRange); + + #[method(removeObject:)] + pub unsafe fn removeObject(&self, anObject: &ObjectType); + + #[method(removeObjectIdenticalTo:inRange:)] + pub unsafe fn removeObjectIdenticalTo_inRange(&self, anObject: &ObjectType, range: NSRange); + + #[method(removeObjectIdenticalTo:)] + pub unsafe fn removeObjectIdenticalTo(&self, anObject: &ObjectType); + + #[method(removeObjectsFromIndices:numIndices:)] + pub unsafe fn removeObjectsFromIndices_numIndices( + &self, + indices: NonNull, + cnt: NSUInteger, + ); + + #[method(removeObjectsInArray:)] + pub unsafe fn removeObjectsInArray(&self, otherArray: &NSArray); + + #[method(removeObjectsInRange:)] + pub unsafe fn removeObjectsInRange(&self, range: NSRange); + + #[method(replaceObjectsInRange:withObjectsFromArray:range:)] + pub unsafe fn replaceObjectsInRange_withObjectsFromArray_range( + &self, + range: NSRange, + otherArray: &NSArray, + otherRange: NSRange, + ); + + #[method(replaceObjectsInRange:withObjectsFromArray:)] + pub unsafe fn replaceObjectsInRange_withObjectsFromArray( + &self, + range: NSRange, + otherArray: &NSArray, + ); + + #[method(setArray:)] + pub unsafe fn setArray(&self, otherArray: &NSArray); + + #[method(sortUsingFunction:context:)] + pub unsafe fn sortUsingFunction_context( + &self, + compare: unsafe extern "C" fn( + NonNull, + NonNull, + *mut c_void, + ) -> NSInteger, + context: *mut c_void, + ); + + #[method(sortUsingSelector:)] + pub unsafe fn sortUsingSelector(&self, comparator: Sel); + + #[method(insertObjects:atIndexes:)] + pub unsafe fn insertObjects_atIndexes( + &self, + objects: &NSArray, + indexes: &NSIndexSet, + ); + + #[method(removeObjectsAtIndexes:)] + pub unsafe fn removeObjectsAtIndexes(&self, indexes: &NSIndexSet); + + #[method(replaceObjectsAtIndexes:withObjects:)] + pub unsafe fn replaceObjectsAtIndexes_withObjects( + &self, + indexes: &NSIndexSet, + objects: &NSArray, + ); + + #[method(setObject:atIndexedSubscript:)] + pub unsafe fn setObject_atIndexedSubscript(&self, obj: &ObjectType, idx: NSUInteger); + + #[method(sortUsingComparator:)] + pub unsafe fn sortUsingComparator(&self, cmptr: NSComparator); + + #[method(sortWithOptions:usingComparator:)] + pub unsafe fn sortWithOptions_usingComparator( + &self, + opts: NSSortOptions, + cmptr: NSComparator, + ); + } +); + +extern_methods!( + /// NSMutableArrayCreation + unsafe impl NSMutableArray { + #[method_id(@__retain_semantics Other arrayWithCapacity:)] + pub unsafe fn arrayWithCapacity(numItems: NSUInteger) -> Id; + + #[method_id(@__retain_semantics Other arrayWithContentsOfFile:)] + pub unsafe fn arrayWithContentsOfFile( + path: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other arrayWithContentsOfURL:)] + pub unsafe fn arrayWithContentsOfURL( + url: &NSURL, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Init initWithContentsOfFile:)] + pub unsafe fn initWithContentsOfFile( + this: Option>, + path: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:)] + pub unsafe fn initWithContentsOfURL( + this: Option>, + url: &NSURL, + ) -> Option, Shared>>; + } +); + +extern_methods!( + /// NSMutableArrayDiffing + unsafe impl NSMutableArray { + #[method(applyDifference:)] + pub unsafe fn applyDifference( + &self, + difference: &NSOrderedCollectionDifference, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSAttributedString.rs b/crates/icrate/src/generated/Foundation/NSAttributedString.rs new file mode 100644 index 000000000..4201bc342 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSAttributedString.rs @@ -0,0 +1,509 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSAttributedStringKey = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSAttributedString; + + unsafe impl ClassType for NSAttributedString { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAttributedString { + #[method_id(@__retain_semantics Other string)] + pub unsafe fn string(&self) -> Id; + + #[method_id(@__retain_semantics Other attributesAtIndex:effectiveRange:)] + pub unsafe fn attributesAtIndex_effectiveRange( + &self, + location: NSUInteger, + range: NSRangePointer, + ) -> Id, Shared>; + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSAttributedStringEnumerationOptions { + NSAttributedStringEnumerationReverse = 1 << 1, + NSAttributedStringEnumerationLongestEffectiveRangeNotRequired = 1 << 20, + } +); + +extern_methods!( + /// NSExtendedAttributedString + unsafe impl NSAttributedString { + #[method(length)] + pub unsafe fn length(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other attribute:atIndex:effectiveRange:)] + pub unsafe fn attribute_atIndex_effectiveRange( + &self, + attrName: &NSAttributedStringKey, + location: NSUInteger, + range: NSRangePointer, + ) -> Option>; + + #[method_id(@__retain_semantics Other attributedSubstringFromRange:)] + pub unsafe fn attributedSubstringFromRange( + &self, + range: NSRange, + ) -> Id; + + #[method_id(@__retain_semantics Other attributesAtIndex:longestEffectiveRange:inRange:)] + pub unsafe fn attributesAtIndex_longestEffectiveRange_inRange( + &self, + location: NSUInteger, + range: NSRangePointer, + rangeLimit: NSRange, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other attribute:atIndex:longestEffectiveRange:inRange:)] + pub unsafe fn attribute_atIndex_longestEffectiveRange_inRange( + &self, + attrName: &NSAttributedStringKey, + location: NSUInteger, + range: NSRangePointer, + rangeLimit: NSRange, + ) -> Option>; + + #[method(isEqualToAttributedString:)] + pub unsafe fn isEqualToAttributedString(&self, other: &NSAttributedString) -> bool; + + #[method_id(@__retain_semantics Init initWithString:)] + pub unsafe fn initWithString( + this: Option>, + str: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithString:attributes:)] + pub unsafe fn initWithString_attributes( + this: Option>, + str: &NSString, + attrs: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithAttributedString:)] + pub unsafe fn initWithAttributedString( + this: Option>, + attrStr: &NSAttributedString, + ) -> Id; + + #[method(enumerateAttributesInRange:options:usingBlock:)] + pub unsafe fn enumerateAttributesInRange_options_usingBlock( + &self, + enumerationRange: NSRange, + opts: NSAttributedStringEnumerationOptions, + block: &Block< + ( + NonNull>, + NSRange, + NonNull, + ), + (), + >, + ); + + #[method(enumerateAttribute:inRange:options:usingBlock:)] + pub unsafe fn enumerateAttribute_inRange_options_usingBlock( + &self, + attrName: &NSAttributedStringKey, + enumerationRange: NSRange, + opts: NSAttributedStringEnumerationOptions, + block: &Block<(*mut Object, NSRange, NonNull), ()>, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMutableAttributedString; + + unsafe impl ClassType for NSMutableAttributedString { + type Super = NSAttributedString; + } +); + +extern_methods!( + unsafe impl NSMutableAttributedString { + #[method(replaceCharactersInRange:withString:)] + pub unsafe fn replaceCharactersInRange_withString(&self, range: NSRange, str: &NSString); + + #[method(setAttributes:range:)] + pub unsafe fn setAttributes_range( + &self, + attrs: Option<&NSDictionary>, + range: NSRange, + ); + } +); + +extern_methods!( + /// NSExtendedMutableAttributedString + unsafe impl NSMutableAttributedString { + #[method_id(@__retain_semantics Other mutableString)] + pub unsafe fn mutableString(&self) -> Id; + + #[method(addAttribute:value:range:)] + pub unsafe fn addAttribute_value_range( + &self, + name: &NSAttributedStringKey, + value: &Object, + range: NSRange, + ); + + #[method(addAttributes:range:)] + pub unsafe fn addAttributes_range( + &self, + attrs: &NSDictionary, + range: NSRange, + ); + + #[method(removeAttribute:range:)] + pub unsafe fn removeAttribute_range(&self, name: &NSAttributedStringKey, range: NSRange); + + #[method(replaceCharactersInRange:withAttributedString:)] + pub unsafe fn replaceCharactersInRange_withAttributedString( + &self, + range: NSRange, + attrString: &NSAttributedString, + ); + + #[method(insertAttributedString:atIndex:)] + pub unsafe fn insertAttributedString_atIndex( + &self, + attrString: &NSAttributedString, + loc: NSUInteger, + ); + + #[method(appendAttributedString:)] + pub unsafe fn appendAttributedString(&self, attrString: &NSAttributedString); + + #[method(deleteCharactersInRange:)] + pub unsafe fn deleteCharactersInRange(&self, range: NSRange); + + #[method(setAttributedString:)] + pub unsafe fn setAttributedString(&self, attrString: &NSAttributedString); + + #[method(beginEditing)] + pub unsafe fn beginEditing(&self); + + #[method(endEditing)] + pub unsafe fn endEditing(&self); + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSInlinePresentationIntent { + NSInlinePresentationIntentEmphasized = 1 << 0, + NSInlinePresentationIntentStronglyEmphasized = 1 << 1, + NSInlinePresentationIntentCode = 1 << 2, + NSInlinePresentationIntentStrikethrough = 1 << 5, + NSInlinePresentationIntentSoftBreak = 1 << 6, + NSInlinePresentationIntentLineBreak = 1 << 7, + NSInlinePresentationIntentInlineHTML = 1 << 8, + NSInlinePresentationIntentBlockHTML = 1 << 9, + } +); + +extern_static!(NSInlinePresentationIntentAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSAlternateDescriptionAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSImageURLAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSLanguageIdentifierAttributeName: &'static NSAttributedStringKey); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSAttributedStringMarkdownParsingFailurePolicy { + NSAttributedStringMarkdownParsingFailureReturnError = 0, + NSAttributedStringMarkdownParsingFailureReturnPartiallyParsedIfPossible = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSAttributedStringMarkdownInterpretedSyntax { + NSAttributedStringMarkdownInterpretedSyntaxFull = 0, + NSAttributedStringMarkdownInterpretedSyntaxInlineOnly = 1, + NSAttributedStringMarkdownInterpretedSyntaxInlineOnlyPreservingWhitespace = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSAttributedStringMarkdownParsingOptions; + + unsafe impl ClassType for NSAttributedStringMarkdownParsingOptions { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAttributedStringMarkdownParsingOptions { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(allowsExtendedAttributes)] + pub unsafe fn allowsExtendedAttributes(&self) -> bool; + + #[method(setAllowsExtendedAttributes:)] + pub unsafe fn setAllowsExtendedAttributes(&self, allowsExtendedAttributes: bool); + + #[method(interpretedSyntax)] + pub unsafe fn interpretedSyntax(&self) -> NSAttributedStringMarkdownInterpretedSyntax; + + #[method(setInterpretedSyntax:)] + pub unsafe fn setInterpretedSyntax( + &self, + interpretedSyntax: NSAttributedStringMarkdownInterpretedSyntax, + ); + + #[method(failurePolicy)] + pub unsafe fn failurePolicy(&self) -> NSAttributedStringMarkdownParsingFailurePolicy; + + #[method(setFailurePolicy:)] + pub unsafe fn setFailurePolicy( + &self, + failurePolicy: NSAttributedStringMarkdownParsingFailurePolicy, + ); + + #[method_id(@__retain_semantics Other languageCode)] + pub unsafe fn languageCode(&self) -> Option>; + + #[method(setLanguageCode:)] + pub unsafe fn setLanguageCode(&self, languageCode: Option<&NSString>); + } +); + +extern_methods!( + /// NSAttributedStringCreateFromMarkdown + unsafe impl NSAttributedString { + #[method_id(@__retain_semantics Init initWithContentsOfMarkdownFileAtURL:options:baseURL:error:)] + pub unsafe fn initWithContentsOfMarkdownFileAtURL_options_baseURL_error( + this: Option>, + markdownFile: &NSURL, + options: Option<&NSAttributedStringMarkdownParsingOptions>, + baseURL: Option<&NSURL>, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithMarkdown:options:baseURL:error:)] + pub unsafe fn initWithMarkdown_options_baseURL_error( + this: Option>, + markdown: &NSData, + options: Option<&NSAttributedStringMarkdownParsingOptions>, + baseURL: Option<&NSURL>, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithMarkdownString:options:baseURL:error:)] + pub unsafe fn initWithMarkdownString_options_baseURL_error( + this: Option>, + markdownString: &NSString, + options: Option<&NSAttributedStringMarkdownParsingOptions>, + baseURL: Option<&NSURL>, + ) -> Result, Id>; + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSAttributedStringFormattingOptions { + NSAttributedStringFormattingInsertArgumentAttributesWithoutMerging = 1 << 0, + NSAttributedStringFormattingApplyReplacementIndexAttribute = 1 << 1, + } +); + +extern_methods!( + /// NSAttributedStringFormatting + unsafe impl NSAttributedString {} +); + +extern_methods!( + /// NSMutableAttributedStringFormatting + unsafe impl NSMutableAttributedString {} +); + +extern_static!(NSReplacementIndexAttributeName: &'static NSAttributedStringKey); + +extern_methods!( + /// NSMorphology + unsafe impl NSAttributedString { + #[method_id(@__retain_semantics Other attributedStringByInflectingString)] + pub unsafe fn attributedStringByInflectingString(&self) -> Id; + } +); + +extern_static!(NSMorphologyAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSInflectionRuleAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSInflectionAlternativeAttributeName: &'static NSAttributedStringKey); + +extern_static!(NSPresentationIntentAttributeName: &'static NSAttributedStringKey); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPresentationIntentKind { + NSPresentationIntentKindParagraph = 0, + NSPresentationIntentKindHeader = 1, + NSPresentationIntentKindOrderedList = 2, + NSPresentationIntentKindUnorderedList = 3, + NSPresentationIntentKindListItem = 4, + NSPresentationIntentKindCodeBlock = 5, + NSPresentationIntentKindBlockQuote = 6, + NSPresentationIntentKindThematicBreak = 7, + NSPresentationIntentKindTable = 8, + NSPresentationIntentKindTableHeaderRow = 9, + NSPresentationIntentKindTableRow = 10, + NSPresentationIntentKindTableCell = 11, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPresentationIntentTableColumnAlignment { + NSPresentationIntentTableColumnAlignmentLeft = 0, + NSPresentationIntentTableColumnAlignmentCenter = 1, + NSPresentationIntentTableColumnAlignmentRight = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPresentationIntent; + + unsafe impl ClassType for NSPresentationIntent { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPresentationIntent { + #[method(intentKind)] + pub unsafe fn intentKind(&self) -> NSPresentationIntentKind; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other parentIntent)] + pub unsafe fn parentIntent(&self) -> Option>; + + #[method_id(@__retain_semantics Other paragraphIntentWithIdentity:nestedInsideIntent:)] + pub unsafe fn paragraphIntentWithIdentity_nestedInsideIntent( + identity: NSInteger, + parent: Option<&NSPresentationIntent>, + ) -> Id; + + #[method_id(@__retain_semantics Other headerIntentWithIdentity:level:nestedInsideIntent:)] + pub unsafe fn headerIntentWithIdentity_level_nestedInsideIntent( + identity: NSInteger, + level: NSInteger, + parent: Option<&NSPresentationIntent>, + ) -> Id; + + #[method_id(@__retain_semantics Other codeBlockIntentWithIdentity:languageHint:nestedInsideIntent:)] + pub unsafe fn codeBlockIntentWithIdentity_languageHint_nestedInsideIntent( + identity: NSInteger, + languageHint: Option<&NSString>, + parent: Option<&NSPresentationIntent>, + ) -> Id; + + #[method_id(@__retain_semantics Other thematicBreakIntentWithIdentity:nestedInsideIntent:)] + pub unsafe fn thematicBreakIntentWithIdentity_nestedInsideIntent( + identity: NSInteger, + parent: Option<&NSPresentationIntent>, + ) -> Id; + + #[method_id(@__retain_semantics Other orderedListIntentWithIdentity:nestedInsideIntent:)] + pub unsafe fn orderedListIntentWithIdentity_nestedInsideIntent( + identity: NSInteger, + parent: Option<&NSPresentationIntent>, + ) -> Id; + + #[method_id(@__retain_semantics Other unorderedListIntentWithIdentity:nestedInsideIntent:)] + pub unsafe fn unorderedListIntentWithIdentity_nestedInsideIntent( + identity: NSInteger, + parent: Option<&NSPresentationIntent>, + ) -> Id; + + #[method_id(@__retain_semantics Other listItemIntentWithIdentity:ordinal:nestedInsideIntent:)] + pub unsafe fn listItemIntentWithIdentity_ordinal_nestedInsideIntent( + identity: NSInteger, + ordinal: NSInteger, + parent: Option<&NSPresentationIntent>, + ) -> Id; + + #[method_id(@__retain_semantics Other blockQuoteIntentWithIdentity:nestedInsideIntent:)] + pub unsafe fn blockQuoteIntentWithIdentity_nestedInsideIntent( + identity: NSInteger, + parent: Option<&NSPresentationIntent>, + ) -> Id; + + #[method_id(@__retain_semantics Other tableIntentWithIdentity:columnCount:alignments:nestedInsideIntent:)] + pub unsafe fn tableIntentWithIdentity_columnCount_alignments_nestedInsideIntent( + identity: NSInteger, + columnCount: NSInteger, + alignments: &NSArray, + parent: Option<&NSPresentationIntent>, + ) -> Id; + + #[method_id(@__retain_semantics Other tableHeaderRowIntentWithIdentity:nestedInsideIntent:)] + pub unsafe fn tableHeaderRowIntentWithIdentity_nestedInsideIntent( + identity: NSInteger, + parent: Option<&NSPresentationIntent>, + ) -> Id; + + #[method_id(@__retain_semantics Other tableRowIntentWithIdentity:row:nestedInsideIntent:)] + pub unsafe fn tableRowIntentWithIdentity_row_nestedInsideIntent( + identity: NSInteger, + row: NSInteger, + parent: Option<&NSPresentationIntent>, + ) -> Id; + + #[method_id(@__retain_semantics Other tableCellIntentWithIdentity:column:nestedInsideIntent:)] + pub unsafe fn tableCellIntentWithIdentity_column_nestedInsideIntent( + identity: NSInteger, + column: NSInteger, + parent: Option<&NSPresentationIntent>, + ) -> Id; + + #[method(identity)] + pub unsafe fn identity(&self) -> NSInteger; + + #[method(ordinal)] + pub unsafe fn ordinal(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other columnAlignments)] + pub unsafe fn columnAlignments(&self) -> Option, Shared>>; + + #[method(columnCount)] + pub unsafe fn columnCount(&self) -> NSInteger; + + #[method(headerLevel)] + pub unsafe fn headerLevel(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other languageHint)] + pub unsafe fn languageHint(&self) -> Option>; + + #[method(column)] + pub unsafe fn column(&self) -> NSInteger; + + #[method(row)] + pub unsafe fn row(&self) -> NSInteger; + + #[method(indentationLevel)] + pub unsafe fn indentationLevel(&self) -> NSInteger; + + #[method(isEquivalentToPresentationIntent:)] + pub unsafe fn isEquivalentToPresentationIntent(&self, other: &NSPresentationIntent) + -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSAutoreleasePool.rs b/crates/icrate/src/generated/Foundation/NSAutoreleasePool.rs new file mode 100644 index 000000000..f6a8ec6aa --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSAutoreleasePool.rs @@ -0,0 +1,20 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSAutoreleasePool; + + unsafe impl ClassType for NSAutoreleasePool { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAutoreleasePool { + #[method(drain)] + pub unsafe fn drain(&self); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSBackgroundActivityScheduler.rs b/crates/icrate/src/generated/Foundation/NSBackgroundActivityScheduler.rs new file mode 100644 index 000000000..5a4a447be --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSBackgroundActivityScheduler.rs @@ -0,0 +1,72 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSBackgroundActivityResult { + NSBackgroundActivityResultFinished = 1, + NSBackgroundActivityResultDeferred = 2, + } +); + +pub type NSBackgroundActivityCompletionHandler = *mut Block<(NSBackgroundActivityResult,), ()>; + +extern_class!( + #[derive(Debug)] + pub struct NSBackgroundActivityScheduler; + + unsafe impl ClassType for NSBackgroundActivityScheduler { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSBackgroundActivityScheduler { + #[method_id(@__retain_semantics Init initWithIdentifier:)] + pub unsafe fn initWithIdentifier( + this: Option>, + identifier: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Id; + + #[method(qualityOfService)] + pub unsafe fn qualityOfService(&self) -> NSQualityOfService; + + #[method(setQualityOfService:)] + pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService); + + #[method(repeats)] + pub unsafe fn repeats(&self) -> bool; + + #[method(setRepeats:)] + pub unsafe fn setRepeats(&self, repeats: bool); + + #[method(interval)] + pub unsafe fn interval(&self) -> NSTimeInterval; + + #[method(setInterval:)] + pub unsafe fn setInterval(&self, interval: NSTimeInterval); + + #[method(tolerance)] + pub unsafe fn tolerance(&self) -> NSTimeInterval; + + #[method(setTolerance:)] + pub unsafe fn setTolerance(&self, tolerance: NSTimeInterval); + + #[method(scheduleWithBlock:)] + pub unsafe fn scheduleWithBlock( + &self, + block: &Block<(NSBackgroundActivityCompletionHandler,), ()>, + ); + + #[method(invalidate)] + pub unsafe fn invalidate(&self); + + #[method(shouldDefer)] + pub unsafe fn shouldDefer(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSBundle.rs b/crates/icrate/src/generated/Foundation/NSBundle.rs new file mode 100644 index 000000000..45464fe36 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSBundle.rs @@ -0,0 +1,358 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSBundleExecutableArchitectureI386 = 0x00000007, + NSBundleExecutableArchitecturePPC = 0x00000012, + NSBundleExecutableArchitectureX86_64 = 0x01000007, + NSBundleExecutableArchitecturePPC64 = 0x01000012, + NSBundleExecutableArchitectureARM64 = 0x0100000c, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSBundle; + + unsafe impl ClassType for NSBundle { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSBundle { + #[method_id(@__retain_semantics Other mainBundle)] + pub unsafe fn mainBundle() -> Id; + + #[method_id(@__retain_semantics Other bundleWithPath:)] + pub unsafe fn bundleWithPath(path: &NSString) -> Option>; + + #[method_id(@__retain_semantics Init initWithPath:)] + pub unsafe fn initWithPath( + this: Option>, + path: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other bundleWithURL:)] + pub unsafe fn bundleWithURL(url: &NSURL) -> Option>; + + #[method_id(@__retain_semantics Init initWithURL:)] + pub unsafe fn initWithURL( + this: Option>, + url: &NSURL, + ) -> Option>; + + #[method_id(@__retain_semantics Other bundleForClass:)] + pub unsafe fn bundleForClass(aClass: &Class) -> Id; + + #[method_id(@__retain_semantics Other bundleWithIdentifier:)] + pub unsafe fn bundleWithIdentifier(identifier: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other allBundles)] + pub unsafe fn allBundles() -> Id, Shared>; + + #[method_id(@__retain_semantics Other allFrameworks)] + pub unsafe fn allFrameworks() -> Id, Shared>; + + #[method(load)] + pub unsafe fn load(&self) -> bool; + + #[method(isLoaded)] + pub unsafe fn isLoaded(&self) -> bool; + + #[method(unload)] + pub unsafe fn unload(&self) -> bool; + + #[method(preflightAndReturnError:)] + pub unsafe fn preflightAndReturnError(&self) -> Result<(), Id>; + + #[method(loadAndReturnError:)] + pub unsafe fn loadAndReturnError(&self) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other bundleURL)] + pub unsafe fn bundleURL(&self) -> Id; + + #[method_id(@__retain_semantics Other resourceURL)] + pub unsafe fn resourceURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other executableURL)] + pub unsafe fn executableURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other URLForAuxiliaryExecutable:)] + pub unsafe fn URLForAuxiliaryExecutable( + &self, + executableName: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other privateFrameworksURL)] + pub unsafe fn privateFrameworksURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other sharedFrameworksURL)] + pub unsafe fn sharedFrameworksURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other sharedSupportURL)] + pub unsafe fn sharedSupportURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other builtInPlugInsURL)] + pub unsafe fn builtInPlugInsURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other appStoreReceiptURL)] + pub unsafe fn appStoreReceiptURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other bundlePath)] + pub unsafe fn bundlePath(&self) -> Id; + + #[method_id(@__retain_semantics Other resourcePath)] + pub unsafe fn resourcePath(&self) -> Option>; + + #[method_id(@__retain_semantics Other executablePath)] + pub unsafe fn executablePath(&self) -> Option>; + + #[method_id(@__retain_semantics Other pathForAuxiliaryExecutable:)] + pub unsafe fn pathForAuxiliaryExecutable( + &self, + executableName: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other privateFrameworksPath)] + pub unsafe fn privateFrameworksPath(&self) -> Option>; + + #[method_id(@__retain_semantics Other sharedFrameworksPath)] + pub unsafe fn sharedFrameworksPath(&self) -> Option>; + + #[method_id(@__retain_semantics Other sharedSupportPath)] + pub unsafe fn sharedSupportPath(&self) -> Option>; + + #[method_id(@__retain_semantics Other builtInPlugInsPath)] + pub unsafe fn builtInPlugInsPath(&self) -> Option>; + + #[method_id(@__retain_semantics Other URLForResource:withExtension:subdirectory:inBundleWithURL:)] + pub unsafe fn URLForResource_withExtension_subdirectory_inBundleWithURL( + name: Option<&NSString>, + ext: Option<&NSString>, + subpath: Option<&NSString>, + bundleURL: &NSURL, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLsForResourcesWithExtension:subdirectory:inBundleWithURL:)] + pub unsafe fn URLsForResourcesWithExtension_subdirectory_inBundleWithURL( + ext: Option<&NSString>, + subpath: Option<&NSString>, + bundleURL: &NSURL, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other URLForResource:withExtension:)] + pub unsafe fn URLForResource_withExtension( + &self, + name: Option<&NSString>, + ext: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLForResource:withExtension:subdirectory:)] + pub unsafe fn URLForResource_withExtension_subdirectory( + &self, + name: Option<&NSString>, + ext: Option<&NSString>, + subpath: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLForResource:withExtension:subdirectory:localization:)] + pub unsafe fn URLForResource_withExtension_subdirectory_localization( + &self, + name: Option<&NSString>, + ext: Option<&NSString>, + subpath: Option<&NSString>, + localizationName: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLsForResourcesWithExtension:subdirectory:)] + pub unsafe fn URLsForResourcesWithExtension_subdirectory( + &self, + ext: Option<&NSString>, + subpath: Option<&NSString>, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other URLsForResourcesWithExtension:subdirectory:localization:)] + pub unsafe fn URLsForResourcesWithExtension_subdirectory_localization( + &self, + ext: Option<&NSString>, + subpath: Option<&NSString>, + localizationName: Option<&NSString>, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other pathForResource:ofType:)] + pub unsafe fn pathForResource_ofType( + &self, + name: Option<&NSString>, + ext: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Other pathForResource:ofType:inDirectory:forLocalization:)] + pub unsafe fn pathForResource_ofType_inDirectory_forLocalization( + &self, + name: Option<&NSString>, + ext: Option<&NSString>, + subpath: Option<&NSString>, + localizationName: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Other pathsForResourcesOfType:inDirectory:forLocalization:)] + pub unsafe fn pathsForResourcesOfType_inDirectory_forLocalization( + &self, + ext: Option<&NSString>, + subpath: Option<&NSString>, + localizationName: Option<&NSString>, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other localizedStringForKey:value:table:)] + pub unsafe fn localizedStringForKey_value_table( + &self, + key: &NSString, + value: Option<&NSString>, + tableName: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Other bundleIdentifier)] + pub unsafe fn bundleIdentifier(&self) -> Option>; + + #[method_id(@__retain_semantics Other infoDictionary)] + pub unsafe fn infoDictionary(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other localizedInfoDictionary)] + pub unsafe fn localizedInfoDictionary( + &self, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other objectForInfoDictionaryKey:)] + pub unsafe fn objectForInfoDictionaryKey( + &self, + key: &NSString, + ) -> Option>; + + #[method(classNamed:)] + pub unsafe fn classNamed(&self, className: &NSString) -> Option<&'static Class>; + + #[method(principalClass)] + pub unsafe fn principalClass(&self) -> Option<&'static Class>; + + #[method_id(@__retain_semantics Other preferredLocalizations)] + pub unsafe fn preferredLocalizations(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other localizations)] + pub unsafe fn localizations(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other developmentLocalization)] + pub unsafe fn developmentLocalization(&self) -> Option>; + + #[method_id(@__retain_semantics Other preferredLocalizationsFromArray:)] + pub unsafe fn preferredLocalizationsFromArray( + localizationsArray: &NSArray, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other preferredLocalizationsFromArray:forPreferences:)] + pub unsafe fn preferredLocalizationsFromArray_forPreferences( + localizationsArray: &NSArray, + preferencesArray: Option<&NSArray>, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other executableArchitectures)] + pub unsafe fn executableArchitectures(&self) -> Option, Shared>>; + } +); + +extern_methods!( + /// NSBundleExtensionMethods + unsafe impl NSString { + #[method_id(@__retain_semantics Other variantFittingPresentationWidth:)] + pub unsafe fn variantFittingPresentationWidth( + &self, + width: NSInteger, + ) -> Id; + } +); + +extern_static!(NSBundleDidLoadNotification: &'static NSNotificationName); + +extern_static!(NSLoadedClasses: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSBundleResourceRequest; + + unsafe impl ClassType for NSBundleResourceRequest { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSBundleResourceRequest { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithTags:)] + pub unsafe fn initWithTags( + this: Option>, + tags: &NSSet, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithTags:bundle:)] + pub unsafe fn initWithTags_bundle( + this: Option>, + tags: &NSSet, + bundle: &NSBundle, + ) -> Id; + + #[method(loadingPriority)] + pub unsafe fn loadingPriority(&self) -> c_double; + + #[method(setLoadingPriority:)] + pub unsafe fn setLoadingPriority(&self, loadingPriority: c_double); + + #[method_id(@__retain_semantics Other tags)] + pub unsafe fn tags(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other bundle)] + pub unsafe fn bundle(&self) -> Id; + + #[method(beginAccessingResourcesWithCompletionHandler:)] + pub unsafe fn beginAccessingResourcesWithCompletionHandler( + &self, + completionHandler: &Block<(*mut NSError,), ()>, + ); + + #[method(conditionallyBeginAccessingResourcesWithCompletionHandler:)] + pub unsafe fn conditionallyBeginAccessingResourcesWithCompletionHandler( + &self, + completionHandler: &Block<(Bool,), ()>, + ); + + #[method(endAccessingResources)] + pub unsafe fn endAccessingResources(&self); + + #[method_id(@__retain_semantics Other progress)] + pub unsafe fn progress(&self) -> Id; + } +); + +extern_methods!( + /// NSBundleResourceRequestAdditions + unsafe impl NSBundle { + #[method(setPreservationPriority:forTags:)] + pub unsafe fn setPreservationPriority_forTags( + &self, + priority: c_double, + tags: &NSSet, + ); + + #[method(preservationPriorityForTag:)] + pub unsafe fn preservationPriorityForTag(&self, tag: &NSString) -> c_double; + } +); + +extern_static!(NSBundleResourceRequestLowDiskSpaceNotification: &'static NSNotificationName); + +extern_static!(NSBundleResourceRequestLoadingPriorityUrgent: c_double); diff --git a/crates/icrate/src/generated/Foundation/NSByteCountFormatter.rs b/crates/icrate/src/generated/Foundation/NSByteCountFormatter.rs new file mode 100644 index 000000000..5cb4eb185 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSByteCountFormatter.rs @@ -0,0 +1,125 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSByteCountFormatterUnits { + NSByteCountFormatterUseDefault = 0, + NSByteCountFormatterUseBytes = 1 << 0, + NSByteCountFormatterUseKB = 1 << 1, + NSByteCountFormatterUseMB = 1 << 2, + NSByteCountFormatterUseGB = 1 << 3, + NSByteCountFormatterUseTB = 1 << 4, + NSByteCountFormatterUsePB = 1 << 5, + NSByteCountFormatterUseEB = 1 << 6, + NSByteCountFormatterUseZB = 1 << 7, + NSByteCountFormatterUseYBOrHigher = 0x0FF << 8, + NSByteCountFormatterUseAll = 0x0FFFF, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSByteCountFormatterCountStyle { + NSByteCountFormatterCountStyleFile = 0, + NSByteCountFormatterCountStyleMemory = 1, + NSByteCountFormatterCountStyleDecimal = 2, + NSByteCountFormatterCountStyleBinary = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSByteCountFormatter; + + unsafe impl ClassType for NSByteCountFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSByteCountFormatter { + #[method_id(@__retain_semantics Other stringFromByteCount:countStyle:)] + pub unsafe fn stringFromByteCount_countStyle( + byteCount: c_longlong, + countStyle: NSByteCountFormatterCountStyle, + ) -> Id; + + #[method_id(@__retain_semantics Other stringFromByteCount:)] + pub unsafe fn stringFromByteCount(&self, byteCount: c_longlong) -> Id; + + #[method_id(@__retain_semantics Other stringFromMeasurement:countStyle:)] + pub unsafe fn stringFromMeasurement_countStyle( + measurement: &NSMeasurement, + countStyle: NSByteCountFormatterCountStyle, + ) -> Id; + + #[method_id(@__retain_semantics Other stringFromMeasurement:)] + pub unsafe fn stringFromMeasurement( + &self, + measurement: &NSMeasurement, + ) -> Id; + + #[method_id(@__retain_semantics Other stringForObjectValue:)] + pub unsafe fn stringForObjectValue( + &self, + obj: Option<&Object>, + ) -> Option>; + + #[method(allowedUnits)] + pub unsafe fn allowedUnits(&self) -> NSByteCountFormatterUnits; + + #[method(setAllowedUnits:)] + pub unsafe fn setAllowedUnits(&self, allowedUnits: NSByteCountFormatterUnits); + + #[method(countStyle)] + pub unsafe fn countStyle(&self) -> NSByteCountFormatterCountStyle; + + #[method(setCountStyle:)] + pub unsafe fn setCountStyle(&self, countStyle: NSByteCountFormatterCountStyle); + + #[method(allowsNonnumericFormatting)] + pub unsafe fn allowsNonnumericFormatting(&self) -> bool; + + #[method(setAllowsNonnumericFormatting:)] + pub unsafe fn setAllowsNonnumericFormatting(&self, allowsNonnumericFormatting: bool); + + #[method(includesUnit)] + pub unsafe fn includesUnit(&self) -> bool; + + #[method(setIncludesUnit:)] + pub unsafe fn setIncludesUnit(&self, includesUnit: bool); + + #[method(includesCount)] + pub unsafe fn includesCount(&self) -> bool; + + #[method(setIncludesCount:)] + pub unsafe fn setIncludesCount(&self, includesCount: bool); + + #[method(includesActualByteCount)] + pub unsafe fn includesActualByteCount(&self) -> bool; + + #[method(setIncludesActualByteCount:)] + pub unsafe fn setIncludesActualByteCount(&self, includesActualByteCount: bool); + + #[method(isAdaptive)] + pub unsafe fn isAdaptive(&self) -> bool; + + #[method(setAdaptive:)] + pub unsafe fn setAdaptive(&self, adaptive: bool); + + #[method(zeroPadsFractionDigits)] + pub unsafe fn zeroPadsFractionDigits(&self) -> bool; + + #[method(setZeroPadsFractionDigits:)] + pub unsafe fn setZeroPadsFractionDigits(&self, zeroPadsFractionDigits: bool); + + #[method(formattingContext)] + pub unsafe fn formattingContext(&self) -> NSFormattingContext; + + #[method(setFormattingContext:)] + pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSByteOrder.rs b/crates/icrate/src/generated/Foundation/NSByteOrder.rs new file mode 100644 index 000000000..c0f5ecf18 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSByteOrder.rs @@ -0,0 +1,232 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_enum!( + #[underlying(c_uint)] + pub enum { + } +); + +inline_fn!( + pub unsafe fn NSHostByteOrder() -> c_long { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapShort(inv: c_ushort) -> c_ushort { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapInt(inv: c_uint) -> c_uint { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapLong(inv: c_ulong) -> c_ulong { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapLongLong(inv: c_ulonglong) -> c_ulonglong { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapBigShortToHost(x: c_ushort) -> c_ushort { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapBigIntToHost(x: c_uint) -> c_uint { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapBigLongToHost(x: c_ulong) -> c_ulong { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapBigLongLongToHost(x: c_ulonglong) -> c_ulonglong { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapHostShortToBig(x: c_ushort) -> c_ushort { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapHostIntToBig(x: c_uint) -> c_uint { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapHostLongToBig(x: c_ulong) -> c_ulong { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapHostLongLongToBig(x: c_ulonglong) -> c_ulonglong { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapLittleShortToHost(x: c_ushort) -> c_ushort { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapLittleIntToHost(x: c_uint) -> c_uint { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapLittleLongToHost(x: c_ulong) -> c_ulong { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapLittleLongLongToHost(x: c_ulonglong) -> c_ulonglong { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapHostShortToLittle(x: c_ushort) -> c_ushort { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapHostIntToLittle(x: c_uint) -> c_uint { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapHostLongToLittle(x: c_ulong) -> c_ulong { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapHostLongLongToLittle(x: c_ulonglong) -> c_ulonglong { + todo!() + } +); + +extern_struct!( + pub struct NSSwappedFloat { + pub v: c_uint, + } +); + +extern_struct!( + pub struct NSSwappedDouble { + pub v: c_ulonglong, + } +); + +inline_fn!( + pub unsafe fn NSConvertHostFloatToSwapped(x: c_float) -> NSSwappedFloat { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSConvertSwappedFloatToHost(x: NSSwappedFloat) -> c_float { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSConvertHostDoubleToSwapped(x: c_double) -> NSSwappedDouble { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSConvertSwappedDoubleToHost(x: NSSwappedDouble) -> c_double { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapFloat(x: NSSwappedFloat) -> NSSwappedFloat { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapDouble(x: NSSwappedDouble) -> NSSwappedDouble { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapBigDoubleToHost(x: NSSwappedDouble) -> c_double { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapBigFloatToHost(x: NSSwappedFloat) -> c_float { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapHostDoubleToBig(x: c_double) -> NSSwappedDouble { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapHostFloatToBig(x: c_float) -> NSSwappedFloat { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapLittleDoubleToHost(x: NSSwappedDouble) -> c_double { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapLittleFloatToHost(x: NSSwappedFloat) -> c_float { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapHostDoubleToLittle(x: c_double) -> NSSwappedDouble { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSwapHostFloatToLittle(x: c_float) -> NSSwappedFloat { + todo!() + } +); diff --git a/crates/icrate/src/generated/Foundation/NSCache.rs b/crates/icrate/src/generated/Foundation/NSCache.rs new file mode 100644 index 000000000..f5a17279a --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSCache.rs @@ -0,0 +1,78 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSCache { + _inner0: PhantomData<*mut KeyType>, + _inner1: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSCache { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCache { + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method(setName:)] + pub unsafe fn setName(&self, name: &NSString); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSCacheDelegate>); + + #[method_id(@__retain_semantics Other objectForKey:)] + pub unsafe fn objectForKey(&self, key: &KeyType) -> Option>; + + #[method(setObject:forKey:)] + pub unsafe fn setObject_forKey(&self, obj: &ObjectType, key: &KeyType); + + #[method(setObject:forKey:cost:)] + pub unsafe fn setObject_forKey_cost(&self, obj: &ObjectType, key: &KeyType, g: NSUInteger); + + #[method(removeObjectForKey:)] + pub unsafe fn removeObjectForKey(&self, key: &KeyType); + + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + + #[method(totalCostLimit)] + pub unsafe fn totalCostLimit(&self) -> NSUInteger; + + #[method(setTotalCostLimit:)] + pub unsafe fn setTotalCostLimit(&self, totalCostLimit: NSUInteger); + + #[method(countLimit)] + pub unsafe fn countLimit(&self) -> NSUInteger; + + #[method(setCountLimit:)] + pub unsafe fn setCountLimit(&self, countLimit: NSUInteger); + + #[method(evictsObjectsWithDiscardedContent)] + pub unsafe fn evictsObjectsWithDiscardedContent(&self) -> bool; + + #[method(setEvictsObjectsWithDiscardedContent:)] + pub unsafe fn setEvictsObjectsWithDiscardedContent( + &self, + evictsObjectsWithDiscardedContent: bool, + ); + } +); + +extern_protocol!( + pub struct NSCacheDelegate; + + unsafe impl NSCacheDelegate { + #[optional] + #[method(cache:willEvictObject:)] + pub unsafe fn cache_willEvictObject(&self, cache: &NSCache, obj: &Object); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSCalendar.rs b/crates/icrate/src/generated/Foundation/NSCalendar.rs new file mode 100644 index 000000000..dfeeaff96 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSCalendar.rs @@ -0,0 +1,620 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSCalendarIdentifier = NSString; + +extern_static!(NSCalendarIdentifierGregorian: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierBuddhist: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierChinese: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierCoptic: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierEthiopicAmeteMihret: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierEthiopicAmeteAlem: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierHebrew: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierISO8601: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierIndian: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierIslamic: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierIslamicCivil: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierJapanese: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierPersian: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierRepublicOfChina: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierIslamicTabular: &'static NSCalendarIdentifier); + +extern_static!(NSCalendarIdentifierIslamicUmmAlQura: &'static NSCalendarIdentifier); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSCalendarUnit { + NSCalendarUnitEra = 2, + NSCalendarUnitYear = 4, + NSCalendarUnitMonth = 8, + NSCalendarUnitDay = 16, + NSCalendarUnitHour = 32, + NSCalendarUnitMinute = 64, + NSCalendarUnitSecond = 128, + NSCalendarUnitWeekday = 512, + NSCalendarUnitWeekdayOrdinal = 1024, + NSCalendarUnitQuarter = 2048, + NSCalendarUnitWeekOfMonth = 4096, + NSCalendarUnitWeekOfYear = 8192, + NSCalendarUnitYearForWeekOfYear = 16384, + NSCalendarUnitNanosecond = 32768, + NSCalendarUnitCalendar = 1048576, + NSCalendarUnitTimeZone = 2097152, + NSEraCalendarUnit = 2, + NSYearCalendarUnit = 4, + NSMonthCalendarUnit = 8, + NSDayCalendarUnit = 16, + NSHourCalendarUnit = 32, + NSMinuteCalendarUnit = 64, + NSSecondCalendarUnit = 128, + NSWeekCalendarUnit = 256, + NSWeekdayCalendarUnit = 512, + NSWeekdayOrdinalCalendarUnit = 1024, + NSQuarterCalendarUnit = 2048, + NSWeekOfMonthCalendarUnit = 4096, + NSWeekOfYearCalendarUnit = 8192, + NSYearForWeekOfYearCalendarUnit = 16384, + NSCalendarCalendarUnit = 1048576, + NSTimeZoneCalendarUnit = 2097152, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSCalendarOptions { + NSCalendarWrapComponents = 1 << 0, + NSCalendarMatchStrictly = 1 << 1, + NSCalendarSearchBackwards = 1 << 2, + NSCalendarMatchPreviousTimePreservingSmallerUnits = 1 << 8, + NSCalendarMatchNextTimePreservingSmallerUnits = 1 << 9, + NSCalendarMatchNextTime = 1 << 10, + NSCalendarMatchFirst = 1 << 12, + NSCalendarMatchLast = 1 << 13, + } +); + +extern_enum!( + #[underlying(c_uint)] + pub enum { + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCalendar; + + unsafe impl ClassType for NSCalendar { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCalendar { + #[method_id(@__retain_semantics Other currentCalendar)] + pub unsafe fn currentCalendar() -> Id; + + #[method_id(@__retain_semantics Other autoupdatingCurrentCalendar)] + pub unsafe fn autoupdatingCurrentCalendar() -> Id; + + #[method_id(@__retain_semantics Other calendarWithIdentifier:)] + pub unsafe fn calendarWithIdentifier( + calendarIdentifierConstant: &NSCalendarIdentifier, + ) -> Option>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCalendarIdentifier:)] + pub unsafe fn initWithCalendarIdentifier( + this: Option>, + ident: &NSCalendarIdentifier, + ) -> Option>; + + #[method_id(@__retain_semantics Other calendarIdentifier)] + pub unsafe fn calendarIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Other locale)] + pub unsafe fn locale(&self) -> Option>; + + #[method(setLocale:)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + + #[method_id(@__retain_semantics Other timeZone)] + pub unsafe fn timeZone(&self) -> Id; + + #[method(setTimeZone:)] + pub unsafe fn setTimeZone(&self, timeZone: &NSTimeZone); + + #[method(firstWeekday)] + pub unsafe fn firstWeekday(&self) -> NSUInteger; + + #[method(setFirstWeekday:)] + pub unsafe fn setFirstWeekday(&self, firstWeekday: NSUInteger); + + #[method(minimumDaysInFirstWeek)] + pub unsafe fn minimumDaysInFirstWeek(&self) -> NSUInteger; + + #[method(setMinimumDaysInFirstWeek:)] + pub unsafe fn setMinimumDaysInFirstWeek(&self, minimumDaysInFirstWeek: NSUInteger); + + #[method_id(@__retain_semantics Other eraSymbols)] + pub unsafe fn eraSymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other longEraSymbols)] + pub unsafe fn longEraSymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other monthSymbols)] + pub unsafe fn monthSymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other shortMonthSymbols)] + pub unsafe fn shortMonthSymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other veryShortMonthSymbols)] + pub unsafe fn veryShortMonthSymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other standaloneMonthSymbols)] + pub unsafe fn standaloneMonthSymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other shortStandaloneMonthSymbols)] + pub unsafe fn shortStandaloneMonthSymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other veryShortStandaloneMonthSymbols)] + pub unsafe fn veryShortStandaloneMonthSymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other weekdaySymbols)] + pub unsafe fn weekdaySymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other shortWeekdaySymbols)] + pub unsafe fn shortWeekdaySymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other veryShortWeekdaySymbols)] + pub unsafe fn veryShortWeekdaySymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other standaloneWeekdaySymbols)] + pub unsafe fn standaloneWeekdaySymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other shortStandaloneWeekdaySymbols)] + pub unsafe fn shortStandaloneWeekdaySymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other veryShortStandaloneWeekdaySymbols)] + pub unsafe fn veryShortStandaloneWeekdaySymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other quarterSymbols)] + pub unsafe fn quarterSymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other shortQuarterSymbols)] + pub unsafe fn shortQuarterSymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other standaloneQuarterSymbols)] + pub unsafe fn standaloneQuarterSymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other shortStandaloneQuarterSymbols)] + pub unsafe fn shortStandaloneQuarterSymbols(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other AMSymbol)] + pub unsafe fn AMSymbol(&self) -> Id; + + #[method_id(@__retain_semantics Other PMSymbol)] + pub unsafe fn PMSymbol(&self) -> Id; + + #[method(minimumRangeOfUnit:)] + pub unsafe fn minimumRangeOfUnit(&self, unit: NSCalendarUnit) -> NSRange; + + #[method(maximumRangeOfUnit:)] + pub unsafe fn maximumRangeOfUnit(&self, unit: NSCalendarUnit) -> NSRange; + + #[method(rangeOfUnit:inUnit:forDate:)] + pub unsafe fn rangeOfUnit_inUnit_forDate( + &self, + smaller: NSCalendarUnit, + larger: NSCalendarUnit, + date: &NSDate, + ) -> NSRange; + + #[method(ordinalityOfUnit:inUnit:forDate:)] + pub unsafe fn ordinalityOfUnit_inUnit_forDate( + &self, + smaller: NSCalendarUnit, + larger: NSCalendarUnit, + date: &NSDate, + ) -> NSUInteger; + + #[method(rangeOfUnit:startDate:interval:forDate:)] + pub unsafe fn rangeOfUnit_startDate_interval_forDate( + &self, + unit: NSCalendarUnit, + datep: *mut *mut NSDate, + tip: *mut NSTimeInterval, + date: &NSDate, + ) -> bool; + + #[method_id(@__retain_semantics Other dateFromComponents:)] + pub unsafe fn dateFromComponents( + &self, + comps: &NSDateComponents, + ) -> Option>; + + #[method_id(@__retain_semantics Other components:fromDate:)] + pub unsafe fn components_fromDate( + &self, + unitFlags: NSCalendarUnit, + date: &NSDate, + ) -> Id; + + #[method_id(@__retain_semantics Other dateByAddingComponents:toDate:options:)] + pub unsafe fn dateByAddingComponents_toDate_options( + &self, + comps: &NSDateComponents, + date: &NSDate, + opts: NSCalendarOptions, + ) -> Option>; + + #[method_id(@__retain_semantics Other components:fromDate:toDate:options:)] + pub unsafe fn components_fromDate_toDate_options( + &self, + unitFlags: NSCalendarUnit, + startingDate: &NSDate, + resultDate: &NSDate, + opts: NSCalendarOptions, + ) -> Id; + + #[method(getEra:year:month:day:fromDate:)] + pub unsafe fn getEra_year_month_day_fromDate( + &self, + eraValuePointer: *mut NSInteger, + yearValuePointer: *mut NSInteger, + monthValuePointer: *mut NSInteger, + dayValuePointer: *mut NSInteger, + date: &NSDate, + ); + + #[method(getEra:yearForWeekOfYear:weekOfYear:weekday:fromDate:)] + pub unsafe fn getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate( + &self, + eraValuePointer: *mut NSInteger, + yearValuePointer: *mut NSInteger, + weekValuePointer: *mut NSInteger, + weekdayValuePointer: *mut NSInteger, + date: &NSDate, + ); + + #[method(getHour:minute:second:nanosecond:fromDate:)] + pub unsafe fn getHour_minute_second_nanosecond_fromDate( + &self, + hourValuePointer: *mut NSInteger, + minuteValuePointer: *mut NSInteger, + secondValuePointer: *mut NSInteger, + nanosecondValuePointer: *mut NSInteger, + date: &NSDate, + ); + + #[method(component:fromDate:)] + pub unsafe fn component_fromDate(&self, unit: NSCalendarUnit, date: &NSDate) -> NSInteger; + + #[method_id(@__retain_semantics Other dateWithEra:year:month:day:hour:minute:second:nanosecond:)] + pub unsafe fn dateWithEra_year_month_day_hour_minute_second_nanosecond( + &self, + eraValue: NSInteger, + yearValue: NSInteger, + monthValue: NSInteger, + dayValue: NSInteger, + hourValue: NSInteger, + minuteValue: NSInteger, + secondValue: NSInteger, + nanosecondValue: NSInteger, + ) -> Option>; + + #[method_id(@__retain_semantics Other dateWithEra:yearForWeekOfYear:weekOfYear:weekday:hour:minute:second:nanosecond:)] + pub unsafe fn dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond( + &self, + eraValue: NSInteger, + yearValue: NSInteger, + weekValue: NSInteger, + weekdayValue: NSInteger, + hourValue: NSInteger, + minuteValue: NSInteger, + secondValue: NSInteger, + nanosecondValue: NSInteger, + ) -> Option>; + + #[method_id(@__retain_semantics Other startOfDayForDate:)] + pub unsafe fn startOfDayForDate(&self, date: &NSDate) -> Id; + + #[method_id(@__retain_semantics Other componentsInTimeZone:fromDate:)] + pub unsafe fn componentsInTimeZone_fromDate( + &self, + timezone: &NSTimeZone, + date: &NSDate, + ) -> Id; + + #[method(compareDate:toDate:toUnitGranularity:)] + pub unsafe fn compareDate_toDate_toUnitGranularity( + &self, + date1: &NSDate, + date2: &NSDate, + unit: NSCalendarUnit, + ) -> NSComparisonResult; + + #[method(isDate:equalToDate:toUnitGranularity:)] + pub unsafe fn isDate_equalToDate_toUnitGranularity( + &self, + date1: &NSDate, + date2: &NSDate, + unit: NSCalendarUnit, + ) -> bool; + + #[method(isDate:inSameDayAsDate:)] + pub unsafe fn isDate_inSameDayAsDate(&self, date1: &NSDate, date2: &NSDate) -> bool; + + #[method(isDateInToday:)] + pub unsafe fn isDateInToday(&self, date: &NSDate) -> bool; + + #[method(isDateInYesterday:)] + pub unsafe fn isDateInYesterday(&self, date: &NSDate) -> bool; + + #[method(isDateInTomorrow:)] + pub unsafe fn isDateInTomorrow(&self, date: &NSDate) -> bool; + + #[method(isDateInWeekend:)] + pub unsafe fn isDateInWeekend(&self, date: &NSDate) -> bool; + + #[method(rangeOfWeekendStartDate:interval:containingDate:)] + pub unsafe fn rangeOfWeekendStartDate_interval_containingDate( + &self, + datep: *mut *mut NSDate, + tip: *mut NSTimeInterval, + date: &NSDate, + ) -> bool; + + #[method(nextWeekendStartDate:interval:options:afterDate:)] + pub unsafe fn nextWeekendStartDate_interval_options_afterDate( + &self, + datep: *mut *mut NSDate, + tip: *mut NSTimeInterval, + options: NSCalendarOptions, + date: &NSDate, + ) -> bool; + + #[method_id(@__retain_semantics Other components:fromDateComponents:toDateComponents:options:)] + pub unsafe fn components_fromDateComponents_toDateComponents_options( + &self, + unitFlags: NSCalendarUnit, + startingDateComp: &NSDateComponents, + resultDateComp: &NSDateComponents, + options: NSCalendarOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other dateByAddingUnit:value:toDate:options:)] + pub unsafe fn dateByAddingUnit_value_toDate_options( + &self, + unit: NSCalendarUnit, + value: NSInteger, + date: &NSDate, + options: NSCalendarOptions, + ) -> Option>; + + #[method(enumerateDatesStartingAfterDate:matchingComponents:options:usingBlock:)] + pub unsafe fn enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock( + &self, + start: &NSDate, + comps: &NSDateComponents, + opts: NSCalendarOptions, + block: &Block<(*mut NSDate, Bool, NonNull), ()>, + ); + + #[method_id(@__retain_semantics Other nextDateAfterDate:matchingComponents:options:)] + pub unsafe fn nextDateAfterDate_matchingComponents_options( + &self, + date: &NSDate, + comps: &NSDateComponents, + options: NSCalendarOptions, + ) -> Option>; + + #[method_id(@__retain_semantics Other nextDateAfterDate:matchingUnit:value:options:)] + pub unsafe fn nextDateAfterDate_matchingUnit_value_options( + &self, + date: &NSDate, + unit: NSCalendarUnit, + value: NSInteger, + options: NSCalendarOptions, + ) -> Option>; + + #[method_id(@__retain_semantics Other nextDateAfterDate:matchingHour:minute:second:options:)] + pub unsafe fn nextDateAfterDate_matchingHour_minute_second_options( + &self, + date: &NSDate, + hourValue: NSInteger, + minuteValue: NSInteger, + secondValue: NSInteger, + options: NSCalendarOptions, + ) -> Option>; + + #[method_id(@__retain_semantics Other dateBySettingUnit:value:ofDate:options:)] + pub unsafe fn dateBySettingUnit_value_ofDate_options( + &self, + unit: NSCalendarUnit, + v: NSInteger, + date: &NSDate, + opts: NSCalendarOptions, + ) -> Option>; + + #[method_id(@__retain_semantics Other dateBySettingHour:minute:second:ofDate:options:)] + pub unsafe fn dateBySettingHour_minute_second_ofDate_options( + &self, + h: NSInteger, + m: NSInteger, + s: NSInteger, + date: &NSDate, + opts: NSCalendarOptions, + ) -> Option>; + + #[method(date:matchesComponents:)] + pub unsafe fn date_matchesComponents( + &self, + date: &NSDate, + components: &NSDateComponents, + ) -> bool; + } +); + +extern_static!(NSCalendarDayChangedNotification: &'static NSNotificationName); + +ns_enum!( + #[underlying(NSInteger)] + pub enum { + NSDateComponentUndefined = 9223372036854775807, + NSUndefinedDateComponent = NSDateComponentUndefined, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDateComponents; + + unsafe impl ClassType for NSDateComponents { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDateComponents { + #[method_id(@__retain_semantics Other calendar)] + pub unsafe fn calendar(&self) -> Option>; + + #[method(setCalendar:)] + pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>); + + #[method_id(@__retain_semantics Other timeZone)] + pub unsafe fn timeZone(&self) -> Option>; + + #[method(setTimeZone:)] + pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>); + + #[method(era)] + pub unsafe fn era(&self) -> NSInteger; + + #[method(setEra:)] + pub unsafe fn setEra(&self, era: NSInteger); + + #[method(year)] + pub unsafe fn year(&self) -> NSInteger; + + #[method(setYear:)] + pub unsafe fn setYear(&self, year: NSInteger); + + #[method(month)] + pub unsafe fn month(&self) -> NSInteger; + + #[method(setMonth:)] + pub unsafe fn setMonth(&self, month: NSInteger); + + #[method(day)] + pub unsafe fn day(&self) -> NSInteger; + + #[method(setDay:)] + pub unsafe fn setDay(&self, day: NSInteger); + + #[method(hour)] + pub unsafe fn hour(&self) -> NSInteger; + + #[method(setHour:)] + pub unsafe fn setHour(&self, hour: NSInteger); + + #[method(minute)] + pub unsafe fn minute(&self) -> NSInteger; + + #[method(setMinute:)] + pub unsafe fn setMinute(&self, minute: NSInteger); + + #[method(second)] + pub unsafe fn second(&self) -> NSInteger; + + #[method(setSecond:)] + pub unsafe fn setSecond(&self, second: NSInteger); + + #[method(nanosecond)] + pub unsafe fn nanosecond(&self) -> NSInteger; + + #[method(setNanosecond:)] + pub unsafe fn setNanosecond(&self, nanosecond: NSInteger); + + #[method(weekday)] + pub unsafe fn weekday(&self) -> NSInteger; + + #[method(setWeekday:)] + pub unsafe fn setWeekday(&self, weekday: NSInteger); + + #[method(weekdayOrdinal)] + pub unsafe fn weekdayOrdinal(&self) -> NSInteger; + + #[method(setWeekdayOrdinal:)] + pub unsafe fn setWeekdayOrdinal(&self, weekdayOrdinal: NSInteger); + + #[method(quarter)] + pub unsafe fn quarter(&self) -> NSInteger; + + #[method(setQuarter:)] + pub unsafe fn setQuarter(&self, quarter: NSInteger); + + #[method(weekOfMonth)] + pub unsafe fn weekOfMonth(&self) -> NSInteger; + + #[method(setWeekOfMonth:)] + pub unsafe fn setWeekOfMonth(&self, weekOfMonth: NSInteger); + + #[method(weekOfYear)] + pub unsafe fn weekOfYear(&self) -> NSInteger; + + #[method(setWeekOfYear:)] + pub unsafe fn setWeekOfYear(&self, weekOfYear: NSInteger); + + #[method(yearForWeekOfYear)] + pub unsafe fn yearForWeekOfYear(&self) -> NSInteger; + + #[method(setYearForWeekOfYear:)] + pub unsafe fn setYearForWeekOfYear(&self, yearForWeekOfYear: NSInteger); + + #[method(isLeapMonth)] + pub unsafe fn isLeapMonth(&self) -> bool; + + #[method(setLeapMonth:)] + pub unsafe fn setLeapMonth(&self, leapMonth: bool); + + #[method_id(@__retain_semantics Other date)] + pub unsafe fn date(&self) -> Option>; + + #[method(week)] + pub unsafe fn week(&self) -> NSInteger; + + #[method(setWeek:)] + pub unsafe fn setWeek(&self, v: NSInteger); + + #[method(setValue:forComponent:)] + pub unsafe fn setValue_forComponent(&self, value: NSInteger, unit: NSCalendarUnit); + + #[method(valueForComponent:)] + pub unsafe fn valueForComponent(&self, unit: NSCalendarUnit) -> NSInteger; + + #[method(isValidDate)] + pub unsafe fn isValidDate(&self) -> bool; + + #[method(isValidDateInCalendar:)] + pub unsafe fn isValidDateInCalendar(&self, calendar: &NSCalendar) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSCalendarDate.rs b/crates/icrate/src/generated/Foundation/NSCalendarDate.rs new file mode 100644 index 000000000..ed10e2dc9 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSCalendarDate.rs @@ -0,0 +1,202 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSCalendarDate; + + unsafe impl ClassType for NSCalendarDate { + type Super = NSDate; + } +); + +extern_methods!( + unsafe impl NSCalendarDate { + #[method_id(@__retain_semantics Other calendarDate)] + pub unsafe fn calendarDate() -> Id; + + #[method_id(@__retain_semantics Other dateWithString:calendarFormat:locale:)] + pub unsafe fn dateWithString_calendarFormat_locale( + description: &NSString, + format: &NSString, + locale: Option<&Object>, + ) -> Option>; + + #[method_id(@__retain_semantics Other dateWithString:calendarFormat:)] + pub unsafe fn dateWithString_calendarFormat( + description: &NSString, + format: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other dateWithYear:month:day:hour:minute:second:timeZone:)] + pub unsafe fn dateWithYear_month_day_hour_minute_second_timeZone( + year: NSInteger, + month: NSUInteger, + day: NSUInteger, + hour: NSUInteger, + minute: NSUInteger, + second: NSUInteger, + aTimeZone: Option<&NSTimeZone>, + ) -> Id; + + #[method_id(@__retain_semantics Other dateByAddingYears:months:days:hours:minutes:seconds:)] + pub unsafe fn dateByAddingYears_months_days_hours_minutes_seconds( + &self, + year: NSInteger, + month: NSInteger, + day: NSInteger, + hour: NSInteger, + minute: NSInteger, + second: NSInteger, + ) -> Id; + + #[method(dayOfCommonEra)] + pub unsafe fn dayOfCommonEra(&self) -> NSInteger; + + #[method(dayOfMonth)] + pub unsafe fn dayOfMonth(&self) -> NSInteger; + + #[method(dayOfWeek)] + pub unsafe fn dayOfWeek(&self) -> NSInteger; + + #[method(dayOfYear)] + pub unsafe fn dayOfYear(&self) -> NSInteger; + + #[method(hourOfDay)] + pub unsafe fn hourOfDay(&self) -> NSInteger; + + #[method(minuteOfHour)] + pub unsafe fn minuteOfHour(&self) -> NSInteger; + + #[method(monthOfYear)] + pub unsafe fn monthOfYear(&self) -> NSInteger; + + #[method(secondOfMinute)] + pub unsafe fn secondOfMinute(&self) -> NSInteger; + + #[method(yearOfCommonEra)] + pub unsafe fn yearOfCommonEra(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other calendarFormat)] + pub unsafe fn calendarFormat(&self) -> Id; + + #[method_id(@__retain_semantics Other descriptionWithCalendarFormat:locale:)] + pub unsafe fn descriptionWithCalendarFormat_locale( + &self, + format: &NSString, + locale: Option<&Object>, + ) -> Id; + + #[method_id(@__retain_semantics Other descriptionWithCalendarFormat:)] + pub unsafe fn descriptionWithCalendarFormat( + &self, + format: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other descriptionWithLocale:)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + + #[method_id(@__retain_semantics Other timeZone)] + pub unsafe fn timeZone(&self) -> Id; + + #[method_id(@__retain_semantics Init initWithString:calendarFormat:locale:)] + pub unsafe fn initWithString_calendarFormat_locale( + this: Option>, + description: &NSString, + format: &NSString, + locale: Option<&Object>, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithString:calendarFormat:)] + pub unsafe fn initWithString_calendarFormat( + this: Option>, + description: &NSString, + format: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithString:)] + pub unsafe fn initWithString( + this: Option>, + description: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithYear:month:day:hour:minute:second:timeZone:)] + pub unsafe fn initWithYear_month_day_hour_minute_second_timeZone( + this: Option>, + year: NSInteger, + month: NSUInteger, + day: NSUInteger, + hour: NSUInteger, + minute: NSUInteger, + second: NSUInteger, + aTimeZone: Option<&NSTimeZone>, + ) -> Id; + + #[method(setCalendarFormat:)] + pub unsafe fn setCalendarFormat(&self, format: Option<&NSString>); + + #[method(setTimeZone:)] + pub unsafe fn setTimeZone(&self, aTimeZone: Option<&NSTimeZone>); + + #[method(years:months:days:hours:minutes:seconds:sinceDate:)] + pub unsafe fn years_months_days_hours_minutes_seconds_sinceDate( + &self, + yp: *mut NSInteger, + mop: *mut NSInteger, + dp: *mut NSInteger, + hp: *mut NSInteger, + mip: *mut NSInteger, + sp: *mut NSInteger, + date: &NSCalendarDate, + ); + + #[method_id(@__retain_semantics Other distantFuture)] + pub unsafe fn distantFuture() -> Id; + + #[method_id(@__retain_semantics Other distantPast)] + pub unsafe fn distantPast() -> Id; + } +); + +extern_methods!( + /// NSCalendarDateExtras + unsafe impl NSDate { + #[method_id(@__retain_semantics Other dateWithNaturalLanguageString:locale:)] + pub unsafe fn dateWithNaturalLanguageString_locale( + string: &NSString, + locale: Option<&Object>, + ) -> Option>; + + #[method_id(@__retain_semantics Other dateWithNaturalLanguageString:)] + pub unsafe fn dateWithNaturalLanguageString( + string: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other dateWithString:)] + pub unsafe fn dateWithString(aString: &NSString) -> Id; + + #[method_id(@__retain_semantics Other dateWithCalendarFormat:timeZone:)] + pub unsafe fn dateWithCalendarFormat_timeZone( + &self, + format: Option<&NSString>, + aTimeZone: Option<&NSTimeZone>, + ) -> Id; + + #[method_id(@__retain_semantics Other descriptionWithCalendarFormat:timeZone:locale:)] + pub unsafe fn descriptionWithCalendarFormat_timeZone_locale( + &self, + format: Option<&NSString>, + aTimeZone: Option<&NSTimeZone>, + locale: Option<&Object>, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithString:)] + pub unsafe fn initWithString( + this: Option>, + description: &NSString, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSCharacterSet.rs b/crates/icrate/src/generated/Foundation/NSCharacterSet.rs new file mode 100644 index 000000000..c40fe4c10 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSCharacterSet.rs @@ -0,0 +1,208 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSOpenStepUnicodeReservedBase = 0xF400, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCharacterSet; + + unsafe impl ClassType for NSCharacterSet { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCharacterSet { + #[method_id(@__retain_semantics Other controlCharacterSet)] + pub unsafe fn controlCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other whitespaceCharacterSet)] + pub unsafe fn whitespaceCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other whitespaceAndNewlineCharacterSet)] + pub unsafe fn whitespaceAndNewlineCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other decimalDigitCharacterSet)] + pub unsafe fn decimalDigitCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other letterCharacterSet)] + pub unsafe fn letterCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other lowercaseLetterCharacterSet)] + pub unsafe fn lowercaseLetterCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other uppercaseLetterCharacterSet)] + pub unsafe fn uppercaseLetterCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other nonBaseCharacterSet)] + pub unsafe fn nonBaseCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other alphanumericCharacterSet)] + pub unsafe fn alphanumericCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other decomposableCharacterSet)] + pub unsafe fn decomposableCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other illegalCharacterSet)] + pub unsafe fn illegalCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other punctuationCharacterSet)] + pub unsafe fn punctuationCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other capitalizedLetterCharacterSet)] + pub unsafe fn capitalizedLetterCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other symbolCharacterSet)] + pub unsafe fn symbolCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other newlineCharacterSet)] + pub unsafe fn newlineCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other characterSetWithRange:)] + pub unsafe fn characterSetWithRange(aRange: NSRange) -> Id; + + #[method_id(@__retain_semantics Other characterSetWithCharactersInString:)] + pub unsafe fn characterSetWithCharactersInString( + aString: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other characterSetWithBitmapRepresentation:)] + pub unsafe fn characterSetWithBitmapRepresentation( + data: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Other characterSetWithContentsOfFile:)] + pub unsafe fn characterSetWithContentsOfFile( + fName: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method(characterIsMember:)] + pub unsafe fn characterIsMember(&self, aCharacter: unichar) -> bool; + + #[method_id(@__retain_semantics Other bitmapRepresentation)] + pub unsafe fn bitmapRepresentation(&self) -> Id; + + #[method_id(@__retain_semantics Other invertedSet)] + pub unsafe fn invertedSet(&self) -> Id; + + #[method(longCharacterIsMember:)] + pub unsafe fn longCharacterIsMember(&self, theLongChar: UTF32Char) -> bool; + + #[method(isSupersetOfSet:)] + pub unsafe fn isSupersetOfSet(&self, theOtherSet: &NSCharacterSet) -> bool; + + #[method(hasMemberInPlane:)] + pub unsafe fn hasMemberInPlane(&self, thePlane: u8) -> bool; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMutableCharacterSet; + + unsafe impl ClassType for NSMutableCharacterSet { + type Super = NSCharacterSet; + } +); + +extern_methods!( + unsafe impl NSMutableCharacterSet { + #[method(addCharactersInRange:)] + pub unsafe fn addCharactersInRange(&self, aRange: NSRange); + + #[method(removeCharactersInRange:)] + pub unsafe fn removeCharactersInRange(&self, aRange: NSRange); + + #[method(addCharactersInString:)] + pub unsafe fn addCharactersInString(&self, aString: &NSString); + + #[method(removeCharactersInString:)] + pub unsafe fn removeCharactersInString(&self, aString: &NSString); + + #[method(formUnionWithCharacterSet:)] + pub unsafe fn formUnionWithCharacterSet(&self, otherSet: &NSCharacterSet); + + #[method(formIntersectionWithCharacterSet:)] + pub unsafe fn formIntersectionWithCharacterSet(&self, otherSet: &NSCharacterSet); + + #[method(invert)] + pub unsafe fn invert(&self); + + #[method_id(@__retain_semantics Other controlCharacterSet)] + pub unsafe fn controlCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other whitespaceCharacterSet)] + pub unsafe fn whitespaceCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other whitespaceAndNewlineCharacterSet)] + pub unsafe fn whitespaceAndNewlineCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other decimalDigitCharacterSet)] + pub unsafe fn decimalDigitCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other letterCharacterSet)] + pub unsafe fn letterCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other lowercaseLetterCharacterSet)] + pub unsafe fn lowercaseLetterCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other uppercaseLetterCharacterSet)] + pub unsafe fn uppercaseLetterCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other nonBaseCharacterSet)] + pub unsafe fn nonBaseCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other alphanumericCharacterSet)] + pub unsafe fn alphanumericCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other decomposableCharacterSet)] + pub unsafe fn decomposableCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other illegalCharacterSet)] + pub unsafe fn illegalCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other punctuationCharacterSet)] + pub unsafe fn punctuationCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other capitalizedLetterCharacterSet)] + pub unsafe fn capitalizedLetterCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other symbolCharacterSet)] + pub unsafe fn symbolCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other newlineCharacterSet)] + pub unsafe fn newlineCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other characterSetWithRange:)] + pub unsafe fn characterSetWithRange(aRange: NSRange) -> Id; + + #[method_id(@__retain_semantics Other characterSetWithCharactersInString:)] + pub unsafe fn characterSetWithCharactersInString( + aString: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other characterSetWithBitmapRepresentation:)] + pub unsafe fn characterSetWithBitmapRepresentation( + data: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Other characterSetWithContentsOfFile:)] + pub unsafe fn characterSetWithContentsOfFile( + fName: &NSString, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSClassDescription.rs b/crates/icrate/src/generated/Foundation/NSClassDescription.rs new file mode 100644 index 000000000..b0cbba71d --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSClassDescription.rs @@ -0,0 +1,71 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSClassDescription; + + unsafe impl ClassType for NSClassDescription { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSClassDescription { + #[method(registerClassDescription:forClass:)] + pub unsafe fn registerClassDescription_forClass( + description: &NSClassDescription, + aClass: &Class, + ); + + #[method(invalidateClassDescriptionCache)] + pub unsafe fn invalidateClassDescriptionCache(); + + #[method_id(@__retain_semantics Other classDescriptionForClass:)] + pub unsafe fn classDescriptionForClass( + aClass: &Class, + ) -> Option>; + + #[method_id(@__retain_semantics Other attributeKeys)] + pub unsafe fn attributeKeys(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other toOneRelationshipKeys)] + pub unsafe fn toOneRelationshipKeys(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other toManyRelationshipKeys)] + pub unsafe fn toManyRelationshipKeys(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other inverseForRelationshipKey:)] + pub unsafe fn inverseForRelationshipKey( + &self, + relationshipKey: &NSString, + ) -> Option>; + } +); + +extern_methods!( + /// NSClassDescriptionPrimitives + unsafe impl NSObject { + #[method_id(@__retain_semantics Other classDescription)] + pub unsafe fn classDescription(&self) -> Id; + + #[method_id(@__retain_semantics Other attributeKeys)] + pub unsafe fn attributeKeys(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other toOneRelationshipKeys)] + pub unsafe fn toOneRelationshipKeys(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other toManyRelationshipKeys)] + pub unsafe fn toManyRelationshipKeys(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other inverseForRelationshipKey:)] + pub unsafe fn inverseForRelationshipKey( + &self, + relationshipKey: &NSString, + ) -> Option>; + } +); + +extern_static!(NSClassDescriptionNeededForClassNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/Foundation/NSCoder.rs b/crates/icrate/src/generated/Foundation/NSCoder.rs new file mode 100644 index 000000000..2ef8cff65 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSCoder.rs @@ -0,0 +1,303 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSDecodingFailurePolicy { + NSDecodingFailurePolicyRaiseException = 0, + NSDecodingFailurePolicySetErrorAndReturn = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCoder; + + unsafe impl ClassType for NSCoder { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCoder { + #[method(encodeValueOfObjCType:at:)] + pub unsafe fn encodeValueOfObjCType_at( + &self, + type_: NonNull, + addr: NonNull, + ); + + #[method(encodeDataObject:)] + pub unsafe fn encodeDataObject(&self, data: &NSData); + + #[method_id(@__retain_semantics Other decodeDataObject)] + pub unsafe fn decodeDataObject(&self) -> Option>; + + #[method(decodeValueOfObjCType:at:size:)] + pub unsafe fn decodeValueOfObjCType_at_size( + &self, + type_: NonNull, + data: NonNull, + size: NSUInteger, + ); + + #[method(versionForClassName:)] + pub unsafe fn versionForClassName(&self, className: &NSString) -> NSInteger; + } +); + +extern_methods!( + /// NSExtendedCoder + unsafe impl NSCoder { + #[method(encodeObject:)] + pub unsafe fn encodeObject(&self, object: Option<&Object>); + + #[method(encodeRootObject:)] + pub unsafe fn encodeRootObject(&self, rootObject: &Object); + + #[method(encodeBycopyObject:)] + pub unsafe fn encodeBycopyObject(&self, anObject: Option<&Object>); + + #[method(encodeByrefObject:)] + pub unsafe fn encodeByrefObject(&self, anObject: Option<&Object>); + + #[method(encodeConditionalObject:)] + pub unsafe fn encodeConditionalObject(&self, object: Option<&Object>); + + #[method(encodeArrayOfObjCType:count:at:)] + pub unsafe fn encodeArrayOfObjCType_count_at( + &self, + type_: NonNull, + count: NSUInteger, + array: NonNull, + ); + + #[method(encodeBytes:length:)] + pub unsafe fn encodeBytes_length(&self, byteaddr: *mut c_void, length: NSUInteger); + + #[method_id(@__retain_semantics Other decodeObject)] + pub unsafe fn decodeObject(&self) -> Option>; + + #[method_id(@__retain_semantics Other decodeTopLevelObjectAndReturnError:)] + pub unsafe fn decodeTopLevelObjectAndReturnError( + &self, + ) -> Result, Id>; + + #[method(decodeArrayOfObjCType:count:at:)] + pub unsafe fn decodeArrayOfObjCType_count_at( + &self, + itemType: NonNull, + count: NSUInteger, + array: NonNull, + ); + + #[method(decodeBytesWithReturnedLength:)] + pub unsafe fn decodeBytesWithReturnedLength( + &self, + lengthp: NonNull, + ) -> *mut c_void; + + #[method(encodePropertyList:)] + pub unsafe fn encodePropertyList(&self, aPropertyList: &Object); + + #[method_id(@__retain_semantics Other decodePropertyList)] + pub unsafe fn decodePropertyList(&self) -> Option>; + + #[method(setObjectZone:)] + pub unsafe fn setObjectZone(&self, zone: *mut NSZone); + + #[method(objectZone)] + pub unsafe fn objectZone(&self) -> *mut NSZone; + + #[method(systemVersion)] + pub unsafe fn systemVersion(&self) -> c_uint; + + #[method(allowsKeyedCoding)] + pub unsafe fn allowsKeyedCoding(&self) -> bool; + + #[method(encodeObject:forKey:)] + pub unsafe fn encodeObject_forKey(&self, object: Option<&Object>, key: &NSString); + + #[method(encodeConditionalObject:forKey:)] + pub unsafe fn encodeConditionalObject_forKey( + &self, + object: Option<&Object>, + key: &NSString, + ); + + #[method(encodeBool:forKey:)] + pub unsafe fn encodeBool_forKey(&self, value: bool, key: &NSString); + + #[method(encodeInt:forKey:)] + pub unsafe fn encodeInt_forKey(&self, value: c_int, key: &NSString); + + #[method(encodeInt32:forKey:)] + pub unsafe fn encodeInt32_forKey(&self, value: i32, key: &NSString); + + #[method(encodeInt64:forKey:)] + pub unsafe fn encodeInt64_forKey(&self, value: i64, key: &NSString); + + #[method(encodeFloat:forKey:)] + pub unsafe fn encodeFloat_forKey(&self, value: c_float, key: &NSString); + + #[method(encodeDouble:forKey:)] + pub unsafe fn encodeDouble_forKey(&self, value: c_double, key: &NSString); + + #[method(encodeBytes:length:forKey:)] + pub unsafe fn encodeBytes_length_forKey( + &self, + bytes: *mut u8, + length: NSUInteger, + key: &NSString, + ); + + #[method(containsValueForKey:)] + pub unsafe fn containsValueForKey(&self, key: &NSString) -> bool; + + #[method_id(@__retain_semantics Other decodeObjectForKey:)] + pub unsafe fn decodeObjectForKey(&self, key: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other decodeTopLevelObjectForKey:error:)] + pub unsafe fn decodeTopLevelObjectForKey_error( + &self, + key: &NSString, + ) -> Result, Id>; + + #[method(decodeBoolForKey:)] + pub unsafe fn decodeBoolForKey(&self, key: &NSString) -> bool; + + #[method(decodeIntForKey:)] + pub unsafe fn decodeIntForKey(&self, key: &NSString) -> c_int; + + #[method(decodeInt32ForKey:)] + pub unsafe fn decodeInt32ForKey(&self, key: &NSString) -> i32; + + #[method(decodeInt64ForKey:)] + pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> i64; + + #[method(decodeFloatForKey:)] + pub unsafe fn decodeFloatForKey(&self, key: &NSString) -> c_float; + + #[method(decodeDoubleForKey:)] + pub unsafe fn decodeDoubleForKey(&self, key: &NSString) -> c_double; + + #[method(decodeBytesForKey:returnedLength:)] + pub unsafe fn decodeBytesForKey_returnedLength( + &self, + key: &NSString, + lengthp: *mut NSUInteger, + ) -> *mut u8; + + #[method(encodeInteger:forKey:)] + pub unsafe fn encodeInteger_forKey(&self, value: NSInteger, key: &NSString); + + #[method(decodeIntegerForKey:)] + pub unsafe fn decodeIntegerForKey(&self, key: &NSString) -> NSInteger; + + #[method(requiresSecureCoding)] + pub unsafe fn requiresSecureCoding(&self) -> bool; + + #[method_id(@__retain_semantics Other decodeObjectOfClass:forKey:)] + pub unsafe fn decodeObjectOfClass_forKey( + &self, + aClass: &Class, + key: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other decodeTopLevelObjectOfClass:forKey:error:)] + pub unsafe fn decodeTopLevelObjectOfClass_forKey_error( + &self, + aClass: &Class, + key: &NSString, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other decodeArrayOfObjectsOfClass:forKey:)] + pub unsafe fn decodeArrayOfObjectsOfClass_forKey( + &self, + cls: &Class, + key: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other decodeDictionaryWithKeysOfClass:objectsOfClass:forKey:)] + pub unsafe fn decodeDictionaryWithKeysOfClass_objectsOfClass_forKey( + &self, + keyCls: &Class, + objectCls: &Class, + key: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other decodeObjectOfClasses:forKey:)] + pub unsafe fn decodeObjectOfClasses_forKey( + &self, + classes: Option<&NSSet>, + key: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other decodeTopLevelObjectOfClasses:forKey:error:)] + pub unsafe fn decodeTopLevelObjectOfClasses_forKey_error( + &self, + classes: Option<&NSSet>, + key: &NSString, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other decodeArrayOfObjectsOfClasses:forKey:)] + pub unsafe fn decodeArrayOfObjectsOfClasses_forKey( + &self, + classes: &NSSet, + key: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other decodeDictionaryWithKeysOfClasses:objectsOfClasses:forKey:)] + pub unsafe fn decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey( + &self, + keyClasses: &NSSet, + objectClasses: &NSSet, + key: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other decodePropertyListForKey:)] + pub unsafe fn decodePropertyListForKey(&self, key: &NSString) + -> Option>; + + #[method_id(@__retain_semantics Other allowedClasses)] + pub unsafe fn allowedClasses(&self) -> Option, Shared>>; + + #[method(failWithError:)] + pub unsafe fn failWithError(&self, error: &NSError); + + #[method(decodingFailurePolicy)] + pub unsafe fn decodingFailurePolicy(&self) -> NSDecodingFailurePolicy; + + #[method_id(@__retain_semantics Other error)] + pub unsafe fn error(&self) -> Option>; + } +); + +extern_fn!( + pub unsafe fn NXReadNSObjectFromCoder(decoder: &NSCoder) -> *mut NSObject; +); + +extern_methods!( + /// NSTypedstreamCompatibility + unsafe impl NSCoder { + #[method(encodeNXObject:)] + pub unsafe fn encodeNXObject(&self, object: &Object); + + #[method_id(@__retain_semantics Other decodeNXObject)] + pub unsafe fn decodeNXObject(&self) -> Option>; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSCoder { + #[method(decodeValueOfObjCType:at:)] + pub unsafe fn decodeValueOfObjCType_at( + &self, + type_: NonNull, + data: NonNull, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSComparisonPredicate.rs b/crates/icrate/src/generated/Foundation/NSComparisonPredicate.rs new file mode 100644 index 000000000..5b4d010e3 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSComparisonPredicate.rs @@ -0,0 +1,113 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSComparisonPredicateOptions { + NSCaseInsensitivePredicateOption = 0x01, + NSDiacriticInsensitivePredicateOption = 0x02, + NSNormalizedPredicateOption = 0x04, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSComparisonPredicateModifier { + NSDirectPredicateModifier = 0, + NSAllPredicateModifier = 1, + NSAnyPredicateModifier = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSPredicateOperatorType { + NSLessThanPredicateOperatorType = 0, + NSLessThanOrEqualToPredicateOperatorType = 1, + NSGreaterThanPredicateOperatorType = 2, + NSGreaterThanOrEqualToPredicateOperatorType = 3, + NSEqualToPredicateOperatorType = 4, + NSNotEqualToPredicateOperatorType = 5, + NSMatchesPredicateOperatorType = 6, + NSLikePredicateOperatorType = 7, + NSBeginsWithPredicateOperatorType = 8, + NSEndsWithPredicateOperatorType = 9, + NSInPredicateOperatorType = 10, + NSCustomSelectorPredicateOperatorType = 11, + NSContainsPredicateOperatorType = 99, + NSBetweenPredicateOperatorType = 100, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSComparisonPredicate; + + unsafe impl ClassType for NSComparisonPredicate { + type Super = NSPredicate; + } +); + +extern_methods!( + unsafe impl NSComparisonPredicate { + #[method_id(@__retain_semantics Other predicateWithLeftExpression:rightExpression:modifier:type:options:)] + pub unsafe fn predicateWithLeftExpression_rightExpression_modifier_type_options( + lhs: &NSExpression, + rhs: &NSExpression, + modifier: NSComparisonPredicateModifier, + type_: NSPredicateOperatorType, + options: NSComparisonPredicateOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other predicateWithLeftExpression:rightExpression:customSelector:)] + pub unsafe fn predicateWithLeftExpression_rightExpression_customSelector( + lhs: &NSExpression, + rhs: &NSExpression, + selector: Sel, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithLeftExpression:rightExpression:modifier:type:options:)] + pub unsafe fn initWithLeftExpression_rightExpression_modifier_type_options( + this: Option>, + lhs: &NSExpression, + rhs: &NSExpression, + modifier: NSComparisonPredicateModifier, + type_: NSPredicateOperatorType, + options: NSComparisonPredicateOptions, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithLeftExpression:rightExpression:customSelector:)] + pub unsafe fn initWithLeftExpression_rightExpression_customSelector( + this: Option>, + lhs: &NSExpression, + rhs: &NSExpression, + selector: Sel, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method(predicateOperatorType)] + pub unsafe fn predicateOperatorType(&self) -> NSPredicateOperatorType; + + #[method(comparisonPredicateModifier)] + pub unsafe fn comparisonPredicateModifier(&self) -> NSComparisonPredicateModifier; + + #[method_id(@__retain_semantics Other leftExpression)] + pub unsafe fn leftExpression(&self) -> Id; + + #[method_id(@__retain_semantics Other rightExpression)] + pub unsafe fn rightExpression(&self) -> Id; + + #[method(customSelector)] + pub unsafe fn customSelector(&self) -> OptionSel; + + #[method(options)] + pub unsafe fn options(&self) -> NSComparisonPredicateOptions; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSCompoundPredicate.rs b/crates/icrate/src/generated/Foundation/NSCompoundPredicate.rs new file mode 100644 index 000000000..1ce1606f0 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSCompoundPredicate.rs @@ -0,0 +1,60 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSCompoundPredicateType { + NSNotPredicateType = 0, + NSAndPredicateType = 1, + NSOrPredicateType = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCompoundPredicate; + + unsafe impl ClassType for NSCompoundPredicate { + type Super = NSPredicate; + } +); + +extern_methods!( + unsafe impl NSCompoundPredicate { + #[method_id(@__retain_semantics Init initWithType:subpredicates:)] + pub unsafe fn initWithType_subpredicates( + this: Option>, + type_: NSCompoundPredicateType, + subpredicates: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method(compoundPredicateType)] + pub unsafe fn compoundPredicateType(&self) -> NSCompoundPredicateType; + + #[method_id(@__retain_semantics Other subpredicates)] + pub unsafe fn subpredicates(&self) -> Id; + + #[method_id(@__retain_semantics Other andPredicateWithSubpredicates:)] + pub unsafe fn andPredicateWithSubpredicates( + subpredicates: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other orPredicateWithSubpredicates:)] + pub unsafe fn orPredicateWithSubpredicates( + subpredicates: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other notPredicateWithSubpredicate:)] + pub unsafe fn notPredicateWithSubpredicate( + predicate: &NSPredicate, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSConnection.rs b/crates/icrate/src/generated/Foundation/NSConnection.rs new file mode 100644 index 000000000..615d69391 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSConnection.rs @@ -0,0 +1,257 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSConnection; + + unsafe impl ClassType for NSConnection { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSConnection { + #[method_id(@__retain_semantics Other statistics)] + pub unsafe fn statistics(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other allConnections)] + pub unsafe fn allConnections() -> Id, Shared>; + + #[method_id(@__retain_semantics Other defaultConnection)] + pub unsafe fn defaultConnection() -> Id; + + #[method_id(@__retain_semantics Other connectionWithRegisteredName:host:)] + pub unsafe fn connectionWithRegisteredName_host( + name: &NSString, + hostName: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Other connectionWithRegisteredName:host:usingNameServer:)] + pub unsafe fn connectionWithRegisteredName_host_usingNameServer( + name: &NSString, + hostName: Option<&NSString>, + server: &NSPortNameServer, + ) -> Option>; + + #[method_id(@__retain_semantics Other rootProxyForConnectionWithRegisteredName:host:)] + pub unsafe fn rootProxyForConnectionWithRegisteredName_host( + name: &NSString, + hostName: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Other rootProxyForConnectionWithRegisteredName:host:usingNameServer:)] + pub unsafe fn rootProxyForConnectionWithRegisteredName_host_usingNameServer( + name: &NSString, + hostName: Option<&NSString>, + server: &NSPortNameServer, + ) -> Option>; + + #[method_id(@__retain_semantics Other serviceConnectionWithName:rootObject:usingNameServer:)] + pub unsafe fn serviceConnectionWithName_rootObject_usingNameServer( + name: &NSString, + root: &Object, + server: &NSPortNameServer, + ) -> Option>; + + #[method_id(@__retain_semantics Other serviceConnectionWithName:rootObject:)] + pub unsafe fn serviceConnectionWithName_rootObject( + name: &NSString, + root: &Object, + ) -> Option>; + + #[method(requestTimeout)] + pub unsafe fn requestTimeout(&self) -> NSTimeInterval; + + #[method(setRequestTimeout:)] + pub unsafe fn setRequestTimeout(&self, requestTimeout: NSTimeInterval); + + #[method(replyTimeout)] + pub unsafe fn replyTimeout(&self) -> NSTimeInterval; + + #[method(setReplyTimeout:)] + pub unsafe fn setReplyTimeout(&self, replyTimeout: NSTimeInterval); + + #[method_id(@__retain_semantics Other rootObject)] + pub unsafe fn rootObject(&self) -> Option>; + + #[method(setRootObject:)] + pub unsafe fn setRootObject(&self, rootObject: Option<&Object>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSConnectionDelegate>); + + #[method(independentConversationQueueing)] + pub unsafe fn independentConversationQueueing(&self) -> bool; + + #[method(setIndependentConversationQueueing:)] + pub unsafe fn setIndependentConversationQueueing( + &self, + independentConversationQueueing: bool, + ); + + #[method(isValid)] + pub unsafe fn isValid(&self) -> bool; + + #[method_id(@__retain_semantics Other rootProxy)] + pub unsafe fn rootProxy(&self) -> Id; + + #[method(invalidate)] + pub unsafe fn invalidate(&self); + + #[method(addRequestMode:)] + pub unsafe fn addRequestMode(&self, rmode: &NSString); + + #[method(removeRequestMode:)] + pub unsafe fn removeRequestMode(&self, rmode: &NSString); + + #[method_id(@__retain_semantics Other requestModes)] + pub unsafe fn requestModes(&self) -> Id, Shared>; + + #[method(registerName:)] + pub unsafe fn registerName(&self, name: Option<&NSString>) -> bool; + + #[method(registerName:withNameServer:)] + pub unsafe fn registerName_withNameServer( + &self, + name: Option<&NSString>, + server: &NSPortNameServer, + ) -> bool; + + #[method_id(@__retain_semantics Other connectionWithReceivePort:sendPort:)] + pub unsafe fn connectionWithReceivePort_sendPort( + receivePort: Option<&NSPort>, + sendPort: Option<&NSPort>, + ) -> Option>; + + #[method_id(@__retain_semantics Other currentConversation)] + pub unsafe fn currentConversation() -> Option>; + + #[method_id(@__retain_semantics Init initWithReceivePort:sendPort:)] + pub unsafe fn initWithReceivePort_sendPort( + this: Option>, + receivePort: Option<&NSPort>, + sendPort: Option<&NSPort>, + ) -> Option>; + + #[method_id(@__retain_semantics Other sendPort)] + pub unsafe fn sendPort(&self) -> Id; + + #[method_id(@__retain_semantics Other receivePort)] + pub unsafe fn receivePort(&self) -> Id; + + #[method(enableMultipleThreads)] + pub unsafe fn enableMultipleThreads(&self); + + #[method(multipleThreadsEnabled)] + pub unsafe fn multipleThreadsEnabled(&self) -> bool; + + #[method(addRunLoop:)] + pub unsafe fn addRunLoop(&self, runloop: &NSRunLoop); + + #[method(removeRunLoop:)] + pub unsafe fn removeRunLoop(&self, runloop: &NSRunLoop); + + #[method(runInNewThread)] + pub unsafe fn runInNewThread(&self); + + #[method_id(@__retain_semantics Other remoteObjects)] + pub unsafe fn remoteObjects(&self) -> Id; + + #[method_id(@__retain_semantics Other localObjects)] + pub unsafe fn localObjects(&self) -> Id; + + #[method(dispatchWithComponents:)] + pub unsafe fn dispatchWithComponents(&self, components: &NSArray); + } +); + +extern_static!(NSConnectionReplyMode: &'static NSString); + +extern_static!(NSConnectionDidDieNotification: &'static NSString); + +extern_protocol!( + pub struct NSConnectionDelegate; + + unsafe impl NSConnectionDelegate { + #[optional] + #[method(makeNewConnection:sender:)] + pub unsafe fn makeNewConnection_sender( + &self, + conn: &NSConnection, + ancestor: &NSConnection, + ) -> bool; + + #[optional] + #[method(connection:shouldMakeNewConnection:)] + pub unsafe fn connection_shouldMakeNewConnection( + &self, + ancestor: &NSConnection, + conn: &NSConnection, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other authenticationDataForComponents:)] + pub unsafe fn authenticationDataForComponents( + &self, + components: &NSArray, + ) -> Id; + + #[optional] + #[method(authenticateComponents:withData:)] + pub unsafe fn authenticateComponents_withData( + &self, + components: &NSArray, + signature: &NSData, + ) -> bool; + + #[optional] + #[method_id(@__retain_semantics Other createConversationForConnection:)] + pub unsafe fn createConversationForConnection( + &self, + conn: &NSConnection, + ) -> Id; + + #[optional] + #[method(connection:handleRequest:)] + pub unsafe fn connection_handleRequest( + &self, + connection: &NSConnection, + doreq: &NSDistantObjectRequest, + ) -> bool; + } +); + +extern_static!(NSFailedAuthenticationException: &'static NSString); + +extern_static!(NSConnectionDidInitializeNotification: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSDistantObjectRequest; + + unsafe impl ClassType for NSDistantObjectRequest { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDistantObjectRequest { + #[method_id(@__retain_semantics Other invocation)] + pub unsafe fn invocation(&self) -> Id; + + #[method_id(@__retain_semantics Other connection)] + pub unsafe fn connection(&self) -> Id; + + #[method_id(@__retain_semantics Other conversation)] + pub unsafe fn conversation(&self) -> Id; + + #[method(replyWithException:)] + pub unsafe fn replyWithException(&self, exception: Option<&NSException>); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSData.rs b/crates/icrate/src/generated/Foundation/NSData.rs new file mode 100644 index 000000000..b398b2e40 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSData.rs @@ -0,0 +1,432 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSDataReadingOptions { + NSDataReadingMappedIfSafe = 1 << 0, + NSDataReadingUncached = 1 << 1, + NSDataReadingMappedAlways = 1 << 3, + NSDataReadingMapped = NSDataReadingMappedIfSafe, + NSMappedRead = NSDataReadingMapped, + NSUncachedRead = NSDataReadingUncached, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSDataWritingOptions { + NSDataWritingAtomic = 1 << 0, + NSDataWritingWithoutOverwriting = 1 << 1, + NSDataWritingFileProtectionNone = 0x10000000, + NSDataWritingFileProtectionComplete = 0x20000000, + NSDataWritingFileProtectionCompleteUnlessOpen = 0x30000000, + NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication = 0x40000000, + NSDataWritingFileProtectionMask = 0xf0000000, + NSAtomicWrite = NSDataWritingAtomic, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSDataSearchOptions { + NSDataSearchBackwards = 1 << 0, + NSDataSearchAnchored = 1 << 1, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSDataBase64EncodingOptions { + NSDataBase64Encoding64CharacterLineLength = 1 << 0, + NSDataBase64Encoding76CharacterLineLength = 1 << 1, + NSDataBase64EncodingEndLineWithCarriageReturn = 1 << 4, + NSDataBase64EncodingEndLineWithLineFeed = 1 << 5, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSDataBase64DecodingOptions { + NSDataBase64DecodingIgnoreUnknownCharacters = 1 << 0, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSData; + + unsafe impl ClassType for NSData { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSData { + #[method(length)] + pub unsafe fn length(&self) -> NSUInteger; + + #[method(bytes)] + pub unsafe fn bytes(&self) -> NonNull; + } +); + +extern_methods!( + /// NSExtendedData + unsafe impl NSData { + #[method_id(@__retain_semantics Other description)] + pub unsafe fn description(&self) -> Id; + + #[method(getBytes:length:)] + pub unsafe fn getBytes_length(&self, buffer: NonNull, length: NSUInteger); + + #[method(getBytes:range:)] + pub unsafe fn getBytes_range(&self, buffer: NonNull, range: NSRange); + + #[method(isEqualToData:)] + pub unsafe fn isEqualToData(&self, other: &NSData) -> bool; + + #[method_id(@__retain_semantics Other subdataWithRange:)] + pub unsafe fn subdataWithRange(&self, range: NSRange) -> Id; + + #[method(writeToFile:atomically:)] + pub unsafe fn writeToFile_atomically( + &self, + path: &NSString, + useAuxiliaryFile: bool, + ) -> bool; + + #[method(writeToURL:atomically:)] + pub unsafe fn writeToURL_atomically(&self, url: &NSURL, atomically: bool) -> bool; + + #[method(writeToFile:options:error:)] + pub unsafe fn writeToFile_options_error( + &self, + path: &NSString, + writeOptionsMask: NSDataWritingOptions, + ) -> Result<(), Id>; + + #[method(writeToURL:options:error:)] + pub unsafe fn writeToURL_options_error( + &self, + url: &NSURL, + writeOptionsMask: NSDataWritingOptions, + ) -> Result<(), Id>; + + #[method(rangeOfData:options:range:)] + pub unsafe fn rangeOfData_options_range( + &self, + dataToFind: &NSData, + mask: NSDataSearchOptions, + searchRange: NSRange, + ) -> NSRange; + + #[method(enumerateByteRangesUsingBlock:)] + pub unsafe fn enumerateByteRangesUsingBlock( + &self, + block: &Block<(NonNull, NSRange, NonNull), ()>, + ); + } +); + +extern_methods!( + /// NSDataCreation + unsafe impl NSData { + #[method_id(@__retain_semantics Other data)] + pub unsafe fn data() -> Id; + + #[method_id(@__retain_semantics Other dataWithBytes:length:)] + pub unsafe fn dataWithBytes_length( + bytes: *mut c_void, + length: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other dataWithBytesNoCopy:length:)] + pub unsafe fn dataWithBytesNoCopy_length( + bytes: NonNull, + length: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other dataWithBytesNoCopy:length:freeWhenDone:)] + pub unsafe fn dataWithBytesNoCopy_length_freeWhenDone( + bytes: NonNull, + length: NSUInteger, + b: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other dataWithContentsOfFile:options:error:)] + pub unsafe fn dataWithContentsOfFile_options_error( + path: &NSString, + readOptionsMask: NSDataReadingOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other dataWithContentsOfURL:options:error:)] + pub unsafe fn dataWithContentsOfURL_options_error( + url: &NSURL, + readOptionsMask: NSDataReadingOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other dataWithContentsOfFile:)] + pub unsafe fn dataWithContentsOfFile(path: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other dataWithContentsOfURL:)] + pub unsafe fn dataWithContentsOfURL(url: &NSURL) -> Option>; + + #[method_id(@__retain_semantics Init initWithBytes:length:)] + pub unsafe fn initWithBytes_length( + this: Option>, + bytes: *mut c_void, + length: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithBytesNoCopy:length:)] + pub unsafe fn initWithBytesNoCopy_length( + this: Option>, + bytes: NonNull, + length: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithBytesNoCopy:length:freeWhenDone:)] + pub unsafe fn initWithBytesNoCopy_length_freeWhenDone( + this: Option>, + bytes: NonNull, + length: NSUInteger, + b: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithBytesNoCopy:length:deallocator:)] + pub unsafe fn initWithBytesNoCopy_length_deallocator( + this: Option>, + bytes: NonNull, + length: NSUInteger, + deallocator: Option<&Block<(NonNull, NSUInteger), ()>>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithContentsOfFile:options:error:)] + pub unsafe fn initWithContentsOfFile_options_error( + this: Option>, + path: &NSString, + readOptionsMask: NSDataReadingOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:options:error:)] + pub unsafe fn initWithContentsOfURL_options_error( + this: Option>, + url: &NSURL, + readOptionsMask: NSDataReadingOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithContentsOfFile:)] + pub unsafe fn initWithContentsOfFile( + this: Option>, + path: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:)] + pub unsafe fn initWithContentsOfURL( + this: Option>, + url: &NSURL, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithData:)] + pub unsafe fn initWithData( + this: Option>, + data: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Other dataWithData:)] + pub unsafe fn dataWithData(data: &NSData) -> Id; + } +); + +extern_methods!( + /// NSDataBase64Encoding + unsafe impl NSData { + #[method_id(@__retain_semantics Init initWithBase64EncodedString:options:)] + pub unsafe fn initWithBase64EncodedString_options( + this: Option>, + base64String: &NSString, + options: NSDataBase64DecodingOptions, + ) -> Option>; + + #[method_id(@__retain_semantics Other base64EncodedStringWithOptions:)] + pub unsafe fn base64EncodedStringWithOptions( + &self, + options: NSDataBase64EncodingOptions, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithBase64EncodedData:options:)] + pub unsafe fn initWithBase64EncodedData_options( + this: Option>, + base64Data: &NSData, + options: NSDataBase64DecodingOptions, + ) -> Option>; + + #[method_id(@__retain_semantics Other base64EncodedDataWithOptions:)] + pub unsafe fn base64EncodedDataWithOptions( + &self, + options: NSDataBase64EncodingOptions, + ) -> Id; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSDataCompressionAlgorithm { + NSDataCompressionAlgorithmLZFSE = 0, + NSDataCompressionAlgorithmLZ4 = 1, + NSDataCompressionAlgorithmLZMA = 2, + NSDataCompressionAlgorithmZlib = 3, + } +); + +extern_methods!( + /// NSDataCompression + unsafe impl NSData { + #[method_id(@__retain_semantics Other decompressedDataUsingAlgorithm:error:)] + pub unsafe fn decompressedDataUsingAlgorithm_error( + &self, + algorithm: NSDataCompressionAlgorithm, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other compressedDataUsingAlgorithm:error:)] + pub unsafe fn compressedDataUsingAlgorithm_error( + &self, + algorithm: NSDataCompressionAlgorithm, + ) -> Result, Id>; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSData { + #[method(getBytes:)] + pub unsafe fn getBytes(&self, buffer: NonNull); + + #[method_id(@__retain_semantics Other dataWithContentsOfMappedFile:)] + pub unsafe fn dataWithContentsOfMappedFile(path: &NSString) -> Option>; + + #[method_id(@__retain_semantics Init initWithContentsOfMappedFile:)] + pub unsafe fn initWithContentsOfMappedFile( + this: Option>, + path: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithBase64Encoding:)] + pub unsafe fn initWithBase64Encoding( + this: Option>, + base64String: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other base64Encoding)] + pub unsafe fn base64Encoding(&self) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMutableData; + + unsafe impl ClassType for NSMutableData { + type Super = NSData; + } +); + +extern_methods!( + unsafe impl NSMutableData { + #[method(mutableBytes)] + pub unsafe fn mutableBytes(&self) -> NonNull; + + #[method(length)] + pub unsafe fn length(&self) -> NSUInteger; + + #[method(setLength:)] + pub unsafe fn setLength(&self, length: NSUInteger); + } +); + +extern_methods!( + /// NSExtendedMutableData + unsafe impl NSMutableData { + #[method(appendBytes:length:)] + pub unsafe fn appendBytes_length(&self, bytes: NonNull, length: NSUInteger); + + #[method(appendData:)] + pub unsafe fn appendData(&self, other: &NSData); + + #[method(increaseLengthBy:)] + pub unsafe fn increaseLengthBy(&self, extraLength: NSUInteger); + + #[method(replaceBytesInRange:withBytes:)] + pub unsafe fn replaceBytesInRange_withBytes(&self, range: NSRange, bytes: NonNull); + + #[method(resetBytesInRange:)] + pub unsafe fn resetBytesInRange(&self, range: NSRange); + + #[method(setData:)] + pub unsafe fn setData(&self, data: &NSData); + + #[method(replaceBytesInRange:withBytes:length:)] + pub unsafe fn replaceBytesInRange_withBytes_length( + &self, + range: NSRange, + replacementBytes: *mut c_void, + replacementLength: NSUInteger, + ); + } +); + +extern_methods!( + /// NSMutableDataCreation + unsafe impl NSMutableData { + #[method_id(@__retain_semantics Other dataWithCapacity:)] + pub unsafe fn dataWithCapacity(aNumItems: NSUInteger) -> Option>; + + #[method_id(@__retain_semantics Other dataWithLength:)] + pub unsafe fn dataWithLength(length: NSUInteger) -> Option>; + + #[method_id(@__retain_semantics Init initWithCapacity:)] + pub unsafe fn initWithCapacity( + this: Option>, + capacity: NSUInteger, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithLength:)] + pub unsafe fn initWithLength( + this: Option>, + length: NSUInteger, + ) -> Option>; + } +); + +extern_methods!( + /// NSMutableDataCompression + unsafe impl NSMutableData { + #[method(decompressUsingAlgorithm:error:)] + pub unsafe fn decompressUsingAlgorithm_error( + &self, + algorithm: NSDataCompressionAlgorithm, + ) -> Result<(), Id>; + + #[method(compressUsingAlgorithm:error:)] + pub unsafe fn compressUsingAlgorithm_error( + &self, + algorithm: NSDataCompressionAlgorithm, + ) -> Result<(), Id>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPurgeableData; + + unsafe impl ClassType for NSPurgeableData { + type Super = NSMutableData; + } +); + +extern_methods!( + unsafe impl NSPurgeableData {} +); diff --git a/crates/icrate/src/generated/Foundation/NSDate.rs b/crates/icrate/src/generated/Foundation/NSDate.rs new file mode 100644 index 000000000..e4c7444a0 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSDate.rs @@ -0,0 +1,128 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSSystemClockDidChangeNotification: &'static NSNotificationName); + +pub type NSTimeInterval = c_double; + +extern_class!( + #[derive(Debug)] + pub struct NSDate; + + unsafe impl ClassType for NSDate { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDate { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithTimeIntervalSinceReferenceDate:)] + pub unsafe fn initWithTimeIntervalSinceReferenceDate( + this: Option>, + ti: NSTimeInterval, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_methods!( + /// NSExtendedDate + unsafe impl NSDate { + #[method(timeIntervalSinceDate:)] + pub unsafe fn timeIntervalSinceDate(&self, anotherDate: &NSDate) -> NSTimeInterval; + + #[method(timeIntervalSinceNow)] + pub unsafe fn timeIntervalSinceNow(&self) -> NSTimeInterval; + + #[method(timeIntervalSince1970)] + pub unsafe fn timeIntervalSince1970(&self) -> NSTimeInterval; + + #[method_id(@__retain_semantics Other addTimeInterval:)] + pub unsafe fn addTimeInterval(&self, seconds: NSTimeInterval) -> Id; + + #[method_id(@__retain_semantics Other dateByAddingTimeInterval:)] + pub unsafe fn dateByAddingTimeInterval(&self, ti: NSTimeInterval) -> Id; + + #[method_id(@__retain_semantics Other earlierDate:)] + pub unsafe fn earlierDate(&self, anotherDate: &NSDate) -> Id; + + #[method_id(@__retain_semantics Other laterDate:)] + pub unsafe fn laterDate(&self, anotherDate: &NSDate) -> Id; + + #[method(compare:)] + pub unsafe fn compare(&self, other: &NSDate) -> NSComparisonResult; + + #[method(isEqualToDate:)] + pub unsafe fn isEqualToDate(&self, otherDate: &NSDate) -> bool; + + #[method_id(@__retain_semantics Other description)] + pub unsafe fn description(&self) -> Id; + + #[method_id(@__retain_semantics Other descriptionWithLocale:)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + } +); + +extern_methods!( + /// NSDateCreation + unsafe impl NSDate { + #[method_id(@__retain_semantics Other date)] + pub unsafe fn date() -> Id; + + #[method_id(@__retain_semantics Other dateWithTimeIntervalSinceNow:)] + pub unsafe fn dateWithTimeIntervalSinceNow(secs: NSTimeInterval) -> Id; + + #[method_id(@__retain_semantics Other dateWithTimeIntervalSinceReferenceDate:)] + pub unsafe fn dateWithTimeIntervalSinceReferenceDate( + ti: NSTimeInterval, + ) -> Id; + + #[method_id(@__retain_semantics Other dateWithTimeIntervalSince1970:)] + pub unsafe fn dateWithTimeIntervalSince1970(secs: NSTimeInterval) -> Id; + + #[method_id(@__retain_semantics Other dateWithTimeInterval:sinceDate:)] + pub unsafe fn dateWithTimeInterval_sinceDate( + secsToBeAdded: NSTimeInterval, + date: &NSDate, + ) -> Id; + + #[method_id(@__retain_semantics Other distantFuture)] + pub unsafe fn distantFuture() -> Id; + + #[method_id(@__retain_semantics Other distantPast)] + pub unsafe fn distantPast() -> Id; + + #[method_id(@__retain_semantics Other now)] + pub unsafe fn now() -> Id; + + #[method_id(@__retain_semantics Init initWithTimeIntervalSinceNow:)] + pub unsafe fn initWithTimeIntervalSinceNow( + this: Option>, + secs: NSTimeInterval, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithTimeIntervalSince1970:)] + pub unsafe fn initWithTimeIntervalSince1970( + this: Option>, + secs: NSTimeInterval, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithTimeInterval:sinceDate:)] + pub unsafe fn initWithTimeInterval_sinceDate( + this: Option>, + secsToBeAdded: NSTimeInterval, + date: &NSDate, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSDateComponentsFormatter.rs b/crates/icrate/src/generated/Foundation/NSDateComponentsFormatter.rs new file mode 100644 index 000000000..14575838d --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSDateComponentsFormatter.rs @@ -0,0 +1,155 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSDateComponentsFormatterUnitsStyle { + NSDateComponentsFormatterUnitsStylePositional = 0, + NSDateComponentsFormatterUnitsStyleAbbreviated = 1, + NSDateComponentsFormatterUnitsStyleShort = 2, + NSDateComponentsFormatterUnitsStyleFull = 3, + NSDateComponentsFormatterUnitsStyleSpellOut = 4, + NSDateComponentsFormatterUnitsStyleBrief = 5, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSDateComponentsFormatterZeroFormattingBehavior { + NSDateComponentsFormatterZeroFormattingBehaviorNone = 0, + NSDateComponentsFormatterZeroFormattingBehaviorDefault = 1 << 0, + NSDateComponentsFormatterZeroFormattingBehaviorDropLeading = 1 << 1, + NSDateComponentsFormatterZeroFormattingBehaviorDropMiddle = 1 << 2, + NSDateComponentsFormatterZeroFormattingBehaviorDropTrailing = 1 << 3, + NSDateComponentsFormatterZeroFormattingBehaviorDropAll = + NSDateComponentsFormatterZeroFormattingBehaviorDropLeading + | NSDateComponentsFormatterZeroFormattingBehaviorDropMiddle + | NSDateComponentsFormatterZeroFormattingBehaviorDropTrailing, + NSDateComponentsFormatterZeroFormattingBehaviorPad = 1 << 16, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDateComponentsFormatter; + + unsafe impl ClassType for NSDateComponentsFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSDateComponentsFormatter { + #[method_id(@__retain_semantics Other stringForObjectValue:)] + pub unsafe fn stringForObjectValue( + &self, + obj: Option<&Object>, + ) -> Option>; + + #[method_id(@__retain_semantics Other stringFromDateComponents:)] + pub unsafe fn stringFromDateComponents( + &self, + components: &NSDateComponents, + ) -> Option>; + + #[method_id(@__retain_semantics Other stringFromDate:toDate:)] + pub unsafe fn stringFromDate_toDate( + &self, + startDate: &NSDate, + endDate: &NSDate, + ) -> Option>; + + #[method_id(@__retain_semantics Other stringFromTimeInterval:)] + pub unsafe fn stringFromTimeInterval( + &self, + ti: NSTimeInterval, + ) -> Option>; + + #[method_id(@__retain_semantics Other localizedStringFromDateComponents:unitsStyle:)] + pub unsafe fn localizedStringFromDateComponents_unitsStyle( + components: &NSDateComponents, + unitsStyle: NSDateComponentsFormatterUnitsStyle, + ) -> Option>; + + #[method(unitsStyle)] + pub unsafe fn unitsStyle(&self) -> NSDateComponentsFormatterUnitsStyle; + + #[method(setUnitsStyle:)] + pub unsafe fn setUnitsStyle(&self, unitsStyle: NSDateComponentsFormatterUnitsStyle); + + #[method(allowedUnits)] + pub unsafe fn allowedUnits(&self) -> NSCalendarUnit; + + #[method(setAllowedUnits:)] + pub unsafe fn setAllowedUnits(&self, allowedUnits: NSCalendarUnit); + + #[method(zeroFormattingBehavior)] + pub unsafe fn zeroFormattingBehavior( + &self, + ) -> NSDateComponentsFormatterZeroFormattingBehavior; + + #[method(setZeroFormattingBehavior:)] + pub unsafe fn setZeroFormattingBehavior( + &self, + zeroFormattingBehavior: NSDateComponentsFormatterZeroFormattingBehavior, + ); + + #[method_id(@__retain_semantics Other calendar)] + pub unsafe fn calendar(&self) -> Option>; + + #[method(setCalendar:)] + pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>); + + #[method_id(@__retain_semantics Other referenceDate)] + pub unsafe fn referenceDate(&self) -> Option>; + + #[method(setReferenceDate:)] + pub unsafe fn setReferenceDate(&self, referenceDate: Option<&NSDate>); + + #[method(allowsFractionalUnits)] + pub unsafe fn allowsFractionalUnits(&self) -> bool; + + #[method(setAllowsFractionalUnits:)] + pub unsafe fn setAllowsFractionalUnits(&self, allowsFractionalUnits: bool); + + #[method(maximumUnitCount)] + pub unsafe fn maximumUnitCount(&self) -> NSInteger; + + #[method(setMaximumUnitCount:)] + pub unsafe fn setMaximumUnitCount(&self, maximumUnitCount: NSInteger); + + #[method(collapsesLargestUnit)] + pub unsafe fn collapsesLargestUnit(&self) -> bool; + + #[method(setCollapsesLargestUnit:)] + pub unsafe fn setCollapsesLargestUnit(&self, collapsesLargestUnit: bool); + + #[method(includesApproximationPhrase)] + pub unsafe fn includesApproximationPhrase(&self) -> bool; + + #[method(setIncludesApproximationPhrase:)] + pub unsafe fn setIncludesApproximationPhrase(&self, includesApproximationPhrase: bool); + + #[method(includesTimeRemainingPhrase)] + pub unsafe fn includesTimeRemainingPhrase(&self) -> bool; + + #[method(setIncludesTimeRemainingPhrase:)] + pub unsafe fn setIncludesTimeRemainingPhrase(&self, includesTimeRemainingPhrase: bool); + + #[method(formattingContext)] + pub unsafe fn formattingContext(&self) -> NSFormattingContext; + + #[method(setFormattingContext:)] + pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext); + + #[method(getObjectValue:forString:errorDescription:)] + pub unsafe fn getObjectValue_forString_errorDescription( + &self, + obj: *mut *mut Object, + string: &NSString, + error: *mut *mut NSString, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSDateFormatter.rs b/crates/icrate/src/generated/Foundation/NSDateFormatter.rs new file mode 100644 index 000000000..217070bbf --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSDateFormatter.rs @@ -0,0 +1,331 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSDateFormatterStyle { + NSDateFormatterNoStyle = 0, + NSDateFormatterShortStyle = 1, + NSDateFormatterMediumStyle = 2, + NSDateFormatterLongStyle = 3, + NSDateFormatterFullStyle = 4, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSDateFormatterBehavior { + NSDateFormatterBehaviorDefault = 0, + NSDateFormatterBehavior10_0 = 1000, + NSDateFormatterBehavior10_4 = 1040, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDateFormatter; + + unsafe impl ClassType for NSDateFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSDateFormatter { + #[method(formattingContext)] + pub unsafe fn formattingContext(&self) -> NSFormattingContext; + + #[method(setFormattingContext:)] + pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext); + + #[method(getObjectValue:forString:range:error:)] + pub unsafe fn getObjectValue_forString_range_error( + &self, + obj: *mut *mut Object, + string: &NSString, + rangep: *mut NSRange, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other stringFromDate:)] + pub unsafe fn stringFromDate(&self, date: &NSDate) -> Id; + + #[method_id(@__retain_semantics Other dateFromString:)] + pub unsafe fn dateFromString(&self, string: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other localizedStringFromDate:dateStyle:timeStyle:)] + pub unsafe fn localizedStringFromDate_dateStyle_timeStyle( + date: &NSDate, + dstyle: NSDateFormatterStyle, + tstyle: NSDateFormatterStyle, + ) -> Id; + + #[method_id(@__retain_semantics Other dateFormatFromTemplate:options:locale:)] + pub unsafe fn dateFormatFromTemplate_options_locale( + tmplate: &NSString, + opts: NSUInteger, + locale: Option<&NSLocale>, + ) -> Option>; + + #[method(defaultFormatterBehavior)] + pub unsafe fn defaultFormatterBehavior() -> NSDateFormatterBehavior; + + #[method(setDefaultFormatterBehavior:)] + pub unsafe fn setDefaultFormatterBehavior( + defaultFormatterBehavior: NSDateFormatterBehavior, + ); + + #[method(setLocalizedDateFormatFromTemplate:)] + pub unsafe fn setLocalizedDateFormatFromTemplate(&self, dateFormatTemplate: &NSString); + + #[method_id(@__retain_semantics Other dateFormat)] + pub unsafe fn dateFormat(&self) -> Id; + + #[method(setDateFormat:)] + pub unsafe fn setDateFormat(&self, dateFormat: Option<&NSString>); + + #[method(dateStyle)] + pub unsafe fn dateStyle(&self) -> NSDateFormatterStyle; + + #[method(setDateStyle:)] + pub unsafe fn setDateStyle(&self, dateStyle: NSDateFormatterStyle); + + #[method(timeStyle)] + pub unsafe fn timeStyle(&self) -> NSDateFormatterStyle; + + #[method(setTimeStyle:)] + pub unsafe fn setTimeStyle(&self, timeStyle: NSDateFormatterStyle); + + #[method_id(@__retain_semantics Other locale)] + pub unsafe fn locale(&self) -> Id; + + #[method(setLocale:)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + + #[method(generatesCalendarDates)] + pub unsafe fn generatesCalendarDates(&self) -> bool; + + #[method(setGeneratesCalendarDates:)] + pub unsafe fn setGeneratesCalendarDates(&self, generatesCalendarDates: bool); + + #[method(formatterBehavior)] + pub unsafe fn formatterBehavior(&self) -> NSDateFormatterBehavior; + + #[method(setFormatterBehavior:)] + pub unsafe fn setFormatterBehavior(&self, formatterBehavior: NSDateFormatterBehavior); + + #[method_id(@__retain_semantics Other timeZone)] + pub unsafe fn timeZone(&self) -> Id; + + #[method(setTimeZone:)] + pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>); + + #[method_id(@__retain_semantics Other calendar)] + pub unsafe fn calendar(&self) -> Id; + + #[method(setCalendar:)] + pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>); + + #[method(isLenient)] + pub unsafe fn isLenient(&self) -> bool; + + #[method(setLenient:)] + pub unsafe fn setLenient(&self, lenient: bool); + + #[method_id(@__retain_semantics Other twoDigitStartDate)] + pub unsafe fn twoDigitStartDate(&self) -> Option>; + + #[method(setTwoDigitStartDate:)] + pub unsafe fn setTwoDigitStartDate(&self, twoDigitStartDate: Option<&NSDate>); + + #[method_id(@__retain_semantics Other defaultDate)] + pub unsafe fn defaultDate(&self) -> Option>; + + #[method(setDefaultDate:)] + pub unsafe fn setDefaultDate(&self, defaultDate: Option<&NSDate>); + + #[method_id(@__retain_semantics Other eraSymbols)] + pub unsafe fn eraSymbols(&self) -> Id, Shared>; + + #[method(setEraSymbols:)] + pub unsafe fn setEraSymbols(&self, eraSymbols: Option<&NSArray>); + + #[method_id(@__retain_semantics Other monthSymbols)] + pub unsafe fn monthSymbols(&self) -> Id, Shared>; + + #[method(setMonthSymbols:)] + pub unsafe fn setMonthSymbols(&self, monthSymbols: Option<&NSArray>); + + #[method_id(@__retain_semantics Other shortMonthSymbols)] + pub unsafe fn shortMonthSymbols(&self) -> Id, Shared>; + + #[method(setShortMonthSymbols:)] + pub unsafe fn setShortMonthSymbols(&self, shortMonthSymbols: Option<&NSArray>); + + #[method_id(@__retain_semantics Other weekdaySymbols)] + pub unsafe fn weekdaySymbols(&self) -> Id, Shared>; + + #[method(setWeekdaySymbols:)] + pub unsafe fn setWeekdaySymbols(&self, weekdaySymbols: Option<&NSArray>); + + #[method_id(@__retain_semantics Other shortWeekdaySymbols)] + pub unsafe fn shortWeekdaySymbols(&self) -> Id, Shared>; + + #[method(setShortWeekdaySymbols:)] + pub unsafe fn setShortWeekdaySymbols( + &self, + shortWeekdaySymbols: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other AMSymbol)] + pub unsafe fn AMSymbol(&self) -> Id; + + #[method(setAMSymbol:)] + pub unsafe fn setAMSymbol(&self, AMSymbol: Option<&NSString>); + + #[method_id(@__retain_semantics Other PMSymbol)] + pub unsafe fn PMSymbol(&self) -> Id; + + #[method(setPMSymbol:)] + pub unsafe fn setPMSymbol(&self, PMSymbol: Option<&NSString>); + + #[method_id(@__retain_semantics Other longEraSymbols)] + pub unsafe fn longEraSymbols(&self) -> Id, Shared>; + + #[method(setLongEraSymbols:)] + pub unsafe fn setLongEraSymbols(&self, longEraSymbols: Option<&NSArray>); + + #[method_id(@__retain_semantics Other veryShortMonthSymbols)] + pub unsafe fn veryShortMonthSymbols(&self) -> Id, Shared>; + + #[method(setVeryShortMonthSymbols:)] + pub unsafe fn setVeryShortMonthSymbols( + &self, + veryShortMonthSymbols: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other standaloneMonthSymbols)] + pub unsafe fn standaloneMonthSymbols(&self) -> Id, Shared>; + + #[method(setStandaloneMonthSymbols:)] + pub unsafe fn setStandaloneMonthSymbols( + &self, + standaloneMonthSymbols: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other shortStandaloneMonthSymbols)] + pub unsafe fn shortStandaloneMonthSymbols(&self) -> Id, Shared>; + + #[method(setShortStandaloneMonthSymbols:)] + pub unsafe fn setShortStandaloneMonthSymbols( + &self, + shortStandaloneMonthSymbols: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other veryShortStandaloneMonthSymbols)] + pub unsafe fn veryShortStandaloneMonthSymbols(&self) -> Id, Shared>; + + #[method(setVeryShortStandaloneMonthSymbols:)] + pub unsafe fn setVeryShortStandaloneMonthSymbols( + &self, + veryShortStandaloneMonthSymbols: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other veryShortWeekdaySymbols)] + pub unsafe fn veryShortWeekdaySymbols(&self) -> Id, Shared>; + + #[method(setVeryShortWeekdaySymbols:)] + pub unsafe fn setVeryShortWeekdaySymbols( + &self, + veryShortWeekdaySymbols: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other standaloneWeekdaySymbols)] + pub unsafe fn standaloneWeekdaySymbols(&self) -> Id, Shared>; + + #[method(setStandaloneWeekdaySymbols:)] + pub unsafe fn setStandaloneWeekdaySymbols( + &self, + standaloneWeekdaySymbols: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other shortStandaloneWeekdaySymbols)] + pub unsafe fn shortStandaloneWeekdaySymbols(&self) -> Id, Shared>; + + #[method(setShortStandaloneWeekdaySymbols:)] + pub unsafe fn setShortStandaloneWeekdaySymbols( + &self, + shortStandaloneWeekdaySymbols: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other veryShortStandaloneWeekdaySymbols)] + pub unsafe fn veryShortStandaloneWeekdaySymbols(&self) -> Id, Shared>; + + #[method(setVeryShortStandaloneWeekdaySymbols:)] + pub unsafe fn setVeryShortStandaloneWeekdaySymbols( + &self, + veryShortStandaloneWeekdaySymbols: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other quarterSymbols)] + pub unsafe fn quarterSymbols(&self) -> Id, Shared>; + + #[method(setQuarterSymbols:)] + pub unsafe fn setQuarterSymbols(&self, quarterSymbols: Option<&NSArray>); + + #[method_id(@__retain_semantics Other shortQuarterSymbols)] + pub unsafe fn shortQuarterSymbols(&self) -> Id, Shared>; + + #[method(setShortQuarterSymbols:)] + pub unsafe fn setShortQuarterSymbols( + &self, + shortQuarterSymbols: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other standaloneQuarterSymbols)] + pub unsafe fn standaloneQuarterSymbols(&self) -> Id, Shared>; + + #[method(setStandaloneQuarterSymbols:)] + pub unsafe fn setStandaloneQuarterSymbols( + &self, + standaloneQuarterSymbols: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other shortStandaloneQuarterSymbols)] + pub unsafe fn shortStandaloneQuarterSymbols(&self) -> Id, Shared>; + + #[method(setShortStandaloneQuarterSymbols:)] + pub unsafe fn setShortStandaloneQuarterSymbols( + &self, + shortStandaloneQuarterSymbols: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other gregorianStartDate)] + pub unsafe fn gregorianStartDate(&self) -> Option>; + + #[method(setGregorianStartDate:)] + pub unsafe fn setGregorianStartDate(&self, gregorianStartDate: Option<&NSDate>); + + #[method(doesRelativeDateFormatting)] + pub unsafe fn doesRelativeDateFormatting(&self) -> bool; + + #[method(setDoesRelativeDateFormatting:)] + pub unsafe fn setDoesRelativeDateFormatting(&self, doesRelativeDateFormatting: bool); + } +); + +extern_methods!( + /// NSDateFormatterCompatibility + unsafe impl NSDateFormatter { + #[method_id(@__retain_semantics Init initWithDateFormat:allowNaturalLanguage:)] + pub unsafe fn initWithDateFormat_allowNaturalLanguage( + this: Option>, + format: &NSString, + flag: bool, + ) -> Id; + + #[method(allowsNaturalLanguage)] + pub unsafe fn allowsNaturalLanguage(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSDateInterval.rs b/crates/icrate/src/generated/Foundation/NSDateInterval.rs new file mode 100644 index 000000000..da55513a2 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSDateInterval.rs @@ -0,0 +1,67 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSDateInterval; + + unsafe impl ClassType for NSDateInterval { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDateInterval { + #[method_id(@__retain_semantics Other startDate)] + pub unsafe fn startDate(&self) -> Id; + + #[method_id(@__retain_semantics Other endDate)] + pub unsafe fn endDate(&self) -> Id; + + #[method(duration)] + pub unsafe fn duration(&self) -> NSTimeInterval; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithStartDate:duration:)] + pub unsafe fn initWithStartDate_duration( + this: Option>, + startDate: &NSDate, + duration: NSTimeInterval, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithStartDate:endDate:)] + pub unsafe fn initWithStartDate_endDate( + this: Option>, + startDate: &NSDate, + endDate: &NSDate, + ) -> Id; + + #[method(compare:)] + pub unsafe fn compare(&self, dateInterval: &NSDateInterval) -> NSComparisonResult; + + #[method(isEqualToDateInterval:)] + pub unsafe fn isEqualToDateInterval(&self, dateInterval: &NSDateInterval) -> bool; + + #[method(intersectsDateInterval:)] + pub unsafe fn intersectsDateInterval(&self, dateInterval: &NSDateInterval) -> bool; + + #[method_id(@__retain_semantics Other intersectionWithDateInterval:)] + pub unsafe fn intersectionWithDateInterval( + &self, + dateInterval: &NSDateInterval, + ) -> Option>; + + #[method(containsDate:)] + pub unsafe fn containsDate(&self, date: &NSDate) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSDateIntervalFormatter.rs b/crates/icrate/src/generated/Foundation/NSDateIntervalFormatter.rs new file mode 100644 index 000000000..8cd1f58f8 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSDateIntervalFormatter.rs @@ -0,0 +1,77 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSDateIntervalFormatterStyle { + NSDateIntervalFormatterNoStyle = 0, + NSDateIntervalFormatterShortStyle = 1, + NSDateIntervalFormatterMediumStyle = 2, + NSDateIntervalFormatterLongStyle = 3, + NSDateIntervalFormatterFullStyle = 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDateIntervalFormatter; + + unsafe impl ClassType for NSDateIntervalFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSDateIntervalFormatter { + #[method_id(@__retain_semantics Other locale)] + pub unsafe fn locale(&self) -> Id; + + #[method(setLocale:)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + + #[method_id(@__retain_semantics Other calendar)] + pub unsafe fn calendar(&self) -> Id; + + #[method(setCalendar:)] + pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>); + + #[method_id(@__retain_semantics Other timeZone)] + pub unsafe fn timeZone(&self) -> Id; + + #[method(setTimeZone:)] + pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>); + + #[method_id(@__retain_semantics Other dateTemplate)] + pub unsafe fn dateTemplate(&self) -> Id; + + #[method(setDateTemplate:)] + pub unsafe fn setDateTemplate(&self, dateTemplate: Option<&NSString>); + + #[method(dateStyle)] + pub unsafe fn dateStyle(&self) -> NSDateIntervalFormatterStyle; + + #[method(setDateStyle:)] + pub unsafe fn setDateStyle(&self, dateStyle: NSDateIntervalFormatterStyle); + + #[method(timeStyle)] + pub unsafe fn timeStyle(&self) -> NSDateIntervalFormatterStyle; + + #[method(setTimeStyle:)] + pub unsafe fn setTimeStyle(&self, timeStyle: NSDateIntervalFormatterStyle); + + #[method_id(@__retain_semantics Other stringFromDate:toDate:)] + pub unsafe fn stringFromDate_toDate( + &self, + fromDate: &NSDate, + toDate: &NSDate, + ) -> Id; + + #[method_id(@__retain_semantics Other stringFromDateInterval:)] + pub unsafe fn stringFromDateInterval( + &self, + dateInterval: &NSDateInterval, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSDecimal.rs b/crates/icrate/src/generated/Foundation/NSDecimal.rs new file mode 100644 index 000000000..9c1b9ae88 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSDecimal.rs @@ -0,0 +1,124 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSRoundingMode { + NSRoundPlain = 0, + NSRoundDown = 1, + NSRoundUp = 2, + NSRoundBankers = 3, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSCalculationError { + NSCalculationNoError = 0, + NSCalculationLossOfPrecision = 1, + NSCalculationUnderflow = 2, + NSCalculationOverflow = 3, + NSCalculationDivideByZero = 4, + } +); + +inline_fn!( + pub unsafe fn NSDecimalIsNotANumber(dcm: NonNull) -> Bool { + todo!() + } +); + +extern_fn!( + pub unsafe fn NSDecimalCopy(destination: NonNull, source: NonNull); +); + +extern_fn!( + pub unsafe fn NSDecimalCompact(number: NonNull); +); + +extern_fn!( + pub unsafe fn NSDecimalCompare( + leftOperand: NonNull, + rightOperand: NonNull, + ) -> NSComparisonResult; +); + +extern_fn!( + pub unsafe fn NSDecimalRound( + result: NonNull, + number: NonNull, + scale: NSInteger, + roundingMode: NSRoundingMode, + ); +); + +extern_fn!( + pub unsafe fn NSDecimalNormalize( + number1: NonNull, + number2: NonNull, + roundingMode: NSRoundingMode, + ) -> NSCalculationError; +); + +extern_fn!( + pub unsafe fn NSDecimalAdd( + result: NonNull, + leftOperand: NonNull, + rightOperand: NonNull, + roundingMode: NSRoundingMode, + ) -> NSCalculationError; +); + +extern_fn!( + pub unsafe fn NSDecimalSubtract( + result: NonNull, + leftOperand: NonNull, + rightOperand: NonNull, + roundingMode: NSRoundingMode, + ) -> NSCalculationError; +); + +extern_fn!( + pub unsafe fn NSDecimalMultiply( + result: NonNull, + leftOperand: NonNull, + rightOperand: NonNull, + roundingMode: NSRoundingMode, + ) -> NSCalculationError; +); + +extern_fn!( + pub unsafe fn NSDecimalDivide( + result: NonNull, + leftOperand: NonNull, + rightOperand: NonNull, + roundingMode: NSRoundingMode, + ) -> NSCalculationError; +); + +extern_fn!( + pub unsafe fn NSDecimalPower( + result: NonNull, + number: NonNull, + power: NSUInteger, + roundingMode: NSRoundingMode, + ) -> NSCalculationError; +); + +extern_fn!( + pub unsafe fn NSDecimalMultiplyByPowerOf10( + result: NonNull, + number: NonNull, + power: c_short, + roundingMode: NSRoundingMode, + ) -> NSCalculationError; +); + +extern_fn!( + pub unsafe fn NSDecimalString( + dcm: NonNull, + locale: Option<&Object>, + ) -> NonNull; +); diff --git a/crates/icrate/src/generated/Foundation/NSDecimalNumber.rs b/crates/icrate/src/generated/Foundation/NSDecimalNumber.rs new file mode 100644 index 000000000..828e84bcb --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSDecimalNumber.rs @@ -0,0 +1,268 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSDecimalNumberExactnessException: &'static NSExceptionName); + +extern_static!(NSDecimalNumberOverflowException: &'static NSExceptionName); + +extern_static!(NSDecimalNumberUnderflowException: &'static NSExceptionName); + +extern_static!(NSDecimalNumberDivideByZeroException: &'static NSExceptionName); + +extern_protocol!( + pub struct NSDecimalNumberBehaviors; + + unsafe impl NSDecimalNumberBehaviors { + #[method(roundingMode)] + pub unsafe fn roundingMode(&self) -> NSRoundingMode; + + #[method(scale)] + pub unsafe fn scale(&self) -> c_short; + + #[method_id(@__retain_semantics Other exceptionDuringOperation:error:leftOperand:rightOperand:)] + pub unsafe fn exceptionDuringOperation_error_leftOperand_rightOperand( + &self, + operation: Sel, + error: NSCalculationError, + leftOperand: &NSDecimalNumber, + rightOperand: Option<&NSDecimalNumber>, + ) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDecimalNumber; + + unsafe impl ClassType for NSDecimalNumber { + type Super = NSNumber; + } +); + +extern_methods!( + unsafe impl NSDecimalNumber { + #[method_id(@__retain_semantics Init initWithMantissa:exponent:isNegative:)] + pub unsafe fn initWithMantissa_exponent_isNegative( + this: Option>, + mantissa: c_ulonglong, + exponent: c_short, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithDecimal:)] + pub unsafe fn initWithDecimal( + this: Option>, + dcm: NSDecimal, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithString:)] + pub unsafe fn initWithString( + this: Option>, + numberValue: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithString:locale:)] + pub unsafe fn initWithString_locale( + this: Option>, + numberValue: Option<&NSString>, + locale: Option<&Object>, + ) -> Id; + + #[method_id(@__retain_semantics Other descriptionWithLocale:)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + + #[method(decimalValue)] + pub unsafe fn decimalValue(&self) -> NSDecimal; + + #[method_id(@__retain_semantics Other decimalNumberWithMantissa:exponent:isNegative:)] + pub unsafe fn decimalNumberWithMantissa_exponent_isNegative( + mantissa: c_ulonglong, + exponent: c_short, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberWithDecimal:)] + pub unsafe fn decimalNumberWithDecimal(dcm: NSDecimal) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberWithString:)] + pub unsafe fn decimalNumberWithString( + numberValue: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberWithString:locale:)] + pub unsafe fn decimalNumberWithString_locale( + numberValue: Option<&NSString>, + locale: Option<&Object>, + ) -> Id; + + #[method_id(@__retain_semantics Other zero)] + pub unsafe fn zero() -> Id; + + #[method_id(@__retain_semantics Other one)] + pub unsafe fn one() -> Id; + + #[method_id(@__retain_semantics Other minimumDecimalNumber)] + pub unsafe fn minimumDecimalNumber() -> Id; + + #[method_id(@__retain_semantics Other maximumDecimalNumber)] + pub unsafe fn maximumDecimalNumber() -> Id; + + #[method_id(@__retain_semantics Other notANumber)] + pub unsafe fn notANumber() -> Id; + + #[method_id(@__retain_semantics Other decimalNumberByAdding:)] + pub unsafe fn decimalNumberByAdding( + &self, + decimalNumber: &NSDecimalNumber, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberByAdding:withBehavior:)] + pub unsafe fn decimalNumberByAdding_withBehavior( + &self, + decimalNumber: &NSDecimalNumber, + behavior: Option<&NSDecimalNumberBehaviors>, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberBySubtracting:)] + pub unsafe fn decimalNumberBySubtracting( + &self, + decimalNumber: &NSDecimalNumber, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberBySubtracting:withBehavior:)] + pub unsafe fn decimalNumberBySubtracting_withBehavior( + &self, + decimalNumber: &NSDecimalNumber, + behavior: Option<&NSDecimalNumberBehaviors>, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberByMultiplyingBy:)] + pub unsafe fn decimalNumberByMultiplyingBy( + &self, + decimalNumber: &NSDecimalNumber, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberByMultiplyingBy:withBehavior:)] + pub unsafe fn decimalNumberByMultiplyingBy_withBehavior( + &self, + decimalNumber: &NSDecimalNumber, + behavior: Option<&NSDecimalNumberBehaviors>, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberByDividingBy:)] + pub unsafe fn decimalNumberByDividingBy( + &self, + decimalNumber: &NSDecimalNumber, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberByDividingBy:withBehavior:)] + pub unsafe fn decimalNumberByDividingBy_withBehavior( + &self, + decimalNumber: &NSDecimalNumber, + behavior: Option<&NSDecimalNumberBehaviors>, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberByRaisingToPower:)] + pub unsafe fn decimalNumberByRaisingToPower( + &self, + power: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberByRaisingToPower:withBehavior:)] + pub unsafe fn decimalNumberByRaisingToPower_withBehavior( + &self, + power: NSUInteger, + behavior: Option<&NSDecimalNumberBehaviors>, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberByMultiplyingByPowerOf10:)] + pub unsafe fn decimalNumberByMultiplyingByPowerOf10( + &self, + power: c_short, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberByMultiplyingByPowerOf10:withBehavior:)] + pub unsafe fn decimalNumberByMultiplyingByPowerOf10_withBehavior( + &self, + power: c_short, + behavior: Option<&NSDecimalNumberBehaviors>, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberByRoundingAccordingToBehavior:)] + pub unsafe fn decimalNumberByRoundingAccordingToBehavior( + &self, + behavior: Option<&NSDecimalNumberBehaviors>, + ) -> Id; + + #[method(compare:)] + pub unsafe fn compare(&self, decimalNumber: &NSNumber) -> NSComparisonResult; + + #[method_id(@__retain_semantics Other defaultBehavior)] + pub unsafe fn defaultBehavior() -> Id; + + #[method(setDefaultBehavior:)] + pub unsafe fn setDefaultBehavior(defaultBehavior: &NSDecimalNumberBehaviors); + + #[method(objCType)] + pub unsafe fn objCType(&self) -> NonNull; + + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDecimalNumberHandler; + + unsafe impl ClassType for NSDecimalNumberHandler { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDecimalNumberHandler { + #[method_id(@__retain_semantics Other defaultDecimalNumberHandler)] + pub unsafe fn defaultDecimalNumberHandler() -> Id; + + #[method_id(@__retain_semantics Init initWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:)] + pub unsafe fn initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero( + this: Option>, + roundingMode: NSRoundingMode, + scale: c_short, + exact: bool, + overflow: bool, + underflow: bool, + divideByZero: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other decimalNumberHandlerWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:)] + pub unsafe fn decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero( + roundingMode: NSRoundingMode, + scale: c_short, + exact: bool, + overflow: bool, + underflow: bool, + divideByZero: bool, + ) -> Id; + } +); + +extern_methods!( + /// NSDecimalNumberExtensions + unsafe impl NSNumber { + #[method(decimalValue)] + pub unsafe fn decimalValue(&self) -> NSDecimal; + } +); + +extern_methods!( + /// NSDecimalNumberScanning + unsafe impl NSScanner { + #[method(scanDecimal:)] + pub unsafe fn scanDecimal(&self, dcm: *mut NSDecimal) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSDictionary.rs b/crates/icrate/src/generated/Foundation/NSDictionary.rs new file mode 100644 index 000000000..7e1bce19c --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSDictionary.rs @@ -0,0 +1,377 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSDictionary { + _inner0: PhantomData<*mut KeyType>, + _inner1: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSDictionary { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDictionary { + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other objectForKey:)] + pub unsafe fn objectForKey(&self, aKey: &KeyType) -> Option>; + + #[method_id(@__retain_semantics Other keyEnumerator)] + pub unsafe fn keyEnumerator(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithObjects:forKeys:count:)] + pub unsafe fn initWithObjects_forKeys_count( + this: Option>, + objects: *mut NonNull, + keys: *mut NonNull, + cnt: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_methods!( + /// NSExtendedDictionary + unsafe impl NSDictionary { + #[method_id(@__retain_semantics Other allKeys)] + pub unsafe fn allKeys(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other allKeysForObject:)] + pub unsafe fn allKeysForObject( + &self, + anObject: &ObjectType, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other allValues)] + pub unsafe fn allValues(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other description)] + pub unsafe fn description(&self) -> Id; + + #[method_id(@__retain_semantics Other descriptionInStringsFileFormat)] + pub unsafe fn descriptionInStringsFileFormat(&self) -> Id; + + #[method_id(@__retain_semantics Other descriptionWithLocale:)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + + #[method_id(@__retain_semantics Other descriptionWithLocale:indent:)] + pub unsafe fn descriptionWithLocale_indent( + &self, + locale: Option<&Object>, + level: NSUInteger, + ) -> Id; + + #[method(isEqualToDictionary:)] + pub unsafe fn isEqualToDictionary( + &self, + otherDictionary: &NSDictionary, + ) -> bool; + + #[method_id(@__retain_semantics Other objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other objectsForKeys:notFoundMarker:)] + pub unsafe fn objectsForKeys_notFoundMarker( + &self, + keys: &NSArray, + marker: &ObjectType, + ) -> Id, Shared>; + + #[method(writeToURL:error:)] + pub unsafe fn writeToURL_error(&self, url: &NSURL) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other keysSortedByValueUsingSelector:)] + pub unsafe fn keysSortedByValueUsingSelector( + &self, + comparator: Sel, + ) -> Id, Shared>; + + #[method(getObjects:andKeys:count:)] + pub unsafe fn getObjects_andKeys_count( + &self, + objects: *mut NonNull, + keys: *mut NonNull, + count: NSUInteger, + ); + + #[method_id(@__retain_semantics Other objectForKeyedSubscript:)] + pub unsafe fn objectForKeyedSubscript( + &self, + key: &KeyType, + ) -> Option>; + + #[method(enumerateKeysAndObjectsUsingBlock:)] + pub unsafe fn enumerateKeysAndObjectsUsingBlock( + &self, + block: &Block<(NonNull, NonNull, NonNull), ()>, + ); + + #[method(enumerateKeysAndObjectsWithOptions:usingBlock:)] + pub unsafe fn enumerateKeysAndObjectsWithOptions_usingBlock( + &self, + opts: NSEnumerationOptions, + block: &Block<(NonNull, NonNull, NonNull), ()>, + ); + + #[method_id(@__retain_semantics Other keysSortedByValueUsingComparator:)] + pub unsafe fn keysSortedByValueUsingComparator( + &self, + cmptr: NSComparator, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other keysSortedByValueWithOptions:usingComparator:)] + pub unsafe fn keysSortedByValueWithOptions_usingComparator( + &self, + opts: NSSortOptions, + cmptr: NSComparator, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other keysOfEntriesPassingTest:)] + pub unsafe fn keysOfEntriesPassingTest( + &self, + predicate: &Block<(NonNull, NonNull, NonNull), Bool>, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other keysOfEntriesWithOptions:passingTest:)] + pub unsafe fn keysOfEntriesWithOptions_passingTest( + &self, + opts: NSEnumerationOptions, + predicate: &Block<(NonNull, NonNull, NonNull), Bool>, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSDictionary { + #[method(getObjects:andKeys:)] + pub unsafe fn getObjects_andKeys( + &self, + objects: *mut NonNull, + keys: *mut NonNull, + ); + + #[method_id(@__retain_semantics Other dictionaryWithContentsOfFile:)] + pub unsafe fn dictionaryWithContentsOfFile( + path: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other dictionaryWithContentsOfURL:)] + pub unsafe fn dictionaryWithContentsOfURL( + url: &NSURL, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Init initWithContentsOfFile:)] + pub unsafe fn initWithContentsOfFile( + this: Option>, + path: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:)] + pub unsafe fn initWithContentsOfURL( + this: Option>, + url: &NSURL, + ) -> Option, Shared>>; + + #[method(writeToFile:atomically:)] + pub unsafe fn writeToFile_atomically( + &self, + path: &NSString, + useAuxiliaryFile: bool, + ) -> bool; + + #[method(writeToURL:atomically:)] + pub unsafe fn writeToURL_atomically(&self, url: &NSURL, atomically: bool) -> bool; + } +); + +extern_methods!( + /// NSDictionaryCreation + unsafe impl NSDictionary { + #[method_id(@__retain_semantics Other dictionary)] + pub unsafe fn dictionary() -> Id; + + #[method_id(@__retain_semantics Other dictionaryWithObject:forKey:)] + pub unsafe fn dictionaryWithObject_forKey( + object: &ObjectType, + key: &NSCopying, + ) -> Id; + + #[method_id(@__retain_semantics Other dictionaryWithObjects:forKeys:count:)] + pub unsafe fn dictionaryWithObjects_forKeys_count( + objects: *mut NonNull, + keys: *mut NonNull, + cnt: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other dictionaryWithDictionary:)] + pub unsafe fn dictionaryWithDictionary( + dict: &NSDictionary, + ) -> Id; + + #[method_id(@__retain_semantics Other dictionaryWithObjects:forKeys:)] + pub unsafe fn dictionaryWithObjects_forKeys( + objects: &NSArray, + keys: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithDictionary:)] + pub unsafe fn initWithDictionary( + this: Option>, + otherDictionary: &NSDictionary, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithDictionary:copyItems:)] + pub unsafe fn initWithDictionary_copyItems( + this: Option>, + otherDictionary: &NSDictionary, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithObjects:forKeys:)] + pub unsafe fn initWithObjects_forKeys( + this: Option>, + objects: &NSArray, + keys: &NSArray, + ) -> Id; + } +); + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSMutableDictionary { + _inner0: PhantomData<*mut KeyType>, + _inner1: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType + for NSMutableDictionary + { + type Super = NSDictionary; + } +); + +extern_methods!( + unsafe impl NSMutableDictionary { + #[method(removeObjectForKey:)] + pub unsafe fn removeObjectForKey(&self, aKey: &KeyType); + + #[method(setObject:forKey:)] + pub unsafe fn setObject_forKey(&self, anObject: &ObjectType, aKey: &NSCopying); + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCapacity:)] + pub unsafe fn initWithCapacity( + this: Option>, + numItems: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_methods!( + /// NSExtendedMutableDictionary + unsafe impl NSMutableDictionary { + #[method(addEntriesFromDictionary:)] + pub unsafe fn addEntriesFromDictionary( + &self, + otherDictionary: &NSDictionary, + ); + + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + + #[method(removeObjectsForKeys:)] + pub unsafe fn removeObjectsForKeys(&self, keyArray: &NSArray); + + #[method(setDictionary:)] + pub unsafe fn setDictionary(&self, otherDictionary: &NSDictionary); + + #[method(setObject:forKeyedSubscript:)] + pub unsafe fn setObject_forKeyedSubscript(&self, obj: Option<&ObjectType>, key: &NSCopying); + } +); + +extern_methods!( + /// NSMutableDictionaryCreation + unsafe impl NSMutableDictionary { + #[method_id(@__retain_semantics Other dictionaryWithCapacity:)] + pub unsafe fn dictionaryWithCapacity(numItems: NSUInteger) -> Id; + + #[method_id(@__retain_semantics Other dictionaryWithContentsOfFile:)] + pub unsafe fn dictionaryWithContentsOfFile( + path: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other dictionaryWithContentsOfURL:)] + pub unsafe fn dictionaryWithContentsOfURL( + url: &NSURL, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Init initWithContentsOfFile:)] + pub unsafe fn initWithContentsOfFile( + this: Option>, + path: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:)] + pub unsafe fn initWithContentsOfURL( + this: Option>, + url: &NSURL, + ) -> Option, Shared>>; + } +); + +extern_methods!( + /// NSSharedKeySetDictionary + unsafe impl NSDictionary { + #[method_id(@__retain_semantics Other sharedKeySetForKeys:)] + pub unsafe fn sharedKeySetForKeys(keys: &NSArray) -> Id; + } +); + +extern_methods!( + /// NSSharedKeySetDictionary + unsafe impl NSMutableDictionary { + #[method_id(@__retain_semantics Other dictionaryWithSharedKeySet:)] + pub unsafe fn dictionaryWithSharedKeySet( + keyset: &Object, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSGenericFastEnumeraiton + unsafe impl NSDictionary { + #[method(countByEnumeratingWithState:objects:count:)] + pub unsafe fn countByEnumeratingWithState_objects_count( + &self, + state: NonNull, + buffer: NonNull<*mut K>, + len: NSUInteger, + ) -> NSUInteger; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSDistantObject.rs b/crates/icrate/src/generated/Foundation/NSDistantObject.rs new file mode 100644 index 000000000..365eafa21 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSDistantObject.rs @@ -0,0 +1,55 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSDistantObject; + + unsafe impl ClassType for NSDistantObject { + type Super = NSProxy; + } +); + +extern_methods!( + unsafe impl NSDistantObject { + #[method_id(@__retain_semantics Other proxyWithTarget:connection:)] + pub unsafe fn proxyWithTarget_connection( + target: &Object, + connection: &NSConnection, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithTarget:connection:)] + pub unsafe fn initWithTarget_connection( + this: Option>, + target: &Object, + connection: &NSConnection, + ) -> Option>; + + #[method_id(@__retain_semantics Other proxyWithLocal:connection:)] + pub unsafe fn proxyWithLocal_connection( + target: &Object, + connection: &NSConnection, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithLocal:connection:)] + pub unsafe fn initWithLocal_connection( + this: Option>, + target: &Object, + connection: &NSConnection, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + inCoder: &NSCoder, + ) -> Option>; + + #[method(setProtocolForProxy:)] + pub unsafe fn setProtocolForProxy(&self, proto: Option<&Protocol>); + + #[method_id(@__retain_semantics Other connectionForProxy)] + pub unsafe fn connectionForProxy(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSDistributedLock.rs b/crates/icrate/src/generated/Foundation/NSDistributedLock.rs new file mode 100644 index 000000000..c118bd51a --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSDistributedLock.rs @@ -0,0 +1,41 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSDistributedLock; + + unsafe impl ClassType for NSDistributedLock { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSDistributedLock { + #[method_id(@__retain_semantics Other lockWithPath:)] + pub unsafe fn lockWithPath(path: &NSString) -> Option>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithPath:)] + pub unsafe fn initWithPath( + this: Option>, + path: &NSString, + ) -> Option>; + + #[method(tryLock)] + pub unsafe fn tryLock(&self) -> bool; + + #[method(unlock)] + pub unsafe fn unlock(&self); + + #[method(breakLock)] + pub unsafe fn breakLock(&self); + + #[method_id(@__retain_semantics Other lockDate)] + pub unsafe fn lockDate(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSDistributedNotificationCenter.rs b/crates/icrate/src/generated/Foundation/NSDistributedNotificationCenter.rs new file mode 100644 index 000000000..6ac467d6b --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSDistributedNotificationCenter.rs @@ -0,0 +1,123 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSDistributedNotificationCenterType = NSString; + +extern_static!(NSLocalNotificationCenterType: &'static NSDistributedNotificationCenterType); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSNotificationSuspensionBehavior { + NSNotificationSuspensionBehaviorDrop = 1, + NSNotificationSuspensionBehaviorCoalesce = 2, + NSNotificationSuspensionBehaviorHold = 3, + NSNotificationSuspensionBehaviorDeliverImmediately = 4, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSDistributedNotificationOptions { + NSDistributedNotificationDeliverImmediately = 1 << 0, + NSDistributedNotificationPostToAllSessions = 1 << 1, + } +); + +extern_static!( + NSNotificationDeliverImmediately: NSDistributedNotificationOptions = + NSDistributedNotificationDeliverImmediately +); + +extern_static!( + NSNotificationPostToAllSessions: NSDistributedNotificationOptions = + NSDistributedNotificationPostToAllSessions +); + +extern_class!( + #[derive(Debug)] + pub struct NSDistributedNotificationCenter; + + unsafe impl ClassType for NSDistributedNotificationCenter { + type Super = NSNotificationCenter; + } +); + +extern_methods!( + unsafe impl NSDistributedNotificationCenter { + #[method_id(@__retain_semantics Other notificationCenterForType:)] + pub unsafe fn notificationCenterForType( + notificationCenterType: &NSDistributedNotificationCenterType, + ) -> Id; + + #[method_id(@__retain_semantics Other defaultCenter)] + pub unsafe fn defaultCenter() -> Id; + + #[method(addObserver:selector:name:object:suspensionBehavior:)] + pub unsafe fn addObserver_selector_name_object_suspensionBehavior( + &self, + observer: &Object, + selector: Sel, + name: Option<&NSNotificationName>, + object: Option<&NSString>, + suspensionBehavior: NSNotificationSuspensionBehavior, + ); + + #[method(postNotificationName:object:userInfo:deliverImmediately:)] + pub unsafe fn postNotificationName_object_userInfo_deliverImmediately( + &self, + name: &NSNotificationName, + object: Option<&NSString>, + userInfo: Option<&NSDictionary>, + deliverImmediately: bool, + ); + + #[method(postNotificationName:object:userInfo:options:)] + pub unsafe fn postNotificationName_object_userInfo_options( + &self, + name: &NSNotificationName, + object: Option<&NSString>, + userInfo: Option<&NSDictionary>, + options: NSDistributedNotificationOptions, + ); + + #[method(suspended)] + pub unsafe fn suspended(&self) -> bool; + + #[method(setSuspended:)] + pub unsafe fn setSuspended(&self, suspended: bool); + + #[method(addObserver:selector:name:object:)] + pub unsafe fn addObserver_selector_name_object( + &self, + observer: &Object, + aSelector: Sel, + aName: Option<&NSNotificationName>, + anObject: Option<&NSString>, + ); + + #[method(postNotificationName:object:)] + pub unsafe fn postNotificationName_object( + &self, + aName: &NSNotificationName, + anObject: Option<&NSString>, + ); + + #[method(postNotificationName:object:userInfo:)] + pub unsafe fn postNotificationName_object_userInfo( + &self, + aName: &NSNotificationName, + anObject: Option<&NSString>, + aUserInfo: Option<&NSDictionary>, + ); + + #[method(removeObserver:name:object:)] + pub unsafe fn removeObserver_name_object( + &self, + observer: &Object, + aName: Option<&NSNotificationName>, + anObject: Option<&NSString>, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSEnergyFormatter.rs b/crates/icrate/src/generated/Foundation/NSEnergyFormatter.rs new file mode 100644 index 000000000..35d49affc --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSEnergyFormatter.rs @@ -0,0 +1,77 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSEnergyFormatterUnit { + NSEnergyFormatterUnitJoule = 11, + NSEnergyFormatterUnitKilojoule = 14, + NSEnergyFormatterUnitCalorie = (7 << 8) + 1, + NSEnergyFormatterUnitKilocalorie = (7 << 8) + 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSEnergyFormatter; + + unsafe impl ClassType for NSEnergyFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSEnergyFormatter { + #[method_id(@__retain_semantics Other numberFormatter)] + pub unsafe fn numberFormatter(&self) -> Id; + + #[method(setNumberFormatter:)] + pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>); + + #[method(unitStyle)] + pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle; + + #[method(setUnitStyle:)] + pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle); + + #[method(isForFoodEnergyUse)] + pub unsafe fn isForFoodEnergyUse(&self) -> bool; + + #[method(setForFoodEnergyUse:)] + pub unsafe fn setForFoodEnergyUse(&self, forFoodEnergyUse: bool); + + #[method_id(@__retain_semantics Other stringFromValue:unit:)] + pub unsafe fn stringFromValue_unit( + &self, + value: c_double, + unit: NSEnergyFormatterUnit, + ) -> Id; + + #[method_id(@__retain_semantics Other stringFromJoules:)] + pub unsafe fn stringFromJoules(&self, numberInJoules: c_double) -> Id; + + #[method_id(@__retain_semantics Other unitStringFromValue:unit:)] + pub unsafe fn unitStringFromValue_unit( + &self, + value: c_double, + unit: NSEnergyFormatterUnit, + ) -> Id; + + #[method_id(@__retain_semantics Other unitStringFromJoules:usedUnit:)] + pub unsafe fn unitStringFromJoules_usedUnit( + &self, + numberInJoules: c_double, + unitp: *mut NSEnergyFormatterUnit, + ) -> Id; + + #[method(getObjectValue:forString:errorDescription:)] + pub unsafe fn getObjectValue_forString_errorDescription( + &self, + obj: *mut *mut Object, + string: &NSString, + error: *mut *mut NSString, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSEnumerator.rs b/crates/icrate/src/generated/Foundation/NSEnumerator.rs new file mode 100644 index 000000000..70bf3d636 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSEnumerator.rs @@ -0,0 +1,53 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_struct!( + pub struct NSFastEnumerationState { + pub state: c_ulong, + pub itemsPtr: *mut *mut Object, + pub mutationsPtr: *mut c_ulong, + pub extra: [c_ulong; 5], + } +); + +extern_protocol!( + pub struct NSFastEnumeration; + + unsafe impl NSFastEnumeration { + #[method(countByEnumeratingWithState:objects:count:)] + pub unsafe fn countByEnumeratingWithState_objects_count( + &self, + state: NonNull, + buffer: NonNull<*mut Object>, + len: NSUInteger, + ) -> NSUInteger; + } +); + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSEnumerator { + _inner0: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSEnumerator { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSEnumerator { + #[method_id(@__retain_semantics Other nextObject)] + pub unsafe fn nextObject(&self) -> Option>; + } +); + +extern_methods!( + /// NSExtendedEnumerator + unsafe impl NSEnumerator { + #[method_id(@__retain_semantics Other allObjects)] + pub unsafe fn allObjects(&self) -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSError.rs b/crates/icrate/src/generated/Foundation/NSError.rs new file mode 100644 index 000000000..d352509c2 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSError.rs @@ -0,0 +1,133 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSErrorDomain = NSString; + +extern_static!(NSCocoaErrorDomain: &'static NSErrorDomain); + +extern_static!(NSPOSIXErrorDomain: &'static NSErrorDomain); + +extern_static!(NSOSStatusErrorDomain: &'static NSErrorDomain); + +extern_static!(NSMachErrorDomain: &'static NSErrorDomain); + +pub type NSErrorUserInfoKey = NSString; + +extern_static!(NSUnderlyingErrorKey: &'static NSErrorUserInfoKey); + +extern_static!(NSMultipleUnderlyingErrorsKey: &'static NSErrorUserInfoKey); + +extern_static!(NSLocalizedDescriptionKey: &'static NSErrorUserInfoKey); + +extern_static!(NSLocalizedFailureReasonErrorKey: &'static NSErrorUserInfoKey); + +extern_static!(NSLocalizedRecoverySuggestionErrorKey: &'static NSErrorUserInfoKey); + +extern_static!(NSLocalizedRecoveryOptionsErrorKey: &'static NSErrorUserInfoKey); + +extern_static!(NSRecoveryAttempterErrorKey: &'static NSErrorUserInfoKey); + +extern_static!(NSHelpAnchorErrorKey: &'static NSErrorUserInfoKey); + +extern_static!(NSDebugDescriptionErrorKey: &'static NSErrorUserInfoKey); + +extern_static!(NSLocalizedFailureErrorKey: &'static NSErrorUserInfoKey); + +extern_static!(NSStringEncodingErrorKey: &'static NSErrorUserInfoKey); + +extern_static!(NSURLErrorKey: &'static NSErrorUserInfoKey); + +extern_static!(NSFilePathErrorKey: &'static NSErrorUserInfoKey); + +extern_class!( + #[derive(Debug)] + pub struct NSError; + + unsafe impl ClassType for NSError { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSError { + #[method_id(@__retain_semantics Init initWithDomain:code:userInfo:)] + pub unsafe fn initWithDomain_code_userInfo( + this: Option>, + domain: &NSErrorDomain, + code: NSInteger, + dict: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Other errorWithDomain:code:userInfo:)] + pub unsafe fn errorWithDomain_code_userInfo( + domain: &NSErrorDomain, + code: NSInteger, + dict: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Other domain)] + pub unsafe fn domain(&self) -> Id; + + #[method(code)] + pub unsafe fn code(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other localizedDescription)] + pub unsafe fn localizedDescription(&self) -> Id; + + #[method_id(@__retain_semantics Other localizedFailureReason)] + pub unsafe fn localizedFailureReason(&self) -> Option>; + + #[method_id(@__retain_semantics Other localizedRecoverySuggestion)] + pub unsafe fn localizedRecoverySuggestion(&self) -> Option>; + + #[method_id(@__retain_semantics Other localizedRecoveryOptions)] + pub unsafe fn localizedRecoveryOptions(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other recoveryAttempter)] + pub unsafe fn recoveryAttempter(&self) -> Option>; + + #[method_id(@__retain_semantics Other helpAnchor)] + pub unsafe fn helpAnchor(&self) -> Option>; + + #[method_id(@__retain_semantics Other underlyingErrors)] + pub unsafe fn underlyingErrors(&self) -> Id, Shared>; + + #[method(setUserInfoValueProviderForDomain:provider:)] + pub unsafe fn setUserInfoValueProviderForDomain_provider( + errorDomain: &NSErrorDomain, + provider: Option<&Block<(NonNull, NonNull), *mut Object>>, + ); + + #[method(userInfoValueProviderForDomain:)] + pub unsafe fn userInfoValueProviderForDomain( + errorDomain: &NSErrorDomain, + ) -> *mut Block<(NonNull, NonNull), *mut Object>; + } +); + +extern_methods!( + /// NSErrorRecoveryAttempting + unsafe impl NSObject { + #[method(attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:)] + pub unsafe fn attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo( + &self, + error: &NSError, + recoveryOptionIndex: NSUInteger, + delegate: Option<&Object>, + didRecoverSelector: OptionSel, + contextInfo: *mut c_void, + ); + + #[method(attemptRecoveryFromError:optionIndex:)] + pub unsafe fn attemptRecoveryFromError_optionIndex( + &self, + error: &NSError, + recoveryOptionIndex: NSUInteger, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSException.rs b/crates/icrate/src/generated/Foundation/NSException.rs new file mode 100644 index 000000000..cc61104b3 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSException.rs @@ -0,0 +1,113 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSGenericException: &'static NSExceptionName); + +extern_static!(NSRangeException: &'static NSExceptionName); + +extern_static!(NSInvalidArgumentException: &'static NSExceptionName); + +extern_static!(NSInternalInconsistencyException: &'static NSExceptionName); + +extern_static!(NSMallocException: &'static NSExceptionName); + +extern_static!(NSObjectInaccessibleException: &'static NSExceptionName); + +extern_static!(NSObjectNotAvailableException: &'static NSExceptionName); + +extern_static!(NSDestinationInvalidException: &'static NSExceptionName); + +extern_static!(NSPortTimeoutException: &'static NSExceptionName); + +extern_static!(NSInvalidSendPortException: &'static NSExceptionName); + +extern_static!(NSInvalidReceivePortException: &'static NSExceptionName); + +extern_static!(NSPortSendException: &'static NSExceptionName); + +extern_static!(NSPortReceiveException: &'static NSExceptionName); + +extern_static!(NSOldStyleException: &'static NSExceptionName); + +extern_static!(NSInconsistentArchiveException: &'static NSExceptionName); + +extern_class!( + #[derive(Debug)] + pub struct NSException; + + unsafe impl ClassType for NSException { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSException { + #[method_id(@__retain_semantics Other exceptionWithName:reason:userInfo:)] + pub unsafe fn exceptionWithName_reason_userInfo( + name: &NSExceptionName, + reason: Option<&NSString>, + userInfo: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithName:reason:userInfo:)] + pub unsafe fn initWithName_reason_userInfo( + this: Option>, + aName: &NSExceptionName, + aReason: Option<&NSString>, + aUserInfo: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other reason)] + pub unsafe fn reason(&self) -> Option>; + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + + #[method_id(@__retain_semantics Other callStackReturnAddresses)] + pub unsafe fn callStackReturnAddresses(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other callStackSymbols)] + pub unsafe fn callStackSymbols(&self) -> Id, Shared>; + + #[method(raise)] + pub unsafe fn raise(&self); + } +); + +extern_methods!( + /// NSExceptionRaisingConveniences + unsafe impl NSException {} +); + +pub type NSUncaughtExceptionHandler = TodoFunction; + +extern_fn!( + pub unsafe fn NSGetUncaughtExceptionHandler() -> *mut NSUncaughtExceptionHandler; +); + +extern_fn!( + pub unsafe fn NSSetUncaughtExceptionHandler(_: *mut NSUncaughtExceptionHandler); +); + +extern_static!(NSAssertionHandlerKey: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSAssertionHandler; + + unsafe impl ClassType for NSAssertionHandler { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSAssertionHandler { + #[method_id(@__retain_semantics Other currentHandler)] + pub unsafe fn currentHandler() -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSExpression.rs b/crates/icrate/src/generated/Foundation/NSExpression.rs new file mode 100644 index 000000000..7e9b215ee --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSExpression.rs @@ -0,0 +1,195 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSExpressionType { + NSConstantValueExpressionType = 0, + NSEvaluatedObjectExpressionType = 1, + NSVariableExpressionType = 2, + NSKeyPathExpressionType = 3, + NSFunctionExpressionType = 4, + NSUnionSetExpressionType = 5, + NSIntersectSetExpressionType = 6, + NSMinusSetExpressionType = 7, + NSSubqueryExpressionType = 13, + NSAggregateExpressionType = 14, + NSAnyKeyExpressionType = 15, + NSBlockExpressionType = 19, + NSConditionalExpressionType = 20, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSExpression; + + unsafe impl ClassType for NSExpression { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSExpression { + #[method_id(@__retain_semantics Other expressionWithFormat:argumentArray:)] + pub unsafe fn expressionWithFormat_argumentArray( + expressionFormat: &NSString, + arguments: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other expressionForConstantValue:)] + pub unsafe fn expressionForConstantValue(obj: Option<&Object>) -> Id; + + #[method_id(@__retain_semantics Other expressionForEvaluatedObject)] + pub unsafe fn expressionForEvaluatedObject() -> Id; + + #[method_id(@__retain_semantics Other expressionForVariable:)] + pub unsafe fn expressionForVariable(string: &NSString) -> Id; + + #[method_id(@__retain_semantics Other expressionForKeyPath:)] + pub unsafe fn expressionForKeyPath(keyPath: &NSString) -> Id; + + #[method_id(@__retain_semantics Other expressionForFunction:arguments:)] + pub unsafe fn expressionForFunction_arguments( + name: &NSString, + parameters: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other expressionForAggregate:)] + pub unsafe fn expressionForAggregate( + subexpressions: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other expressionForUnionSet:with:)] + pub unsafe fn expressionForUnionSet_with( + left: &NSExpression, + right: &NSExpression, + ) -> Id; + + #[method_id(@__retain_semantics Other expressionForIntersectSet:with:)] + pub unsafe fn expressionForIntersectSet_with( + left: &NSExpression, + right: &NSExpression, + ) -> Id; + + #[method_id(@__retain_semantics Other expressionForMinusSet:with:)] + pub unsafe fn expressionForMinusSet_with( + left: &NSExpression, + right: &NSExpression, + ) -> Id; + + #[method_id(@__retain_semantics Other expressionForSubquery:usingIteratorVariable:predicate:)] + pub unsafe fn expressionForSubquery_usingIteratorVariable_predicate( + expression: &NSExpression, + variable: &NSString, + predicate: &NSPredicate, + ) -> Id; + + #[method_id(@__retain_semantics Other expressionForFunction:selectorName:arguments:)] + pub unsafe fn expressionForFunction_selectorName_arguments( + target: &NSExpression, + name: &NSString, + parameters: Option<&NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Other expressionForAnyKey)] + pub unsafe fn expressionForAnyKey() -> Id; + + #[method_id(@__retain_semantics Other expressionForBlock:arguments:)] + pub unsafe fn expressionForBlock_arguments( + block: &Block< + ( + *mut Object, + NonNull>, + *mut NSMutableDictionary, + ), + NonNull, + >, + arguments: Option<&NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Other expressionForConditional:trueExpression:falseExpression:)] + pub unsafe fn expressionForConditional_trueExpression_falseExpression( + predicate: &NSPredicate, + trueExpression: &NSExpression, + falseExpression: &NSExpression, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithExpressionType:)] + pub unsafe fn initWithExpressionType( + this: Option>, + type_: NSExpressionType, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method(expressionType)] + pub unsafe fn expressionType(&self) -> NSExpressionType; + + #[method_id(@__retain_semantics Other constantValue)] + pub unsafe fn constantValue(&self) -> Option>; + + #[method_id(@__retain_semantics Other keyPath)] + pub unsafe fn keyPath(&self) -> Id; + + #[method_id(@__retain_semantics Other function)] + pub unsafe fn function(&self) -> Id; + + #[method_id(@__retain_semantics Other variable)] + pub unsafe fn variable(&self) -> Id; + + #[method_id(@__retain_semantics Other operand)] + pub unsafe fn operand(&self) -> Id; + + #[method_id(@__retain_semantics Other arguments)] + pub unsafe fn arguments(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other collection)] + pub unsafe fn collection(&self) -> Id; + + #[method_id(@__retain_semantics Other predicate)] + pub unsafe fn predicate(&self) -> Id; + + #[method_id(@__retain_semantics Other leftExpression)] + pub unsafe fn leftExpression(&self) -> Id; + + #[method_id(@__retain_semantics Other rightExpression)] + pub unsafe fn rightExpression(&self) -> Id; + + #[method_id(@__retain_semantics Other trueExpression)] + pub unsafe fn trueExpression(&self) -> Id; + + #[method_id(@__retain_semantics Other falseExpression)] + pub unsafe fn falseExpression(&self) -> Id; + + #[method(expressionBlock)] + pub unsafe fn expressionBlock( + &self, + ) -> NonNull< + Block< + ( + *mut Object, + NonNull>, + *mut NSMutableDictionary, + ), + NonNull, + >, + >; + + #[method_id(@__retain_semantics Other expressionValueWithObject:context:)] + pub unsafe fn expressionValueWithObject_context( + &self, + object: Option<&Object>, + context: Option<&NSMutableDictionary>, + ) -> Option>; + + #[method(allowEvaluation)] + pub unsafe fn allowEvaluation(&self); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSExtensionContext.rs b/crates/icrate/src/generated/Foundation/NSExtensionContext.rs new file mode 100644 index 000000000..d7eb76c8e --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSExtensionContext.rs @@ -0,0 +1,47 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSExtensionContext; + + unsafe impl ClassType for NSExtensionContext { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSExtensionContext { + #[method_id(@__retain_semantics Other inputItems)] + pub unsafe fn inputItems(&self) -> Id; + + #[method(completeRequestReturningItems:completionHandler:)] + pub unsafe fn completeRequestReturningItems_completionHandler( + &self, + items: Option<&NSArray>, + completionHandler: Option<&Block<(Bool,), ()>>, + ); + + #[method(cancelRequestWithError:)] + pub unsafe fn cancelRequestWithError(&self, error: &NSError); + + #[method(openURL:completionHandler:)] + pub unsafe fn openURL_completionHandler( + &self, + URL: &NSURL, + completionHandler: Option<&Block<(Bool,), ()>>, + ); + } +); + +extern_static!(NSExtensionItemsAndErrorsKey: Option<&'static NSString>); + +extern_static!(NSExtensionHostWillEnterForegroundNotification: Option<&'static NSString>); + +extern_static!(NSExtensionHostDidEnterBackgroundNotification: Option<&'static NSString>); + +extern_static!(NSExtensionHostWillResignActiveNotification: Option<&'static NSString>); + +extern_static!(NSExtensionHostDidBecomeActiveNotification: Option<&'static NSString>); diff --git a/crates/icrate/src/generated/Foundation/NSExtensionItem.rs b/crates/icrate/src/generated/Foundation/NSExtensionItem.rs new file mode 100644 index 000000000..820cbac22 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSExtensionItem.rs @@ -0,0 +1,50 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSExtensionItem; + + unsafe impl ClassType for NSExtensionItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSExtensionItem { + #[method_id(@__retain_semantics Other attributedTitle)] + pub unsafe fn attributedTitle(&self) -> Option>; + + #[method(setAttributedTitle:)] + pub unsafe fn setAttributedTitle(&self, attributedTitle: Option<&NSAttributedString>); + + #[method_id(@__retain_semantics Other attributedContentText)] + pub unsafe fn attributedContentText(&self) -> Option>; + + #[method(setAttributedContentText:)] + pub unsafe fn setAttributedContentText( + &self, + attributedContentText: Option<&NSAttributedString>, + ); + + #[method_id(@__retain_semantics Other attachments)] + pub unsafe fn attachments(&self) -> Option, Shared>>; + + #[method(setAttachments:)] + pub unsafe fn setAttachments(&self, attachments: Option<&NSArray>); + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + + #[method(setUserInfo:)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>); + } +); + +extern_static!(NSExtensionItemAttributedTitleKey: Option<&'static NSString>); + +extern_static!(NSExtensionItemAttributedContentTextKey: Option<&'static NSString>); + +extern_static!(NSExtensionItemAttachmentsKey: Option<&'static NSString>); diff --git a/crates/icrate/src/generated/Foundation/NSExtensionRequestHandling.rs b/crates/icrate/src/generated/Foundation/NSExtensionRequestHandling.rs new file mode 100644 index 000000000..2efdff0b6 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSExtensionRequestHandling.rs @@ -0,0 +1,13 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSExtensionRequestHandling; + + unsafe impl NSExtensionRequestHandling { + #[method(beginRequestWithExtensionContext:)] + pub unsafe fn beginRequestWithExtensionContext(&self, context: &NSExtensionContext); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSFileCoordinator.rs b/crates/icrate/src/generated/Foundation/NSFileCoordinator.rs new file mode 100644 index 000000000..005a49170 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSFileCoordinator.rs @@ -0,0 +1,162 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFileCoordinatorReadingOptions { + NSFileCoordinatorReadingWithoutChanges = 1 << 0, + NSFileCoordinatorReadingResolvesSymbolicLink = 1 << 1, + NSFileCoordinatorReadingImmediatelyAvailableMetadataOnly = 1 << 2, + NSFileCoordinatorReadingForUploading = 1 << 3, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFileCoordinatorWritingOptions { + NSFileCoordinatorWritingForDeleting = 1 << 0, + NSFileCoordinatorWritingForMoving = 1 << 1, + NSFileCoordinatorWritingForMerging = 1 << 2, + NSFileCoordinatorWritingForReplacing = 1 << 3, + NSFileCoordinatorWritingContentIndependentMetadataOnly = 1 << 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSFileAccessIntent; + + unsafe impl ClassType for NSFileAccessIntent { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFileAccessIntent { + #[method_id(@__retain_semantics Other readingIntentWithURL:options:)] + pub unsafe fn readingIntentWithURL_options( + url: &NSURL, + options: NSFileCoordinatorReadingOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other writingIntentWithURL:options:)] + pub unsafe fn writingIntentWithURL_options( + url: &NSURL, + options: NSFileCoordinatorWritingOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSFileCoordinator; + + unsafe impl ClassType for NSFileCoordinator { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFileCoordinator { + #[method(addFilePresenter:)] + pub unsafe fn addFilePresenter(filePresenter: &NSFilePresenter); + + #[method(removeFilePresenter:)] + pub unsafe fn removeFilePresenter(filePresenter: &NSFilePresenter); + + #[method_id(@__retain_semantics Other filePresenters)] + pub unsafe fn filePresenters() -> Id, Shared>; + + #[method_id(@__retain_semantics Init initWithFilePresenter:)] + pub unsafe fn initWithFilePresenter( + this: Option>, + filePresenterOrNil: Option<&NSFilePresenter>, + ) -> Id; + + #[method_id(@__retain_semantics Other purposeIdentifier)] + pub unsafe fn purposeIdentifier(&self) -> Id; + + #[method(setPurposeIdentifier:)] + pub unsafe fn setPurposeIdentifier(&self, purposeIdentifier: &NSString); + + #[method(coordinateAccessWithIntents:queue:byAccessor:)] + pub unsafe fn coordinateAccessWithIntents_queue_byAccessor( + &self, + intents: &NSArray, + queue: &NSOperationQueue, + accessor: &Block<(*mut NSError,), ()>, + ); + + #[method(coordinateReadingItemAtURL:options:error:byAccessor:)] + pub unsafe fn coordinateReadingItemAtURL_options_error_byAccessor( + &self, + url: &NSURL, + options: NSFileCoordinatorReadingOptions, + outError: *mut *mut NSError, + reader: &Block<(NonNull,), ()>, + ); + + #[method(coordinateWritingItemAtURL:options:error:byAccessor:)] + pub unsafe fn coordinateWritingItemAtURL_options_error_byAccessor( + &self, + url: &NSURL, + options: NSFileCoordinatorWritingOptions, + outError: *mut *mut NSError, + writer: &Block<(NonNull,), ()>, + ); + + #[method(coordinateReadingItemAtURL:options:writingItemAtURL:options:error:byAccessor:)] + pub unsafe fn coordinateReadingItemAtURL_options_writingItemAtURL_options_error_byAccessor( + &self, + readingURL: &NSURL, + readingOptions: NSFileCoordinatorReadingOptions, + writingURL: &NSURL, + writingOptions: NSFileCoordinatorWritingOptions, + outError: *mut *mut NSError, + readerWriter: &Block<(NonNull, NonNull), ()>, + ); + + #[method(coordinateWritingItemAtURL:options:writingItemAtURL:options:error:byAccessor:)] + pub unsafe fn coordinateWritingItemAtURL_options_writingItemAtURL_options_error_byAccessor( + &self, + url1: &NSURL, + options1: NSFileCoordinatorWritingOptions, + url2: &NSURL, + options2: NSFileCoordinatorWritingOptions, + outError: *mut *mut NSError, + writer: &Block<(NonNull, NonNull), ()>, + ); + + #[method(prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:)] + pub unsafe fn prepareForReadingItemsAtURLs_options_writingItemsAtURLs_options_error_byAccessor( + &self, + readingURLs: &NSArray, + readingOptions: NSFileCoordinatorReadingOptions, + writingURLs: &NSArray, + writingOptions: NSFileCoordinatorWritingOptions, + outError: *mut *mut NSError, + batchAccessor: &Block<(NonNull>,), ()>, + ); + + #[method(itemAtURL:willMoveToURL:)] + pub unsafe fn itemAtURL_willMoveToURL(&self, oldURL: &NSURL, newURL: &NSURL); + + #[method(itemAtURL:didMoveToURL:)] + pub unsafe fn itemAtURL_didMoveToURL(&self, oldURL: &NSURL, newURL: &NSURL); + + #[method(itemAtURL:didChangeUbiquityAttributes:)] + pub unsafe fn itemAtURL_didChangeUbiquityAttributes( + &self, + url: &NSURL, + attributes: &NSSet, + ); + + #[method(cancel)] + pub unsafe fn cancel(&self); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSFileHandle.rs b/crates/icrate/src/generated/Foundation/NSFileHandle.rs new file mode 100644 index 000000000..55661d793 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSFileHandle.rs @@ -0,0 +1,260 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSFileHandle; + + unsafe impl ClassType for NSFileHandle { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFileHandle { + #[method_id(@__retain_semantics Other availableData)] + pub unsafe fn availableData(&self) -> Id; + + #[method_id(@__retain_semantics Init initWithFileDescriptor:closeOnDealloc:)] + pub unsafe fn initWithFileDescriptor_closeOnDealloc( + this: Option>, + fd: c_int, + closeopt: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other readDataToEndOfFileAndReturnError:)] + pub unsafe fn readDataToEndOfFileAndReturnError( + &self, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other readDataUpToLength:error:)] + pub unsafe fn readDataUpToLength_error( + &self, + length: NSUInteger, + ) -> Result, Id>; + + #[method(writeData:error:)] + pub unsafe fn writeData_error(&self, data: &NSData) -> Result<(), Id>; + + #[method(getOffset:error:)] + pub unsafe fn getOffset_error( + &self, + offsetInFile: NonNull, + ) -> Result<(), Id>; + + #[method(seekToEndReturningOffset:error:)] + pub unsafe fn seekToEndReturningOffset_error( + &self, + offsetInFile: *mut c_ulonglong, + ) -> Result<(), Id>; + + #[method(seekToOffset:error:)] + pub unsafe fn seekToOffset_error( + &self, + offset: c_ulonglong, + ) -> Result<(), Id>; + + #[method(truncateAtOffset:error:)] + pub unsafe fn truncateAtOffset_error( + &self, + offset: c_ulonglong, + ) -> Result<(), Id>; + + #[method(synchronizeAndReturnError:)] + pub unsafe fn synchronizeAndReturnError(&self) -> Result<(), Id>; + + #[method(closeAndReturnError:)] + pub unsafe fn closeAndReturnError(&self) -> Result<(), Id>; + } +); + +extern_methods!( + /// NSFileHandleCreation + unsafe impl NSFileHandle { + #[method_id(@__retain_semantics Other fileHandleWithStandardInput)] + pub unsafe fn fileHandleWithStandardInput() -> Id; + + #[method_id(@__retain_semantics Other fileHandleWithStandardOutput)] + pub unsafe fn fileHandleWithStandardOutput() -> Id; + + #[method_id(@__retain_semantics Other fileHandleWithStandardError)] + pub unsafe fn fileHandleWithStandardError() -> Id; + + #[method_id(@__retain_semantics Other fileHandleWithNullDevice)] + pub unsafe fn fileHandleWithNullDevice() -> Id; + + #[method_id(@__retain_semantics Other fileHandleForReadingAtPath:)] + pub unsafe fn fileHandleForReadingAtPath(path: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other fileHandleForWritingAtPath:)] + pub unsafe fn fileHandleForWritingAtPath(path: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other fileHandleForUpdatingAtPath:)] + pub unsafe fn fileHandleForUpdatingAtPath(path: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other fileHandleForReadingFromURL:error:)] + pub unsafe fn fileHandleForReadingFromURL_error( + url: &NSURL, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other fileHandleForWritingToURL:error:)] + pub unsafe fn fileHandleForWritingToURL_error( + url: &NSURL, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other fileHandleForUpdatingURL:error:)] + pub unsafe fn fileHandleForUpdatingURL_error( + url: &NSURL, + ) -> Result, Id>; + } +); + +extern_static!(NSFileHandleOperationException: &'static NSExceptionName); + +extern_static!(NSFileHandleReadCompletionNotification: &'static NSNotificationName); + +extern_static!(NSFileHandleReadToEndOfFileCompletionNotification: &'static NSNotificationName); + +extern_static!(NSFileHandleConnectionAcceptedNotification: &'static NSNotificationName); + +extern_static!(NSFileHandleDataAvailableNotification: &'static NSNotificationName); + +extern_static!(NSFileHandleNotificationDataItem: &'static NSString); + +extern_static!(NSFileHandleNotificationFileHandleItem: &'static NSString); + +extern_static!(NSFileHandleNotificationMonitorModes: &'static NSString); + +extern_methods!( + /// NSFileHandleAsynchronousAccess + unsafe impl NSFileHandle { + #[method(readInBackgroundAndNotifyForModes:)] + pub unsafe fn readInBackgroundAndNotifyForModes( + &self, + modes: Option<&NSArray>, + ); + + #[method(readInBackgroundAndNotify)] + pub unsafe fn readInBackgroundAndNotify(&self); + + #[method(readToEndOfFileInBackgroundAndNotifyForModes:)] + pub unsafe fn readToEndOfFileInBackgroundAndNotifyForModes( + &self, + modes: Option<&NSArray>, + ); + + #[method(readToEndOfFileInBackgroundAndNotify)] + pub unsafe fn readToEndOfFileInBackgroundAndNotify(&self); + + #[method(acceptConnectionInBackgroundAndNotifyForModes:)] + pub unsafe fn acceptConnectionInBackgroundAndNotifyForModes( + &self, + modes: Option<&NSArray>, + ); + + #[method(acceptConnectionInBackgroundAndNotify)] + pub unsafe fn acceptConnectionInBackgroundAndNotify(&self); + + #[method(waitForDataInBackgroundAndNotifyForModes:)] + pub unsafe fn waitForDataInBackgroundAndNotifyForModes( + &self, + modes: Option<&NSArray>, + ); + + #[method(waitForDataInBackgroundAndNotify)] + pub unsafe fn waitForDataInBackgroundAndNotify(&self); + + #[method(readabilityHandler)] + pub unsafe fn readabilityHandler(&self) -> *mut Block<(NonNull,), ()>; + + #[method(setReadabilityHandler:)] + pub unsafe fn setReadabilityHandler( + &self, + readabilityHandler: Option<&Block<(NonNull,), ()>>, + ); + + #[method(writeabilityHandler)] + pub unsafe fn writeabilityHandler(&self) -> *mut Block<(NonNull,), ()>; + + #[method(setWriteabilityHandler:)] + pub unsafe fn setWriteabilityHandler( + &self, + writeabilityHandler: Option<&Block<(NonNull,), ()>>, + ); + } +); + +extern_methods!( + /// NSFileHandlePlatformSpecific + unsafe impl NSFileHandle { + #[method_id(@__retain_semantics Init initWithFileDescriptor:)] + pub unsafe fn initWithFileDescriptor( + this: Option>, + fd: c_int, + ) -> Id; + + #[method(fileDescriptor)] + pub unsafe fn fileDescriptor(&self) -> c_int; + } +); + +extern_methods!( + unsafe impl NSFileHandle { + #[method_id(@__retain_semantics Other readDataToEndOfFile)] + pub unsafe fn readDataToEndOfFile(&self) -> Id; + + #[method_id(@__retain_semantics Other readDataOfLength:)] + pub unsafe fn readDataOfLength(&self, length: NSUInteger) -> Id; + + #[method(writeData:)] + pub unsafe fn writeData(&self, data: &NSData); + + #[method(offsetInFile)] + pub unsafe fn offsetInFile(&self) -> c_ulonglong; + + #[method(seekToEndOfFile)] + pub unsafe fn seekToEndOfFile(&self) -> c_ulonglong; + + #[method(seekToFileOffset:)] + pub unsafe fn seekToFileOffset(&self, offset: c_ulonglong); + + #[method(truncateFileAtOffset:)] + pub unsafe fn truncateFileAtOffset(&self, offset: c_ulonglong); + + #[method(synchronizeFile)] + pub unsafe fn synchronizeFile(&self); + + #[method(closeFile)] + pub unsafe fn closeFile(&self); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPipe; + + unsafe impl ClassType for NSPipe { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPipe { + #[method_id(@__retain_semantics Other fileHandleForReading)] + pub unsafe fn fileHandleForReading(&self) -> Id; + + #[method_id(@__retain_semantics Other fileHandleForWriting)] + pub unsafe fn fileHandleForWriting(&self) -> Id; + + #[method_id(@__retain_semantics Other pipe)] + pub unsafe fn pipe() -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSFileManager.rs b/crates/icrate/src/generated/Foundation/NSFileManager.rs new file mode 100644 index 000000000..cd6dd0bfe --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSFileManager.rs @@ -0,0 +1,860 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSFileAttributeKey = NSString; + +pub type NSFileAttributeType = NSString; + +pub type NSFileProtectionType = NSString; + +pub type NSFileProviderServiceName = NSString; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSVolumeEnumerationOptions { + NSVolumeEnumerationSkipHiddenVolumes = 1 << 1, + NSVolumeEnumerationProduceFileReferenceURLs = 1 << 2, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSDirectoryEnumerationOptions { + NSDirectoryEnumerationSkipsSubdirectoryDescendants = 1 << 0, + NSDirectoryEnumerationSkipsPackageDescendants = 1 << 1, + NSDirectoryEnumerationSkipsHiddenFiles = 1 << 2, + NSDirectoryEnumerationIncludesDirectoriesPostOrder = 1 << 3, + NSDirectoryEnumerationProducesRelativePathURLs = 1 << 4, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFileManagerItemReplacementOptions { + NSFileManagerItemReplacementUsingNewMetadataOnly = 1 << 0, + NSFileManagerItemReplacementWithoutDeletingBackupItem = 1 << 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSURLRelationship { + NSURLRelationshipContains = 0, + NSURLRelationshipSame = 1, + NSURLRelationshipOther = 2, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFileManagerUnmountOptions { + NSFileManagerUnmountAllPartitionsAndEjectDisk = 1 << 0, + NSFileManagerUnmountWithoutUI = 1 << 1, + } +); + +extern_static!(NSFileManagerUnmountDissentingProcessIdentifierErrorKey: &'static NSString); + +extern_static!(NSUbiquityIdentityDidChangeNotification: &'static NSNotificationName); + +extern_class!( + #[derive(Debug)] + pub struct NSFileManager; + + unsafe impl ClassType for NSFileManager { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFileManager { + #[method_id(@__retain_semantics Other defaultManager)] + pub unsafe fn defaultManager() -> Id; + + #[method_id(@__retain_semantics Other mountedVolumeURLsIncludingResourceValuesForKeys:options:)] + pub unsafe fn mountedVolumeURLsIncludingResourceValuesForKeys_options( + &self, + propertyKeys: Option<&NSArray>, + options: NSVolumeEnumerationOptions, + ) -> Option, Shared>>; + + #[method(unmountVolumeAtURL:options:completionHandler:)] + pub unsafe fn unmountVolumeAtURL_options_completionHandler( + &self, + url: &NSURL, + mask: NSFileManagerUnmountOptions, + completionHandler: &Block<(*mut NSError,), ()>, + ); + + #[method_id(@__retain_semantics Other contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:)] + pub unsafe fn contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error( + &self, + url: &NSURL, + keys: Option<&NSArray>, + mask: NSDirectoryEnumerationOptions, + ) -> Result, Shared>, Id>; + + #[method_id(@__retain_semantics Other URLsForDirectory:inDomains:)] + pub unsafe fn URLsForDirectory_inDomains( + &self, + directory: NSSearchPathDirectory, + domainMask: NSSearchPathDomainMask, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other URLForDirectory:inDomain:appropriateForURL:create:error:)] + pub unsafe fn URLForDirectory_inDomain_appropriateForURL_create_error( + &self, + directory: NSSearchPathDirectory, + domain: NSSearchPathDomainMask, + url: Option<&NSURL>, + shouldCreate: bool, + ) -> Result, Id>; + + #[method(getRelationship:ofDirectoryAtURL:toItemAtURL:error:)] + pub unsafe fn getRelationship_ofDirectoryAtURL_toItemAtURL_error( + &self, + outRelationship: NonNull, + directoryURL: &NSURL, + otherURL: &NSURL, + ) -> Result<(), Id>; + + #[method(getRelationship:ofDirectory:inDomain:toItemAtURL:error:)] + pub unsafe fn getRelationship_ofDirectory_inDomain_toItemAtURL_error( + &self, + outRelationship: NonNull, + directory: NSSearchPathDirectory, + domainMask: NSSearchPathDomainMask, + url: &NSURL, + ) -> Result<(), Id>; + + #[method(createDirectoryAtURL:withIntermediateDirectories:attributes:error:)] + pub unsafe fn createDirectoryAtURL_withIntermediateDirectories_attributes_error( + &self, + url: &NSURL, + createIntermediates: bool, + attributes: Option<&NSDictionary>, + ) -> Result<(), Id>; + + #[method(createSymbolicLinkAtURL:withDestinationURL:error:)] + pub unsafe fn createSymbolicLinkAtURL_withDestinationURL_error( + &self, + url: &NSURL, + destURL: &NSURL, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSFileManagerDelegate>); + + #[method(setAttributes:ofItemAtPath:error:)] + pub unsafe fn setAttributes_ofItemAtPath_error( + &self, + attributes: &NSDictionary, + path: &NSString, + ) -> Result<(), Id>; + + #[method(createDirectoryAtPath:withIntermediateDirectories:attributes:error:)] + pub unsafe fn createDirectoryAtPath_withIntermediateDirectories_attributes_error( + &self, + path: &NSString, + createIntermediates: bool, + attributes: Option<&NSDictionary>, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other contentsOfDirectoryAtPath:error:)] + pub unsafe fn contentsOfDirectoryAtPath_error( + &self, + path: &NSString, + ) -> Result, Shared>, Id>; + + #[method_id(@__retain_semantics Other subpathsOfDirectoryAtPath:error:)] + pub unsafe fn subpathsOfDirectoryAtPath_error( + &self, + path: &NSString, + ) -> Result, Shared>, Id>; + + #[method_id(@__retain_semantics Other attributesOfItemAtPath:error:)] + pub unsafe fn attributesOfItemAtPath_error( + &self, + path: &NSString, + ) -> Result, Shared>, Id>; + + #[method_id(@__retain_semantics Other attributesOfFileSystemForPath:error:)] + pub unsafe fn attributesOfFileSystemForPath_error( + &self, + path: &NSString, + ) -> Result, Shared>, Id>; + + #[method(createSymbolicLinkAtPath:withDestinationPath:error:)] + pub unsafe fn createSymbolicLinkAtPath_withDestinationPath_error( + &self, + path: &NSString, + destPath: &NSString, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other destinationOfSymbolicLinkAtPath:error:)] + pub unsafe fn destinationOfSymbolicLinkAtPath_error( + &self, + path: &NSString, + ) -> Result, Id>; + + #[method(copyItemAtPath:toPath:error:)] + pub unsafe fn copyItemAtPath_toPath_error( + &self, + srcPath: &NSString, + dstPath: &NSString, + ) -> Result<(), Id>; + + #[method(moveItemAtPath:toPath:error:)] + pub unsafe fn moveItemAtPath_toPath_error( + &self, + srcPath: &NSString, + dstPath: &NSString, + ) -> Result<(), Id>; + + #[method(linkItemAtPath:toPath:error:)] + pub unsafe fn linkItemAtPath_toPath_error( + &self, + srcPath: &NSString, + dstPath: &NSString, + ) -> Result<(), Id>; + + #[method(removeItemAtPath:error:)] + pub unsafe fn removeItemAtPath_error( + &self, + path: &NSString, + ) -> Result<(), Id>; + + #[method(copyItemAtURL:toURL:error:)] + pub unsafe fn copyItemAtURL_toURL_error( + &self, + srcURL: &NSURL, + dstURL: &NSURL, + ) -> Result<(), Id>; + + #[method(moveItemAtURL:toURL:error:)] + pub unsafe fn moveItemAtURL_toURL_error( + &self, + srcURL: &NSURL, + dstURL: &NSURL, + ) -> Result<(), Id>; + + #[method(linkItemAtURL:toURL:error:)] + pub unsafe fn linkItemAtURL_toURL_error( + &self, + srcURL: &NSURL, + dstURL: &NSURL, + ) -> Result<(), Id>; + + #[method(removeItemAtURL:error:)] + pub unsafe fn removeItemAtURL_error(&self, URL: &NSURL) -> Result<(), Id>; + + #[method(trashItemAtURL:resultingItemURL:error:)] + pub unsafe fn trashItemAtURL_resultingItemURL_error( + &self, + url: &NSURL, + outResultingURL: *mut *mut NSURL, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other fileAttributesAtPath:traverseLink:)] + pub unsafe fn fileAttributesAtPath_traverseLink( + &self, + path: &NSString, + yorn: bool, + ) -> Option>; + + #[method(changeFileAttributes:atPath:)] + pub unsafe fn changeFileAttributes_atPath( + &self, + attributes: &NSDictionary, + path: &NSString, + ) -> bool; + + #[method_id(@__retain_semantics Other directoryContentsAtPath:)] + pub unsafe fn directoryContentsAtPath( + &self, + path: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other fileSystemAttributesAtPath:)] + pub unsafe fn fileSystemAttributesAtPath( + &self, + path: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other pathContentOfSymbolicLinkAtPath:)] + pub unsafe fn pathContentOfSymbolicLinkAtPath( + &self, + path: &NSString, + ) -> Option>; + + #[method(createSymbolicLinkAtPath:pathContent:)] + pub unsafe fn createSymbolicLinkAtPath_pathContent( + &self, + path: &NSString, + otherpath: &NSString, + ) -> bool; + + #[method(createDirectoryAtPath:attributes:)] + pub unsafe fn createDirectoryAtPath_attributes( + &self, + path: &NSString, + attributes: &NSDictionary, + ) -> bool; + + #[method(linkPath:toPath:handler:)] + pub unsafe fn linkPath_toPath_handler( + &self, + src: &NSString, + dest: &NSString, + handler: Option<&Object>, + ) -> bool; + + #[method(copyPath:toPath:handler:)] + pub unsafe fn copyPath_toPath_handler( + &self, + src: &NSString, + dest: &NSString, + handler: Option<&Object>, + ) -> bool; + + #[method(movePath:toPath:handler:)] + pub unsafe fn movePath_toPath_handler( + &self, + src: &NSString, + dest: &NSString, + handler: Option<&Object>, + ) -> bool; + + #[method(removeFileAtPath:handler:)] + pub unsafe fn removeFileAtPath_handler( + &self, + path: &NSString, + handler: Option<&Object>, + ) -> bool; + + #[method_id(@__retain_semantics Other currentDirectoryPath)] + pub unsafe fn currentDirectoryPath(&self) -> Id; + + #[method(changeCurrentDirectoryPath:)] + pub unsafe fn changeCurrentDirectoryPath(&self, path: &NSString) -> bool; + + #[method(fileExistsAtPath:)] + pub unsafe fn fileExistsAtPath(&self, path: &NSString) -> bool; + + #[method(fileExistsAtPath:isDirectory:)] + pub unsafe fn fileExistsAtPath_isDirectory( + &self, + path: &NSString, + isDirectory: *mut Bool, + ) -> bool; + + #[method(isReadableFileAtPath:)] + pub unsafe fn isReadableFileAtPath(&self, path: &NSString) -> bool; + + #[method(isWritableFileAtPath:)] + pub unsafe fn isWritableFileAtPath(&self, path: &NSString) -> bool; + + #[method(isExecutableFileAtPath:)] + pub unsafe fn isExecutableFileAtPath(&self, path: &NSString) -> bool; + + #[method(isDeletableFileAtPath:)] + pub unsafe fn isDeletableFileAtPath(&self, path: &NSString) -> bool; + + #[method(contentsEqualAtPath:andPath:)] + pub unsafe fn contentsEqualAtPath_andPath( + &self, + path1: &NSString, + path2: &NSString, + ) -> bool; + + #[method_id(@__retain_semantics Other displayNameAtPath:)] + pub unsafe fn displayNameAtPath(&self, path: &NSString) -> Id; + + #[method_id(@__retain_semantics Other componentsToDisplayForPath:)] + pub unsafe fn componentsToDisplayForPath( + &self, + path: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other enumeratorAtPath:)] + pub unsafe fn enumeratorAtPath( + &self, + path: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:)] + pub unsafe fn enumeratorAtURL_includingPropertiesForKeys_options_errorHandler( + &self, + url: &NSURL, + keys: Option<&NSArray>, + mask: NSDirectoryEnumerationOptions, + handler: Option<&Block<(NonNull, NonNull), Bool>>, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other subpathsAtPath:)] + pub unsafe fn subpathsAtPath( + &self, + path: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other contentsAtPath:)] + pub unsafe fn contentsAtPath(&self, path: &NSString) -> Option>; + + #[method(createFileAtPath:contents:attributes:)] + pub unsafe fn createFileAtPath_contents_attributes( + &self, + path: &NSString, + data: Option<&NSData>, + attr: Option<&NSDictionary>, + ) -> bool; + + #[method(fileSystemRepresentationWithPath:)] + pub unsafe fn fileSystemRepresentationWithPath(&self, path: &NSString) -> NonNull; + + #[method_id(@__retain_semantics Other stringWithFileSystemRepresentation:length:)] + pub unsafe fn stringWithFileSystemRepresentation_length( + &self, + str: NonNull, + len: NSUInteger, + ) -> Id; + + #[method(replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:)] + pub unsafe fn replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error( + &self, + originalItemURL: &NSURL, + newItemURL: &NSURL, + backupItemName: Option<&NSString>, + options: NSFileManagerItemReplacementOptions, + resultingURL: *mut *mut NSURL, + ) -> Result<(), Id>; + + #[method(setUbiquitous:itemAtURL:destinationURL:error:)] + pub unsafe fn setUbiquitous_itemAtURL_destinationURL_error( + &self, + flag: bool, + url: &NSURL, + destinationURL: &NSURL, + ) -> Result<(), Id>; + + #[method(isUbiquitousItemAtURL:)] + pub unsafe fn isUbiquitousItemAtURL(&self, url: &NSURL) -> bool; + + #[method(startDownloadingUbiquitousItemAtURL:error:)] + pub unsafe fn startDownloadingUbiquitousItemAtURL_error( + &self, + url: &NSURL, + ) -> Result<(), Id>; + + #[method(evictUbiquitousItemAtURL:error:)] + pub unsafe fn evictUbiquitousItemAtURL_error( + &self, + url: &NSURL, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other URLForUbiquityContainerIdentifier:)] + pub unsafe fn URLForUbiquityContainerIdentifier( + &self, + containerIdentifier: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLForPublishingUbiquitousItemAtURL:expirationDate:error:)] + pub unsafe fn URLForPublishingUbiquitousItemAtURL_expirationDate_error( + &self, + url: &NSURL, + outDate: *mut *mut NSDate, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other ubiquityIdentityToken)] + pub unsafe fn ubiquityIdentityToken(&self) -> Option>; + + #[method(getFileProviderServicesForItemAtURL:completionHandler:)] + pub unsafe fn getFileProviderServicesForItemAtURL_completionHandler( + &self, + url: &NSURL, + completionHandler: &Block< + ( + *mut NSDictionary, + *mut NSError, + ), + (), + >, + ); + + #[method_id(@__retain_semantics Other containerURLForSecurityApplicationGroupIdentifier:)] + pub unsafe fn containerURLForSecurityApplicationGroupIdentifier( + &self, + groupIdentifier: &NSString, + ) -> Option>; + } +); + +extern_methods!( + /// NSUserInformation + unsafe impl NSFileManager { + #[method_id(@__retain_semantics Other homeDirectoryForCurrentUser)] + pub unsafe fn homeDirectoryForCurrentUser(&self) -> Id; + + #[method_id(@__retain_semantics Other temporaryDirectory)] + pub unsafe fn temporaryDirectory(&self) -> Id; + + #[method_id(@__retain_semantics Other homeDirectoryForUser:)] + pub unsafe fn homeDirectoryForUser(&self, userName: &NSString) + -> Option>; + } +); + +extern_methods!( + /// NSCopyLinkMoveHandler + unsafe impl NSObject { + #[method(fileManager:shouldProceedAfterError:)] + pub unsafe fn fileManager_shouldProceedAfterError( + &self, + fm: &NSFileManager, + errorInfo: &NSDictionary, + ) -> bool; + + #[method(fileManager:willProcessPath:)] + pub unsafe fn fileManager_willProcessPath(&self, fm: &NSFileManager, path: &NSString); + } +); + +extern_protocol!( + pub struct NSFileManagerDelegate; + + unsafe impl NSFileManagerDelegate { + #[optional] + #[method(fileManager:shouldCopyItemAtPath:toPath:)] + pub unsafe fn fileManager_shouldCopyItemAtPath_toPath( + &self, + fileManager: &NSFileManager, + srcPath: &NSString, + dstPath: &NSString, + ) -> bool; + + #[optional] + #[method(fileManager:shouldCopyItemAtURL:toURL:)] + pub unsafe fn fileManager_shouldCopyItemAtURL_toURL( + &self, + fileManager: &NSFileManager, + srcURL: &NSURL, + dstURL: &NSURL, + ) -> bool; + + #[optional] + #[method(fileManager:shouldProceedAfterError:copyingItemAtPath:toPath:)] + pub unsafe fn fileManager_shouldProceedAfterError_copyingItemAtPath_toPath( + &self, + fileManager: &NSFileManager, + error: &NSError, + srcPath: &NSString, + dstPath: &NSString, + ) -> bool; + + #[optional] + #[method(fileManager:shouldProceedAfterError:copyingItemAtURL:toURL:)] + pub unsafe fn fileManager_shouldProceedAfterError_copyingItemAtURL_toURL( + &self, + fileManager: &NSFileManager, + error: &NSError, + srcURL: &NSURL, + dstURL: &NSURL, + ) -> bool; + + #[optional] + #[method(fileManager:shouldMoveItemAtPath:toPath:)] + pub unsafe fn fileManager_shouldMoveItemAtPath_toPath( + &self, + fileManager: &NSFileManager, + srcPath: &NSString, + dstPath: &NSString, + ) -> bool; + + #[optional] + #[method(fileManager:shouldMoveItemAtURL:toURL:)] + pub unsafe fn fileManager_shouldMoveItemAtURL_toURL( + &self, + fileManager: &NSFileManager, + srcURL: &NSURL, + dstURL: &NSURL, + ) -> bool; + + #[optional] + #[method(fileManager:shouldProceedAfterError:movingItemAtPath:toPath:)] + pub unsafe fn fileManager_shouldProceedAfterError_movingItemAtPath_toPath( + &self, + fileManager: &NSFileManager, + error: &NSError, + srcPath: &NSString, + dstPath: &NSString, + ) -> bool; + + #[optional] + #[method(fileManager:shouldProceedAfterError:movingItemAtURL:toURL:)] + pub unsafe fn fileManager_shouldProceedAfterError_movingItemAtURL_toURL( + &self, + fileManager: &NSFileManager, + error: &NSError, + srcURL: &NSURL, + dstURL: &NSURL, + ) -> bool; + + #[optional] + #[method(fileManager:shouldLinkItemAtPath:toPath:)] + pub unsafe fn fileManager_shouldLinkItemAtPath_toPath( + &self, + fileManager: &NSFileManager, + srcPath: &NSString, + dstPath: &NSString, + ) -> bool; + + #[optional] + #[method(fileManager:shouldLinkItemAtURL:toURL:)] + pub unsafe fn fileManager_shouldLinkItemAtURL_toURL( + &self, + fileManager: &NSFileManager, + srcURL: &NSURL, + dstURL: &NSURL, + ) -> bool; + + #[optional] + #[method(fileManager:shouldProceedAfterError:linkingItemAtPath:toPath:)] + pub unsafe fn fileManager_shouldProceedAfterError_linkingItemAtPath_toPath( + &self, + fileManager: &NSFileManager, + error: &NSError, + srcPath: &NSString, + dstPath: &NSString, + ) -> bool; + + #[optional] + #[method(fileManager:shouldProceedAfterError:linkingItemAtURL:toURL:)] + pub unsafe fn fileManager_shouldProceedAfterError_linkingItemAtURL_toURL( + &self, + fileManager: &NSFileManager, + error: &NSError, + srcURL: &NSURL, + dstURL: &NSURL, + ) -> bool; + + #[optional] + #[method(fileManager:shouldRemoveItemAtPath:)] + pub unsafe fn fileManager_shouldRemoveItemAtPath( + &self, + fileManager: &NSFileManager, + path: &NSString, + ) -> bool; + + #[optional] + #[method(fileManager:shouldRemoveItemAtURL:)] + pub unsafe fn fileManager_shouldRemoveItemAtURL( + &self, + fileManager: &NSFileManager, + URL: &NSURL, + ) -> bool; + + #[optional] + #[method(fileManager:shouldProceedAfterError:removingItemAtPath:)] + pub unsafe fn fileManager_shouldProceedAfterError_removingItemAtPath( + &self, + fileManager: &NSFileManager, + error: &NSError, + path: &NSString, + ) -> bool; + + #[optional] + #[method(fileManager:shouldProceedAfterError:removingItemAtURL:)] + pub unsafe fn fileManager_shouldProceedAfterError_removingItemAtURL( + &self, + fileManager: &NSFileManager, + error: &NSError, + URL: &NSURL, + ) -> bool; + } +); + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSDirectoryEnumerator { + _inner0: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSDirectoryEnumerator { + type Super = NSEnumerator; + } +); + +extern_methods!( + unsafe impl NSDirectoryEnumerator { + #[method_id(@__retain_semantics Other fileAttributes)] + pub unsafe fn fileAttributes( + &self, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other directoryAttributes)] + pub unsafe fn directoryAttributes( + &self, + ) -> Option, Shared>>; + + #[method(isEnumeratingDirectoryPostOrder)] + pub unsafe fn isEnumeratingDirectoryPostOrder(&self) -> bool; + + #[method(skipDescendents)] + pub unsafe fn skipDescendents(&self); + + #[method(level)] + pub unsafe fn level(&self) -> NSUInteger; + + #[method(skipDescendants)] + pub unsafe fn skipDescendants(&self); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSFileProviderService; + + unsafe impl ClassType for NSFileProviderService { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFileProviderService { + #[method(getFileProviderConnectionWithCompletionHandler:)] + pub unsafe fn getFileProviderConnectionWithCompletionHandler( + &self, + completionHandler: &Block<(*mut NSXPCConnection, *mut NSError), ()>, + ); + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + } +); + +extern_static!(NSFileType: &'static NSFileAttributeKey); + +extern_static!(NSFileTypeDirectory: &'static NSFileAttributeType); + +extern_static!(NSFileTypeRegular: &'static NSFileAttributeType); + +extern_static!(NSFileTypeSymbolicLink: &'static NSFileAttributeType); + +extern_static!(NSFileTypeSocket: &'static NSFileAttributeType); + +extern_static!(NSFileTypeCharacterSpecial: &'static NSFileAttributeType); + +extern_static!(NSFileTypeBlockSpecial: &'static NSFileAttributeType); + +extern_static!(NSFileTypeUnknown: &'static NSFileAttributeType); + +extern_static!(NSFileSize: &'static NSFileAttributeKey); + +extern_static!(NSFileModificationDate: &'static NSFileAttributeKey); + +extern_static!(NSFileReferenceCount: &'static NSFileAttributeKey); + +extern_static!(NSFileDeviceIdentifier: &'static NSFileAttributeKey); + +extern_static!(NSFileOwnerAccountName: &'static NSFileAttributeKey); + +extern_static!(NSFileGroupOwnerAccountName: &'static NSFileAttributeKey); + +extern_static!(NSFilePosixPermissions: &'static NSFileAttributeKey); + +extern_static!(NSFileSystemNumber: &'static NSFileAttributeKey); + +extern_static!(NSFileSystemFileNumber: &'static NSFileAttributeKey); + +extern_static!(NSFileExtensionHidden: &'static NSFileAttributeKey); + +extern_static!(NSFileHFSCreatorCode: &'static NSFileAttributeKey); + +extern_static!(NSFileHFSTypeCode: &'static NSFileAttributeKey); + +extern_static!(NSFileImmutable: &'static NSFileAttributeKey); + +extern_static!(NSFileAppendOnly: &'static NSFileAttributeKey); + +extern_static!(NSFileCreationDate: &'static NSFileAttributeKey); + +extern_static!(NSFileOwnerAccountID: &'static NSFileAttributeKey); + +extern_static!(NSFileGroupOwnerAccountID: &'static NSFileAttributeKey); + +extern_static!(NSFileBusy: &'static NSFileAttributeKey); + +extern_static!(NSFileProtectionKey: &'static NSFileAttributeKey); + +extern_static!(NSFileProtectionNone: &'static NSFileProtectionType); + +extern_static!(NSFileProtectionComplete: &'static NSFileProtectionType); + +extern_static!(NSFileProtectionCompleteUnlessOpen: &'static NSFileProtectionType); + +extern_static!(NSFileProtectionCompleteUntilFirstUserAuthentication: &'static NSFileProtectionType); + +extern_static!(NSFileSystemSize: &'static NSFileAttributeKey); + +extern_static!(NSFileSystemFreeSize: &'static NSFileAttributeKey); + +extern_static!(NSFileSystemNodes: &'static NSFileAttributeKey); + +extern_static!(NSFileSystemFreeNodes: &'static NSFileAttributeKey); + +extern_methods!( + /// NSFileAttributes + unsafe impl NSDictionary { + #[method(fileSize)] + pub unsafe fn fileSize(&self) -> c_ulonglong; + + #[method_id(@__retain_semantics Other fileModificationDate)] + pub unsafe fn fileModificationDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other fileType)] + pub unsafe fn fileType(&self) -> Option>; + + #[method(filePosixPermissions)] + pub unsafe fn filePosixPermissions(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other fileOwnerAccountName)] + pub unsafe fn fileOwnerAccountName(&self) -> Option>; + + #[method_id(@__retain_semantics Other fileGroupOwnerAccountName)] + pub unsafe fn fileGroupOwnerAccountName(&self) -> Option>; + + #[method(fileSystemNumber)] + pub unsafe fn fileSystemNumber(&self) -> NSInteger; + + #[method(fileSystemFileNumber)] + pub unsafe fn fileSystemFileNumber(&self) -> NSUInteger; + + #[method(fileExtensionHidden)] + pub unsafe fn fileExtensionHidden(&self) -> bool; + + #[method(fileHFSCreatorCode)] + pub unsafe fn fileHFSCreatorCode(&self) -> OSType; + + #[method(fileHFSTypeCode)] + pub unsafe fn fileHFSTypeCode(&self) -> OSType; + + #[method(fileIsImmutable)] + pub unsafe fn fileIsImmutable(&self) -> bool; + + #[method(fileIsAppendOnly)] + pub unsafe fn fileIsAppendOnly(&self) -> bool; + + #[method_id(@__retain_semantics Other fileCreationDate)] + pub unsafe fn fileCreationDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other fileOwnerAccountID)] + pub unsafe fn fileOwnerAccountID(&self) -> Option>; + + #[method_id(@__retain_semantics Other fileGroupOwnerAccountID)] + pub unsafe fn fileGroupOwnerAccountID(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSFilePresenter.rs b/crates/icrate/src/generated/Foundation/NSFilePresenter.rs new file mode 100644 index 000000000..692cac802 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSFilePresenter.rs @@ -0,0 +1,125 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSFilePresenter; + + unsafe impl NSFilePresenter { + #[method_id(@__retain_semantics Other presentedItemURL)] + pub unsafe fn presentedItemURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other presentedItemOperationQueue)] + pub unsafe fn presentedItemOperationQueue(&self) -> Id; + + #[optional] + #[method_id(@__retain_semantics Other primaryPresentedItemURL)] + pub unsafe fn primaryPresentedItemURL(&self) -> Option>; + + #[optional] + #[method(relinquishPresentedItemToReader:)] + pub unsafe fn relinquishPresentedItemToReader( + &self, + reader: &Block<(*mut Block<(), ()>,), ()>, + ); + + #[optional] + #[method(relinquishPresentedItemToWriter:)] + pub unsafe fn relinquishPresentedItemToWriter( + &self, + writer: &Block<(*mut Block<(), ()>,), ()>, + ); + + #[optional] + #[method(savePresentedItemChangesWithCompletionHandler:)] + pub unsafe fn savePresentedItemChangesWithCompletionHandler( + &self, + completionHandler: &Block<(*mut NSError,), ()>, + ); + + #[optional] + #[method(accommodatePresentedItemDeletionWithCompletionHandler:)] + pub unsafe fn accommodatePresentedItemDeletionWithCompletionHandler( + &self, + completionHandler: &Block<(*mut NSError,), ()>, + ); + + #[optional] + #[method(presentedItemDidMoveToURL:)] + pub unsafe fn presentedItemDidMoveToURL(&self, newURL: &NSURL); + + #[optional] + #[method(presentedItemDidChange)] + pub unsafe fn presentedItemDidChange(&self); + + #[optional] + #[method(presentedItemDidChangeUbiquityAttributes:)] + pub unsafe fn presentedItemDidChangeUbiquityAttributes( + &self, + attributes: &NSSet, + ); + + #[optional] + #[method_id(@__retain_semantics Other observedPresentedItemUbiquityAttributes)] + pub unsafe fn observedPresentedItemUbiquityAttributes( + &self, + ) -> Id, Shared>; + + #[optional] + #[method(presentedItemDidGainVersion:)] + pub unsafe fn presentedItemDidGainVersion(&self, version: &NSFileVersion); + + #[optional] + #[method(presentedItemDidLoseVersion:)] + pub unsafe fn presentedItemDidLoseVersion(&self, version: &NSFileVersion); + + #[optional] + #[method(presentedItemDidResolveConflictVersion:)] + pub unsafe fn presentedItemDidResolveConflictVersion(&self, version: &NSFileVersion); + + #[optional] + #[method(accommodatePresentedSubitemDeletionAtURL:completionHandler:)] + pub unsafe fn accommodatePresentedSubitemDeletionAtURL_completionHandler( + &self, + url: &NSURL, + completionHandler: &Block<(*mut NSError,), ()>, + ); + + #[optional] + #[method(presentedSubitemDidAppearAtURL:)] + pub unsafe fn presentedSubitemDidAppearAtURL(&self, url: &NSURL); + + #[optional] + #[method(presentedSubitemAtURL:didMoveToURL:)] + pub unsafe fn presentedSubitemAtURL_didMoveToURL(&self, oldURL: &NSURL, newURL: &NSURL); + + #[optional] + #[method(presentedSubitemDidChangeAtURL:)] + pub unsafe fn presentedSubitemDidChangeAtURL(&self, url: &NSURL); + + #[optional] + #[method(presentedSubitemAtURL:didGainVersion:)] + pub unsafe fn presentedSubitemAtURL_didGainVersion( + &self, + url: &NSURL, + version: &NSFileVersion, + ); + + #[optional] + #[method(presentedSubitemAtURL:didLoseVersion:)] + pub unsafe fn presentedSubitemAtURL_didLoseVersion( + &self, + url: &NSURL, + version: &NSFileVersion, + ); + + #[optional] + #[method(presentedSubitemAtURL:didResolveConflictVersion:)] + pub unsafe fn presentedSubitemAtURL_didResolveConflictVersion( + &self, + url: &NSURL, + version: &NSFileVersion, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSFileVersion.rs b/crates/icrate/src/generated/Foundation/NSFileVersion.rs new file mode 100644 index 000000000..c0f4be513 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSFileVersion.rs @@ -0,0 +1,123 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFileVersionAddingOptions { + NSFileVersionAddingByMoving = 1 << 0, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFileVersionReplacingOptions { + NSFileVersionReplacingByMoving = 1 << 0, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSFileVersion; + + unsafe impl ClassType for NSFileVersion { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFileVersion { + #[method_id(@__retain_semantics Other currentVersionOfItemAtURL:)] + pub unsafe fn currentVersionOfItemAtURL(url: &NSURL) -> Option>; + + #[method_id(@__retain_semantics Other otherVersionsOfItemAtURL:)] + pub unsafe fn otherVersionsOfItemAtURL( + url: &NSURL, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other unresolvedConflictVersionsOfItemAtURL:)] + pub unsafe fn unresolvedConflictVersionsOfItemAtURL( + url: &NSURL, + ) -> Option, Shared>>; + + #[method(getNonlocalVersionsOfItemAtURL:completionHandler:)] + pub unsafe fn getNonlocalVersionsOfItemAtURL_completionHandler( + url: &NSURL, + completionHandler: &Block<(*mut NSArray, *mut NSError), ()>, + ); + + #[method_id(@__retain_semantics Other versionOfItemAtURL:forPersistentIdentifier:)] + pub unsafe fn versionOfItemAtURL_forPersistentIdentifier( + url: &NSURL, + persistentIdentifier: &Object, + ) -> Option>; + + #[method_id(@__retain_semantics Other addVersionOfItemAtURL:withContentsOfURL:options:error:)] + pub unsafe fn addVersionOfItemAtURL_withContentsOfURL_options_error( + url: &NSURL, + contentsURL: &NSURL, + options: NSFileVersionAddingOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other temporaryDirectoryURLForNewVersionOfItemAtURL:)] + pub unsafe fn temporaryDirectoryURLForNewVersionOfItemAtURL( + url: &NSURL, + ) -> Id; + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Id; + + #[method_id(@__retain_semantics Other localizedName)] + pub unsafe fn localizedName(&self) -> Option>; + + #[method_id(@__retain_semantics Other localizedNameOfSavingComputer)] + pub unsafe fn localizedNameOfSavingComputer(&self) -> Option>; + + #[method_id(@__retain_semantics Other originatorNameComponents)] + pub unsafe fn originatorNameComponents(&self) + -> Option>; + + #[method_id(@__retain_semantics Other modificationDate)] + pub unsafe fn modificationDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other persistentIdentifier)] + pub unsafe fn persistentIdentifier(&self) -> Id; + + #[method(isConflict)] + pub unsafe fn isConflict(&self) -> bool; + + #[method(isResolved)] + pub unsafe fn isResolved(&self) -> bool; + + #[method(setResolved:)] + pub unsafe fn setResolved(&self, resolved: bool); + + #[method(isDiscardable)] + pub unsafe fn isDiscardable(&self) -> bool; + + #[method(setDiscardable:)] + pub unsafe fn setDiscardable(&self, discardable: bool); + + #[method(hasLocalContents)] + pub unsafe fn hasLocalContents(&self) -> bool; + + #[method(hasThumbnail)] + pub unsafe fn hasThumbnail(&self) -> bool; + + #[method_id(@__retain_semantics Other replaceItemAtURL:options:error:)] + pub unsafe fn replaceItemAtURL_options_error( + &self, + url: &NSURL, + options: NSFileVersionReplacingOptions, + ) -> Result, Id>; + + #[method(removeAndReturnError:)] + pub unsafe fn removeAndReturnError(&self) -> Result<(), Id>; + + #[method(removeOtherVersionsOfItemAtURL:error:)] + pub unsafe fn removeOtherVersionsOfItemAtURL_error( + url: &NSURL, + ) -> Result<(), Id>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSFileWrapper.rs b/crates/icrate/src/generated/Foundation/NSFileWrapper.rs new file mode 100644 index 000000000..a1a76ed2b --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSFileWrapper.rs @@ -0,0 +1,192 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFileWrapperReadingOptions { + NSFileWrapperReadingImmediate = 1 << 0, + NSFileWrapperReadingWithoutMapping = 1 << 1, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSFileWrapperWritingOptions { + NSFileWrapperWritingAtomic = 1 << 0, + NSFileWrapperWritingWithNameUpdating = 1 << 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSFileWrapper; + + unsafe impl ClassType for NSFileWrapper { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFileWrapper { + #[method_id(@__retain_semantics Init initWithURL:options:error:)] + pub unsafe fn initWithURL_options_error( + this: Option>, + url: &NSURL, + options: NSFileWrapperReadingOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initDirectoryWithFileWrappers:)] + pub unsafe fn initDirectoryWithFileWrappers( + this: Option>, + childrenByPreferredName: &NSDictionary, + ) -> Id; + + #[method_id(@__retain_semantics Init initRegularFileWithContents:)] + pub unsafe fn initRegularFileWithContents( + this: Option>, + contents: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Init initSymbolicLinkWithDestinationURL:)] + pub unsafe fn initSymbolicLinkWithDestinationURL( + this: Option>, + url: &NSURL, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithSerializedRepresentation:)] + pub unsafe fn initWithSerializedRepresentation( + this: Option>, + serializeRepresentation: &NSData, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + inCoder: &NSCoder, + ) -> Option>; + + #[method(isDirectory)] + pub unsafe fn isDirectory(&self) -> bool; + + #[method(isRegularFile)] + pub unsafe fn isRegularFile(&self) -> bool; + + #[method(isSymbolicLink)] + pub unsafe fn isSymbolicLink(&self) -> bool; + + #[method_id(@__retain_semantics Other preferredFilename)] + pub unsafe fn preferredFilename(&self) -> Option>; + + #[method(setPreferredFilename:)] + pub unsafe fn setPreferredFilename(&self, preferredFilename: Option<&NSString>); + + #[method_id(@__retain_semantics Other filename)] + pub unsafe fn filename(&self) -> Option>; + + #[method(setFilename:)] + pub unsafe fn setFilename(&self, filename: Option<&NSString>); + + #[method_id(@__retain_semantics Other fileAttributes)] + pub unsafe fn fileAttributes(&self) -> Id, Shared>; + + #[method(setFileAttributes:)] + pub unsafe fn setFileAttributes(&self, fileAttributes: &NSDictionary); + + #[method(matchesContentsOfURL:)] + pub unsafe fn matchesContentsOfURL(&self, url: &NSURL) -> bool; + + #[method(readFromURL:options:error:)] + pub unsafe fn readFromURL_options_error( + &self, + url: &NSURL, + options: NSFileWrapperReadingOptions, + ) -> Result<(), Id>; + + #[method(writeToURL:options:originalContentsURL:error:)] + pub unsafe fn writeToURL_options_originalContentsURL_error( + &self, + url: &NSURL, + options: NSFileWrapperWritingOptions, + originalContentsURL: Option<&NSURL>, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other serializedRepresentation)] + pub unsafe fn serializedRepresentation(&self) -> Option>; + + #[method_id(@__retain_semantics Other addFileWrapper:)] + pub unsafe fn addFileWrapper(&self, child: &NSFileWrapper) -> Id; + + #[method_id(@__retain_semantics Other addRegularFileWithContents:preferredFilename:)] + pub unsafe fn addRegularFileWithContents_preferredFilename( + &self, + data: &NSData, + fileName: &NSString, + ) -> Id; + + #[method(removeFileWrapper:)] + pub unsafe fn removeFileWrapper(&self, child: &NSFileWrapper); + + #[method_id(@__retain_semantics Other fileWrappers)] + pub unsafe fn fileWrappers( + &self, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other keyForFileWrapper:)] + pub unsafe fn keyForFileWrapper( + &self, + child: &NSFileWrapper, + ) -> Option>; + + #[method_id(@__retain_semantics Other regularFileContents)] + pub unsafe fn regularFileContents(&self) -> Option>; + + #[method_id(@__retain_semantics Other symbolicLinkDestinationURL)] + pub unsafe fn symbolicLinkDestinationURL(&self) -> Option>; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSFileWrapper { + #[method_id(@__retain_semantics Init initWithPath:)] + pub unsafe fn initWithPath( + this: Option>, + path: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initSymbolicLinkWithDestination:)] + pub unsafe fn initSymbolicLinkWithDestination( + this: Option>, + path: &NSString, + ) -> Id; + + #[method(needsToBeUpdatedFromPath:)] + pub unsafe fn needsToBeUpdatedFromPath(&self, path: &NSString) -> bool; + + #[method(updateFromPath:)] + pub unsafe fn updateFromPath(&self, path: &NSString) -> bool; + + #[method(writeToFile:atomically:updateFilenames:)] + pub unsafe fn writeToFile_atomically_updateFilenames( + &self, + path: &NSString, + atomicFlag: bool, + updateFilenamesFlag: bool, + ) -> bool; + + #[method_id(@__retain_semantics Other addFileWithPath:)] + pub unsafe fn addFileWithPath(&self, path: &NSString) -> Id; + + #[method_id(@__retain_semantics Other addSymbolicLinkWithDestination:preferredFilename:)] + pub unsafe fn addSymbolicLinkWithDestination_preferredFilename( + &self, + path: &NSString, + filename: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other symbolicLinkDestination)] + pub unsafe fn symbolicLinkDestination(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSFormatter.rs b/crates/icrate/src/generated/Foundation/NSFormatter.rs new file mode 100644 index 000000000..389d9ee64 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSFormatter.rs @@ -0,0 +1,83 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSFormattingContext { + NSFormattingContextUnknown = 0, + NSFormattingContextDynamic = 1, + NSFormattingContextStandalone = 2, + NSFormattingContextListItem = 3, + NSFormattingContextBeginningOfSentence = 4, + NSFormattingContextMiddleOfSentence = 5, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSFormattingUnitStyle { + NSFormattingUnitStyleShort = 1, + NSFormattingUnitStyleMedium = 2, + NSFormattingUnitStyleLong = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSFormatter; + + unsafe impl ClassType for NSFormatter { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFormatter { + #[method_id(@__retain_semantics Other stringForObjectValue:)] + pub unsafe fn stringForObjectValue( + &self, + obj: Option<&Object>, + ) -> Option>; + + #[method_id(@__retain_semantics Other attributedStringForObjectValue:withDefaultAttributes:)] + pub unsafe fn attributedStringForObjectValue_withDefaultAttributes( + &self, + obj: &Object, + attrs: Option<&NSDictionary>, + ) -> Option>; + + #[method_id(@__retain_semantics Other editingStringForObjectValue:)] + pub unsafe fn editingStringForObjectValue( + &self, + obj: &Object, + ) -> Option>; + + #[method(getObjectValue:forString:errorDescription:)] + pub unsafe fn getObjectValue_forString_errorDescription( + &self, + obj: *mut *mut Object, + string: &NSString, + error: *mut *mut NSString, + ) -> bool; + + #[method(isPartialStringValid:newEditingString:errorDescription:)] + pub unsafe fn isPartialStringValid_newEditingString_errorDescription( + &self, + partialString: &NSString, + newString: *mut *mut NSString, + error: *mut *mut NSString, + ) -> bool; + + #[method(isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:)] + pub unsafe fn isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription( + &self, + partialStringPtr: NonNull>, + proposedSelRangePtr: NSRangePointer, + origString: &NSString, + origSelRange: NSRange, + error: *mut *mut NSString, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSGarbageCollector.rs b/crates/icrate/src/generated/Foundation/NSGarbageCollector.rs new file mode 100644 index 000000000..bea92114c --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSGarbageCollector.rs @@ -0,0 +1,47 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSGarbageCollector; + + unsafe impl ClassType for NSGarbageCollector { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSGarbageCollector { + #[method_id(@__retain_semantics Other defaultCollector)] + pub unsafe fn defaultCollector() -> Id; + + #[method(isCollecting)] + pub unsafe fn isCollecting(&self) -> bool; + + #[method(disable)] + pub unsafe fn disable(&self); + + #[method(enable)] + pub unsafe fn enable(&self); + + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + + #[method(collectIfNeeded)] + pub unsafe fn collectIfNeeded(&self); + + #[method(collectExhaustively)] + pub unsafe fn collectExhaustively(&self); + + #[method(disableCollectorForPointer:)] + pub unsafe fn disableCollectorForPointer(&self, ptr: NonNull); + + #[method(enableCollectorForPointer:)] + pub unsafe fn enableCollectorForPointer(&self, ptr: NonNull); + + #[method(zone)] + pub unsafe fn zone(&self) -> NonNull; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSGeometry.rs b/crates/icrate/src/generated/Foundation/NSGeometry.rs new file mode 100644 index 000000000..0e6aa2048 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSGeometry.rs @@ -0,0 +1,366 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSPoint = CGPoint; + +pub type NSPointPointer = *mut NSPoint; + +pub type NSPointArray = *mut NSPoint; + +pub type NSSize = CGSize; + +pub type NSSizePointer = *mut NSSize; + +pub type NSSizeArray = *mut NSSize; + +pub type NSRect = CGRect; + +pub type NSRectPointer = *mut NSRect; + +pub type NSRectArray = *mut NSRect; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSRectEdge { + NSRectEdgeMinX = 0, + NSRectEdgeMinY = 1, + NSRectEdgeMaxX = 2, + NSRectEdgeMaxY = 3, + NSMinXEdge = 0, + NSMinYEdge = 1, + NSMaxXEdge = 2, + NSMaxYEdge = 3, + } +); + +extern_struct!( + pub struct NSEdgeInsets { + pub top: CGFloat, + pub left: CGFloat, + pub bottom: CGFloat, + pub right: CGFloat, + } +); + +ns_options!( + #[underlying(c_ulonglong)] + pub enum NSAlignmentOptions { + NSAlignMinXInward = 1 << 0, + NSAlignMinYInward = 1 << 1, + NSAlignMaxXInward = 1 << 2, + NSAlignMaxYInward = 1 << 3, + NSAlignWidthInward = 1 << 4, + NSAlignHeightInward = 1 << 5, + NSAlignMinXOutward = 1 << 8, + NSAlignMinYOutward = 1 << 9, + NSAlignMaxXOutward = 1 << 10, + NSAlignMaxYOutward = 1 << 11, + NSAlignWidthOutward = 1 << 12, + NSAlignHeightOutward = 1 << 13, + NSAlignMinXNearest = 1 << 16, + NSAlignMinYNearest = 1 << 17, + NSAlignMaxXNearest = 1 << 18, + NSAlignMaxYNearest = 1 << 19, + NSAlignWidthNearest = 1 << 20, + NSAlignHeightNearest = 1 << 21, + NSAlignRectFlipped = 1 << 63, + NSAlignAllEdgesInward = + NSAlignMinXInward | NSAlignMaxXInward | NSAlignMinYInward | NSAlignMaxYInward, + NSAlignAllEdgesOutward = + NSAlignMinXOutward | NSAlignMaxXOutward | NSAlignMinYOutward | NSAlignMaxYOutward, + NSAlignAllEdgesNearest = + NSAlignMinXNearest | NSAlignMaxXNearest | NSAlignMinYNearest | NSAlignMaxYNearest, + } +); + +extern_static!(NSZeroPoint: NSPoint); + +extern_static!(NSZeroSize: NSSize); + +extern_static!(NSZeroRect: NSRect); + +extern_static!(NSEdgeInsetsZero: NSEdgeInsets); + +inline_fn!( + pub unsafe fn NSMakePoint(x: CGFloat, y: CGFloat) -> NSPoint { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSMakeSize(w: CGFloat, h: CGFloat) -> NSSize { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSMakeRect(x: CGFloat, y: CGFloat, w: CGFloat, h: CGFloat) -> NSRect { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSMaxX(aRect: NSRect) -> CGFloat { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSMaxY(aRect: NSRect) -> CGFloat { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSMidX(aRect: NSRect) -> CGFloat { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSMidY(aRect: NSRect) -> CGFloat { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSMinX(aRect: NSRect) -> CGFloat { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSMinY(aRect: NSRect) -> CGFloat { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSWidth(aRect: NSRect) -> CGFloat { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSHeight(aRect: NSRect) -> CGFloat { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSRectFromCGRect(cgrect: CGRect) -> NSRect { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSRectToCGRect(nsrect: NSRect) -> CGRect { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSPointFromCGPoint(cgpoint: CGPoint) -> NSPoint { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSPointToCGPoint(nspoint: NSPoint) -> CGPoint { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSizeFromCGSize(cgsize: CGSize) -> NSSize { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSSizeToCGSize(nssize: NSSize) -> CGSize { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSEdgeInsetsMake( + top: CGFloat, + left: CGFloat, + bottom: CGFloat, + right: CGFloat, + ) -> NSEdgeInsets { + todo!() + } +); + +extern_fn!( + pub unsafe fn NSEqualPoints(aPoint: NSPoint, bPoint: NSPoint) -> Bool; +); + +extern_fn!( + pub unsafe fn NSEqualSizes(aSize: NSSize, bSize: NSSize) -> Bool; +); + +extern_fn!( + pub unsafe fn NSEqualRects(aRect: NSRect, bRect: NSRect) -> Bool; +); + +extern_fn!( + pub unsafe fn NSIsEmptyRect(aRect: NSRect) -> Bool; +); + +extern_fn!( + pub unsafe fn NSEdgeInsetsEqual(aInsets: NSEdgeInsets, bInsets: NSEdgeInsets) -> Bool; +); + +extern_fn!( + pub unsafe fn NSInsetRect(aRect: NSRect, dX: CGFloat, dY: CGFloat) -> NSRect; +); + +extern_fn!( + pub unsafe fn NSIntegralRect(aRect: NSRect) -> NSRect; +); + +extern_fn!( + pub unsafe fn NSIntegralRectWithOptions(aRect: NSRect, opts: NSAlignmentOptions) -> NSRect; +); + +extern_fn!( + pub unsafe fn NSUnionRect(aRect: NSRect, bRect: NSRect) -> NSRect; +); + +extern_fn!( + pub unsafe fn NSIntersectionRect(aRect: NSRect, bRect: NSRect) -> NSRect; +); + +extern_fn!( + pub unsafe fn NSOffsetRect(aRect: NSRect, dX: CGFloat, dY: CGFloat) -> NSRect; +); + +extern_fn!( + pub unsafe fn NSDivideRect( + inRect: NSRect, + slice: NonNull, + rem: NonNull, + amount: CGFloat, + edge: NSRectEdge, + ); +); + +extern_fn!( + pub unsafe fn NSPointInRect(aPoint: NSPoint, aRect: NSRect) -> Bool; +); + +extern_fn!( + pub unsafe fn NSMouseInRect(aPoint: NSPoint, aRect: NSRect, flipped: Bool) -> Bool; +); + +extern_fn!( + pub unsafe fn NSContainsRect(aRect: NSRect, bRect: NSRect) -> Bool; +); + +extern_fn!( + pub unsafe fn NSIntersectsRect(aRect: NSRect, bRect: NSRect) -> Bool; +); + +extern_fn!( + pub unsafe fn NSStringFromPoint(aPoint: NSPoint) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSStringFromSize(aSize: NSSize) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSStringFromRect(aRect: NSRect) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSPointFromString(aString: &NSString) -> NSPoint; +); + +extern_fn!( + pub unsafe fn NSSizeFromString(aString: &NSString) -> NSSize; +); + +extern_fn!( + pub unsafe fn NSRectFromString(aString: &NSString) -> NSRect; +); + +extern_methods!( + /// NSValueGeometryExtensions + unsafe impl NSValue { + #[method_id(@__retain_semantics Other valueWithPoint:)] + pub unsafe fn valueWithPoint(point: NSPoint) -> Id; + + #[method_id(@__retain_semantics Other valueWithSize:)] + pub unsafe fn valueWithSize(size: NSSize) -> Id; + + #[method_id(@__retain_semantics Other valueWithRect:)] + pub unsafe fn valueWithRect(rect: NSRect) -> Id; + + #[method_id(@__retain_semantics Other valueWithEdgeInsets:)] + pub unsafe fn valueWithEdgeInsets(insets: NSEdgeInsets) -> Id; + + #[method(pointValue)] + pub unsafe fn pointValue(&self) -> NSPoint; + + #[method(sizeValue)] + pub unsafe fn sizeValue(&self) -> NSSize; + + #[method(rectValue)] + pub unsafe fn rectValue(&self) -> NSRect; + + #[method(edgeInsetsValue)] + pub unsafe fn edgeInsetsValue(&self) -> NSEdgeInsets; + } +); + +extern_methods!( + /// NSGeometryCoding + unsafe impl NSCoder { + #[method(encodePoint:)] + pub unsafe fn encodePoint(&self, point: NSPoint); + + #[method(decodePoint)] + pub unsafe fn decodePoint(&self) -> NSPoint; + + #[method(encodeSize:)] + pub unsafe fn encodeSize(&self, size: NSSize); + + #[method(decodeSize)] + pub unsafe fn decodeSize(&self) -> NSSize; + + #[method(encodeRect:)] + pub unsafe fn encodeRect(&self, rect: NSRect); + + #[method(decodeRect)] + pub unsafe fn decodeRect(&self) -> NSRect; + } +); + +extern_methods!( + /// NSGeometryKeyedCoding + unsafe impl NSCoder { + #[method(encodePoint:forKey:)] + pub unsafe fn encodePoint_forKey(&self, point: NSPoint, key: &NSString); + + #[method(encodeSize:forKey:)] + pub unsafe fn encodeSize_forKey(&self, size: NSSize, key: &NSString); + + #[method(encodeRect:forKey:)] + pub unsafe fn encodeRect_forKey(&self, rect: NSRect, key: &NSString); + + #[method(decodePointForKey:)] + pub unsafe fn decodePointForKey(&self, key: &NSString) -> NSPoint; + + #[method(decodeSizeForKey:)] + pub unsafe fn decodeSizeForKey(&self, key: &NSString) -> NSSize; + + #[method(decodeRectForKey:)] + pub unsafe fn decodeRectForKey(&self, key: &NSString) -> NSRect; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSHFSFileTypes.rs b/crates/icrate/src/generated/Foundation/NSHFSFileTypes.rs new file mode 100644 index 000000000..2bf576628 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSHFSFileTypes.rs @@ -0,0 +1,16 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_fn!( + pub unsafe fn NSFileTypeForHFSTypeCode(hfsFileTypeCode: OSType) -> *mut NSString; +); + +extern_fn!( + pub unsafe fn NSHFSTypeCodeFromFileType(fileTypeString: Option<&NSString>) -> OSType; +); + +extern_fn!( + pub unsafe fn NSHFSTypeOfFile(fullFilePath: Option<&NSString>) -> *mut NSString; +); diff --git a/crates/icrate/src/generated/Foundation/NSHTTPCookie.rs b/crates/icrate/src/generated/Foundation/NSHTTPCookie.rs new file mode 100644 index 000000000..355509633 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSHTTPCookie.rs @@ -0,0 +1,119 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSHTTPCookiePropertyKey = NSString; + +pub type NSHTTPCookieStringPolicy = NSString; + +extern_static!(NSHTTPCookieName: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookieValue: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookieOriginURL: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookieVersion: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookieDomain: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookiePath: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookieSecure: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookieExpires: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookieComment: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookieCommentURL: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookieDiscard: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookieMaximumAge: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookiePort: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookieSameSitePolicy: &'static NSHTTPCookiePropertyKey); + +extern_static!(NSHTTPCookieSameSiteLax: &'static NSHTTPCookieStringPolicy); + +extern_static!(NSHTTPCookieSameSiteStrict: &'static NSHTTPCookieStringPolicy); + +extern_class!( + #[derive(Debug)] + pub struct NSHTTPCookie; + + unsafe impl ClassType for NSHTTPCookie { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSHTTPCookie { + #[method_id(@__retain_semantics Init initWithProperties:)] + pub unsafe fn initWithProperties( + this: Option>, + properties: &NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Other cookieWithProperties:)] + pub unsafe fn cookieWithProperties( + properties: &NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics Other requestHeaderFieldsWithCookies:)] + pub unsafe fn requestHeaderFieldsWithCookies( + cookies: &NSArray, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other cookiesWithResponseHeaderFields:forURL:)] + pub unsafe fn cookiesWithResponseHeaderFields_forURL( + headerFields: &NSDictionary, + URL: &NSURL, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other properties)] + pub unsafe fn properties( + &self, + ) -> Option, Shared>>; + + #[method(version)] + pub unsafe fn version(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other value)] + pub unsafe fn value(&self) -> Id; + + #[method_id(@__retain_semantics Other expiresDate)] + pub unsafe fn expiresDate(&self) -> Option>; + + #[method(isSessionOnly)] + pub unsafe fn isSessionOnly(&self) -> bool; + + #[method_id(@__retain_semantics Other domain)] + pub unsafe fn domain(&self) -> Id; + + #[method_id(@__retain_semantics Other path)] + pub unsafe fn path(&self) -> Id; + + #[method(isSecure)] + pub unsafe fn isSecure(&self) -> bool; + + #[method(isHTTPOnly)] + pub unsafe fn isHTTPOnly(&self) -> bool; + + #[method_id(@__retain_semantics Other comment)] + pub unsafe fn comment(&self) -> Option>; + + #[method_id(@__retain_semantics Other commentURL)] + pub unsafe fn commentURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other portList)] + pub unsafe fn portList(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other sameSitePolicy)] + pub unsafe fn sameSitePolicy(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSHTTPCookieStorage.rs b/crates/icrate/src/generated/Foundation/NSHTTPCookieStorage.rs new file mode 100644 index 000000000..4535a1971 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSHTTPCookieStorage.rs @@ -0,0 +1,95 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSHTTPCookieAcceptPolicy { + NSHTTPCookieAcceptPolicyAlways = 0, + NSHTTPCookieAcceptPolicyNever = 1, + NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSHTTPCookieStorage; + + unsafe impl ClassType for NSHTTPCookieStorage { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSHTTPCookieStorage { + #[method_id(@__retain_semantics Other sharedHTTPCookieStorage)] + pub unsafe fn sharedHTTPCookieStorage() -> Id; + + #[method_id(@__retain_semantics Other sharedCookieStorageForGroupContainerIdentifier:)] + pub unsafe fn sharedCookieStorageForGroupContainerIdentifier( + identifier: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other cookies)] + pub unsafe fn cookies(&self) -> Option, Shared>>; + + #[method(setCookie:)] + pub unsafe fn setCookie(&self, cookie: &NSHTTPCookie); + + #[method(deleteCookie:)] + pub unsafe fn deleteCookie(&self, cookie: &NSHTTPCookie); + + #[method(removeCookiesSinceDate:)] + pub unsafe fn removeCookiesSinceDate(&self, date: &NSDate); + + #[method_id(@__retain_semantics Other cookiesForURL:)] + pub unsafe fn cookiesForURL( + &self, + URL: &NSURL, + ) -> Option, Shared>>; + + #[method(setCookies:forURL:mainDocumentURL:)] + pub unsafe fn setCookies_forURL_mainDocumentURL( + &self, + cookies: &NSArray, + URL: Option<&NSURL>, + mainDocumentURL: Option<&NSURL>, + ); + + #[method(cookieAcceptPolicy)] + pub unsafe fn cookieAcceptPolicy(&self) -> NSHTTPCookieAcceptPolicy; + + #[method(setCookieAcceptPolicy:)] + pub unsafe fn setCookieAcceptPolicy(&self, cookieAcceptPolicy: NSHTTPCookieAcceptPolicy); + + #[method_id(@__retain_semantics Other sortedCookiesUsingDescriptors:)] + pub unsafe fn sortedCookiesUsingDescriptors( + &self, + sortOrder: &NSArray, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSURLSessionTaskAdditions + unsafe impl NSHTTPCookieStorage { + #[method(storeCookies:forTask:)] + pub unsafe fn storeCookies_forTask( + &self, + cookies: &NSArray, + task: &NSURLSessionTask, + ); + + #[method(getCookiesForTask:completionHandler:)] + pub unsafe fn getCookiesForTask_completionHandler( + &self, + task: &NSURLSessionTask, + completionHandler: &Block<(*mut NSArray,), ()>, + ); + } +); + +extern_static!(NSHTTPCookieManagerAcceptPolicyChangedNotification: &'static NSNotificationName); + +extern_static!(NSHTTPCookieManagerCookiesChangedNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/Foundation/NSHashTable.rs b/crates/icrate/src/generated/Foundation/NSHashTable.rs new file mode 100644 index 000000000..e47065a63 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSHashTable.rs @@ -0,0 +1,227 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSHashTableStrongMemory: NSPointerFunctionsOptions = NSPointerFunctionsStrongMemory); + +extern_static!( + NSHashTableZeroingWeakMemory: NSPointerFunctionsOptions = NSPointerFunctionsZeroingWeakMemory +); + +extern_static!(NSHashTableCopyIn: NSPointerFunctionsOptions = NSPointerFunctionsCopyIn); + +extern_static!( + NSHashTableObjectPointerPersonality: NSPointerFunctionsOptions = + NSPointerFunctionsObjectPointerPersonality +); + +extern_static!(NSHashTableWeakMemory: NSPointerFunctionsOptions = NSPointerFunctionsWeakMemory); + +pub type NSHashTableOptions = NSUInteger; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSHashTable { + _inner0: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSHashTable { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSHashTable { + #[method_id(@__retain_semantics Init initWithOptions:capacity:)] + pub unsafe fn initWithOptions_capacity( + this: Option>, + options: NSPointerFunctionsOptions, + initialCapacity: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithPointerFunctions:capacity:)] + pub unsafe fn initWithPointerFunctions_capacity( + this: Option>, + functions: &NSPointerFunctions, + initialCapacity: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other hashTableWithOptions:)] + pub unsafe fn hashTableWithOptions( + options: NSPointerFunctionsOptions, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other hashTableWithWeakObjects)] + pub unsafe fn hashTableWithWeakObjects() -> Id; + + #[method_id(@__retain_semantics Other weakObjectsHashTable)] + pub unsafe fn weakObjectsHashTable() -> Id, Shared>; + + #[method_id(@__retain_semantics Other pointerFunctions)] + pub unsafe fn pointerFunctions(&self) -> Id; + + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other member:)] + pub unsafe fn member(&self, object: Option<&ObjectType>) -> Option>; + + #[method_id(@__retain_semantics Other objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Id, Shared>; + + #[method(addObject:)] + pub unsafe fn addObject(&self, object: Option<&ObjectType>); + + #[method(removeObject:)] + pub unsafe fn removeObject(&self, object: Option<&ObjectType>); + + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + + #[method_id(@__retain_semantics Other allObjects)] + pub unsafe fn allObjects(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other anyObject)] + pub unsafe fn anyObject(&self) -> Option>; + + #[method(containsObject:)] + pub unsafe fn containsObject(&self, anObject: Option<&ObjectType>) -> bool; + + #[method(intersectsHashTable:)] + pub unsafe fn intersectsHashTable(&self, other: &NSHashTable) -> bool; + + #[method(isEqualToHashTable:)] + pub unsafe fn isEqualToHashTable(&self, other: &NSHashTable) -> bool; + + #[method(isSubsetOfHashTable:)] + pub unsafe fn isSubsetOfHashTable(&self, other: &NSHashTable) -> bool; + + #[method(intersectHashTable:)] + pub unsafe fn intersectHashTable(&self, other: &NSHashTable); + + #[method(unionHashTable:)] + pub unsafe fn unionHashTable(&self, other: &NSHashTable); + + #[method(minusHashTable:)] + pub unsafe fn minusHashTable(&self, other: &NSHashTable); + + #[method_id(@__retain_semantics Other setRepresentation)] + pub unsafe fn setRepresentation(&self) -> Id, Shared>; + } +); + +extern_struct!( + pub struct NSHashEnumerator { + _pi: NSUInteger, + _si: NSUInteger, + _bs: *mut c_void, + } +); + +extern_fn!( + pub unsafe fn NSFreeHashTable(table: &NSHashTable); +); + +extern_fn!( + pub unsafe fn NSResetHashTable(table: &NSHashTable); +); + +extern_fn!( + pub unsafe fn NSCompareHashTables(table1: &NSHashTable, table2: &NSHashTable) -> Bool; +); + +extern_fn!( + pub unsafe fn NSCopyHashTableWithZone( + table: &NSHashTable, + zone: *mut NSZone, + ) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSHashGet(table: &NSHashTable, pointer: *mut c_void) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSHashInsert(table: &NSHashTable, pointer: *mut c_void); +); + +extern_fn!( + pub unsafe fn NSHashInsertKnownAbsent(table: &NSHashTable, pointer: *mut c_void); +); + +extern_fn!( + pub unsafe fn NSHashInsertIfAbsent(table: &NSHashTable, pointer: *mut c_void) -> *mut c_void; +); + +extern_fn!( + pub unsafe fn NSHashRemove(table: &NSHashTable, pointer: *mut c_void); +); + +extern_fn!( + pub unsafe fn NSEnumerateHashTable(table: &NSHashTable) -> NSHashEnumerator; +); + +extern_fn!( + pub unsafe fn NSNextHashEnumeratorItem(enumerator: NonNull) -> *mut c_void; +); + +extern_fn!( + pub unsafe fn NSEndHashTableEnumeration(enumerator: NonNull); +); + +extern_fn!( + pub unsafe fn NSCountHashTable(table: &NSHashTable) -> NSUInteger; +); + +extern_fn!( + pub unsafe fn NSStringFromHashTable(table: &NSHashTable) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSAllHashTableObjects(table: &NSHashTable) -> NonNull; +); + +extern_struct!( + pub struct NSHashTableCallBacks { + pub hash: Option, NonNull) -> NSUInteger>, + pub isEqual: Option< + unsafe extern "C" fn(NonNull, NonNull, NonNull) -> Bool, + >, + pub retain: Option, NonNull)>, + pub release: Option, NonNull)>, + pub describe: + Option, NonNull) -> *mut NSString>, + } +); + +extern_fn!( + pub unsafe fn NSCreateHashTableWithZone( + callBacks: NSHashTableCallBacks, + capacity: NSUInteger, + zone: *mut NSZone, + ) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSCreateHashTable( + callBacks: NSHashTableCallBacks, + capacity: NSUInteger, + ) -> NonNull; +); + +extern_static!(NSIntegerHashCallBacks: NSHashTableCallBacks); + +extern_static!(NSNonOwnedPointerHashCallBacks: NSHashTableCallBacks); + +extern_static!(NSNonRetainedObjectHashCallBacks: NSHashTableCallBacks); + +extern_static!(NSObjectHashCallBacks: NSHashTableCallBacks); + +extern_static!(NSOwnedObjectIdentityHashCallBacks: NSHashTableCallBacks); + +extern_static!(NSOwnedPointerHashCallBacks: NSHashTableCallBacks); + +extern_static!(NSPointerToStructHashCallBacks: NSHashTableCallBacks); + +extern_static!(NSIntHashCallBacks: NSHashTableCallBacks); diff --git a/crates/icrate/src/generated/Foundation/NSHost.rs b/crates/icrate/src/generated/Foundation/NSHost.rs new file mode 100644 index 000000000..79938e8eb --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSHost.rs @@ -0,0 +1,53 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSHost; + + unsafe impl ClassType for NSHost { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSHost { + #[method_id(@__retain_semantics Other currentHost)] + pub unsafe fn currentHost() -> Id; + + #[method_id(@__retain_semantics Other hostWithName:)] + pub unsafe fn hostWithName(name: Option<&NSString>) -> Id; + + #[method_id(@__retain_semantics Other hostWithAddress:)] + pub unsafe fn hostWithAddress(address: &NSString) -> Id; + + #[method(isEqualToHost:)] + pub unsafe fn isEqualToHost(&self, aHost: &NSHost) -> bool; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method_id(@__retain_semantics Other names)] + pub unsafe fn names(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other address)] + pub unsafe fn address(&self) -> Option>; + + #[method_id(@__retain_semantics Other addresses)] + pub unsafe fn addresses(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other localizedName)] + pub unsafe fn localizedName(&self) -> Option>; + + #[method(setHostCacheEnabled:)] + pub unsafe fn setHostCacheEnabled(flag: bool); + + #[method(isHostCacheEnabled)] + pub unsafe fn isHostCacheEnabled() -> bool; + + #[method(flushHostCache)] + pub unsafe fn flushHostCache(); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSISO8601DateFormatter.rs b/crates/icrate/src/generated/Foundation/NSISO8601DateFormatter.rs new file mode 100644 index 000000000..6eb915c79 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSISO8601DateFormatter.rs @@ -0,0 +1,65 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSISO8601DateFormatOptions { + NSISO8601DateFormatWithYear = 1, + NSISO8601DateFormatWithMonth = 2, + NSISO8601DateFormatWithWeekOfYear = 4, + NSISO8601DateFormatWithDay = 16, + NSISO8601DateFormatWithTime = 32, + NSISO8601DateFormatWithTimeZone = 64, + NSISO8601DateFormatWithSpaceBetweenDateAndTime = 128, + NSISO8601DateFormatWithDashSeparatorInDate = 256, + NSISO8601DateFormatWithColonSeparatorInTime = 512, + NSISO8601DateFormatWithColonSeparatorInTimeZone = 1024, + NSISO8601DateFormatWithFractionalSeconds = 2048, + NSISO8601DateFormatWithFullDate = 275, + NSISO8601DateFormatWithFullTime = 1632, + NSISO8601DateFormatWithInternetDateTime = 1907, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSISO8601DateFormatter; + + unsafe impl ClassType for NSISO8601DateFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSISO8601DateFormatter { + #[method_id(@__retain_semantics Other timeZone)] + pub unsafe fn timeZone(&self) -> Id; + + #[method(setTimeZone:)] + pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>); + + #[method(formatOptions)] + pub unsafe fn formatOptions(&self) -> NSISO8601DateFormatOptions; + + #[method(setFormatOptions:)] + pub unsafe fn setFormatOptions(&self, formatOptions: NSISO8601DateFormatOptions); + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other stringFromDate:)] + pub unsafe fn stringFromDate(&self, date: &NSDate) -> Id; + + #[method_id(@__retain_semantics Other dateFromString:)] + pub unsafe fn dateFromString(&self, string: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other stringFromDate:timeZone:formatOptions:)] + pub unsafe fn stringFromDate_timeZone_formatOptions( + date: &NSDate, + timeZone: &NSTimeZone, + formatOptions: NSISO8601DateFormatOptions, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSIndexPath.rs b/crates/icrate/src/generated/Foundation/NSIndexPath.rs new file mode 100644 index 000000000..ef8b1c7bd --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSIndexPath.rs @@ -0,0 +1,65 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSIndexPath; + + unsafe impl ClassType for NSIndexPath { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSIndexPath { + #[method_id(@__retain_semantics Other indexPathWithIndex:)] + pub unsafe fn indexPathWithIndex(index: NSUInteger) -> Id; + + #[method_id(@__retain_semantics Other indexPathWithIndexes:length:)] + pub unsafe fn indexPathWithIndexes_length( + indexes: *mut NSUInteger, + length: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithIndexes:length:)] + pub unsafe fn initWithIndexes_length( + this: Option>, + indexes: *mut NSUInteger, + length: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithIndex:)] + pub unsafe fn initWithIndex( + this: Option>, + index: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other indexPathByAddingIndex:)] + pub unsafe fn indexPathByAddingIndex(&self, index: NSUInteger) -> Id; + + #[method_id(@__retain_semantics Other indexPathByRemovingLastIndex)] + pub unsafe fn indexPathByRemovingLastIndex(&self) -> Id; + + #[method(indexAtPosition:)] + pub unsafe fn indexAtPosition(&self, position: NSUInteger) -> NSUInteger; + + #[method(length)] + pub unsafe fn length(&self) -> NSUInteger; + + #[method(getIndexes:range:)] + pub unsafe fn getIndexes_range(&self, indexes: NonNull, positionRange: NSRange); + + #[method(compare:)] + pub unsafe fn compare(&self, otherObject: &NSIndexPath) -> NSComparisonResult; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSIndexPath { + #[method(getIndexes:)] + pub unsafe fn getIndexes(&self, indexes: NonNull); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSIndexSet.rs b/crates/icrate/src/generated/Foundation/NSIndexSet.rs new file mode 100644 index 000000000..f1ea134ff --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSIndexSet.rs @@ -0,0 +1,209 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSIndexSet; + + unsafe impl ClassType for NSIndexSet { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSIndexSet { + #[method_id(@__retain_semantics Other indexSet)] + pub unsafe fn indexSet() -> Id; + + #[method_id(@__retain_semantics Other indexSetWithIndex:)] + pub unsafe fn indexSetWithIndex(value: NSUInteger) -> Id; + + #[method_id(@__retain_semantics Other indexSetWithIndexesInRange:)] + pub unsafe fn indexSetWithIndexesInRange(range: NSRange) -> Id; + + #[method_id(@__retain_semantics Init initWithIndexesInRange:)] + pub unsafe fn initWithIndexesInRange( + this: Option>, + range: NSRange, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithIndexSet:)] + pub unsafe fn initWithIndexSet( + this: Option>, + indexSet: &NSIndexSet, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithIndex:)] + pub unsafe fn initWithIndex( + this: Option>, + value: NSUInteger, + ) -> Id; + + #[method(isEqualToIndexSet:)] + pub unsafe fn isEqualToIndexSet(&self, indexSet: &NSIndexSet) -> bool; + + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + + #[method(firstIndex)] + pub unsafe fn firstIndex(&self) -> NSUInteger; + + #[method(lastIndex)] + pub unsafe fn lastIndex(&self) -> NSUInteger; + + #[method(indexGreaterThanIndex:)] + pub unsafe fn indexGreaterThanIndex(&self, value: NSUInteger) -> NSUInteger; + + #[method(indexLessThanIndex:)] + pub unsafe fn indexLessThanIndex(&self, value: NSUInteger) -> NSUInteger; + + #[method(indexGreaterThanOrEqualToIndex:)] + pub unsafe fn indexGreaterThanOrEqualToIndex(&self, value: NSUInteger) -> NSUInteger; + + #[method(indexLessThanOrEqualToIndex:)] + pub unsafe fn indexLessThanOrEqualToIndex(&self, value: NSUInteger) -> NSUInteger; + + #[method(getIndexes:maxCount:inIndexRange:)] + pub unsafe fn getIndexes_maxCount_inIndexRange( + &self, + indexBuffer: NonNull, + bufferSize: NSUInteger, + range: NSRangePointer, + ) -> NSUInteger; + + #[method(countOfIndexesInRange:)] + pub unsafe fn countOfIndexesInRange(&self, range: NSRange) -> NSUInteger; + + #[method(containsIndex:)] + pub unsafe fn containsIndex(&self, value: NSUInteger) -> bool; + + #[method(containsIndexesInRange:)] + pub unsafe fn containsIndexesInRange(&self, range: NSRange) -> bool; + + #[method(containsIndexes:)] + pub unsafe fn containsIndexes(&self, indexSet: &NSIndexSet) -> bool; + + #[method(intersectsIndexesInRange:)] + pub unsafe fn intersectsIndexesInRange(&self, range: NSRange) -> bool; + + #[method(enumerateIndexesUsingBlock:)] + pub unsafe fn enumerateIndexesUsingBlock( + &self, + block: &Block<(NSUInteger, NonNull), ()>, + ); + + #[method(enumerateIndexesWithOptions:usingBlock:)] + pub unsafe fn enumerateIndexesWithOptions_usingBlock( + &self, + opts: NSEnumerationOptions, + block: &Block<(NSUInteger, NonNull), ()>, + ); + + #[method(enumerateIndexesInRange:options:usingBlock:)] + pub unsafe fn enumerateIndexesInRange_options_usingBlock( + &self, + range: NSRange, + opts: NSEnumerationOptions, + block: &Block<(NSUInteger, NonNull), ()>, + ); + + #[method(indexPassingTest:)] + pub unsafe fn indexPassingTest( + &self, + predicate: &Block<(NSUInteger, NonNull), Bool>, + ) -> NSUInteger; + + #[method(indexWithOptions:passingTest:)] + pub unsafe fn indexWithOptions_passingTest( + &self, + opts: NSEnumerationOptions, + predicate: &Block<(NSUInteger, NonNull), Bool>, + ) -> NSUInteger; + + #[method(indexInRange:options:passingTest:)] + pub unsafe fn indexInRange_options_passingTest( + &self, + range: NSRange, + opts: NSEnumerationOptions, + predicate: &Block<(NSUInteger, NonNull), Bool>, + ) -> NSUInteger; + + #[method_id(@__retain_semantics Other indexesPassingTest:)] + pub unsafe fn indexesPassingTest( + &self, + predicate: &Block<(NSUInteger, NonNull), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Other indexesWithOptions:passingTest:)] + pub unsafe fn indexesWithOptions_passingTest( + &self, + opts: NSEnumerationOptions, + predicate: &Block<(NSUInteger, NonNull), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Other indexesInRange:options:passingTest:)] + pub unsafe fn indexesInRange_options_passingTest( + &self, + range: NSRange, + opts: NSEnumerationOptions, + predicate: &Block<(NSUInteger, NonNull), Bool>, + ) -> Id; + + #[method(enumerateRangesUsingBlock:)] + pub unsafe fn enumerateRangesUsingBlock(&self, block: &Block<(NSRange, NonNull), ()>); + + #[method(enumerateRangesWithOptions:usingBlock:)] + pub unsafe fn enumerateRangesWithOptions_usingBlock( + &self, + opts: NSEnumerationOptions, + block: &Block<(NSRange, NonNull), ()>, + ); + + #[method(enumerateRangesInRange:options:usingBlock:)] + pub unsafe fn enumerateRangesInRange_options_usingBlock( + &self, + range: NSRange, + opts: NSEnumerationOptions, + block: &Block<(NSRange, NonNull), ()>, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMutableIndexSet; + + unsafe impl ClassType for NSMutableIndexSet { + type Super = NSIndexSet; + } +); + +extern_methods!( + unsafe impl NSMutableIndexSet { + #[method(addIndexes:)] + pub unsafe fn addIndexes(&self, indexSet: &NSIndexSet); + + #[method(removeIndexes:)] + pub unsafe fn removeIndexes(&self, indexSet: &NSIndexSet); + + #[method(removeAllIndexes)] + pub unsafe fn removeAllIndexes(&self); + + #[method(addIndex:)] + pub unsafe fn addIndex(&self, value: NSUInteger); + + #[method(removeIndex:)] + pub unsafe fn removeIndex(&self, value: NSUInteger); + + #[method(addIndexesInRange:)] + pub unsafe fn addIndexesInRange(&self, range: NSRange); + + #[method(removeIndexesInRange:)] + pub unsafe fn removeIndexesInRange(&self, range: NSRange); + + #[method(shiftIndexesStartingAtIndex:by:)] + pub unsafe fn shiftIndexesStartingAtIndex_by(&self, index: NSUInteger, delta: NSInteger); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSInflectionRule.rs b/crates/icrate/src/generated/Foundation/NSInflectionRule.rs new file mode 100644 index 000000000..b71b5ba6b --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSInflectionRule.rs @@ -0,0 +1,56 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSInflectionRule; + + unsafe impl ClassType for NSInflectionRule { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSInflectionRule { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other automaticRule)] + pub unsafe fn automaticRule() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSInflectionRuleExplicit; + + unsafe impl ClassType for NSInflectionRuleExplicit { + type Super = NSInflectionRule; + } +); + +extern_methods!( + unsafe impl NSInflectionRuleExplicit { + #[method_id(@__retain_semantics Init initWithMorphology:)] + pub unsafe fn initWithMorphology( + this: Option>, + morphology: &NSMorphology, + ) -> Id; + + #[method_id(@__retain_semantics Other morphology)] + pub unsafe fn morphology(&self) -> Id; + } +); + +extern_methods!( + /// NSInflectionAvailability + unsafe impl NSInflectionRule { + #[method(canInflectLanguage:)] + pub unsafe fn canInflectLanguage(language: &NSString) -> bool; + + #[method(canInflectPreferredLocalization)] + pub unsafe fn canInflectPreferredLocalization() -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSInvocation.rs b/crates/icrate/src/generated/Foundation/NSInvocation.rs new file mode 100644 index 000000000..d489c5cea --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSInvocation.rs @@ -0,0 +1,61 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSInvocation; + + unsafe impl ClassType for NSInvocation { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSInvocation { + #[method_id(@__retain_semantics Other invocationWithMethodSignature:)] + pub unsafe fn invocationWithMethodSignature( + sig: &NSMethodSignature, + ) -> Id; + + #[method_id(@__retain_semantics Other methodSignature)] + pub unsafe fn methodSignature(&self) -> Id; + + #[method(retainArguments)] + pub unsafe fn retainArguments(&self); + + #[method(argumentsRetained)] + pub unsafe fn argumentsRetained(&self) -> bool; + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + + #[method(setTarget:)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + + #[method(selector)] + pub unsafe fn selector(&self) -> Sel; + + #[method(setSelector:)] + pub unsafe fn setSelector(&self, selector: Sel); + + #[method(getReturnValue:)] + pub unsafe fn getReturnValue(&self, retLoc: NonNull); + + #[method(setReturnValue:)] + pub unsafe fn setReturnValue(&self, retLoc: NonNull); + + #[method(getArgument:atIndex:)] + pub unsafe fn getArgument_atIndex(&self, argumentLocation: NonNull, idx: NSInteger); + + #[method(setArgument:atIndex:)] + pub unsafe fn setArgument_atIndex(&self, argumentLocation: NonNull, idx: NSInteger); + + #[method(invoke)] + pub unsafe fn invoke(&self); + + #[method(invokeWithTarget:)] + pub unsafe fn invokeWithTarget(&self, target: &Object); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSItemProvider.rs b/crates/icrate/src/generated/Foundation/NSItemProvider.rs new file mode 100644 index 000000000..20d6584b6 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSItemProvider.rs @@ -0,0 +1,244 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSItemProviderRepresentationVisibility { + NSItemProviderRepresentationVisibilityAll = 0, + NSItemProviderRepresentationVisibilityTeam = 1, + NSItemProviderRepresentationVisibilityGroup = 2, + NSItemProviderRepresentationVisibilityOwnProcess = 3, + } +); + +ns_options!( + #[underlying(NSInteger)] + pub enum NSItemProviderFileOptions { + NSItemProviderFileOptionOpenInPlace = 1, + } +); + +extern_protocol!( + pub struct NSItemProviderWriting; + + unsafe impl NSItemProviderWriting { + #[method_id(@__retain_semantics Other writableTypeIdentifiersForItemProvider)] + pub unsafe fn writableTypeIdentifiersForItemProvider() -> Id, Shared>; + + #[optional] + #[method_id(@__retain_semantics Other writableTypeIdentifiersForItemProvider)] + pub unsafe fn writableTypeIdentifiersForItemProvider( + &self, + ) -> Id, Shared>; + + #[optional] + #[method(itemProviderVisibilityForRepresentationWithTypeIdentifier:)] + pub unsafe fn itemProviderVisibilityForRepresentationWithTypeIdentifier( + typeIdentifier: &NSString, + ) -> NSItemProviderRepresentationVisibility; + + #[optional] + #[method(itemProviderVisibilityForRepresentationWithTypeIdentifier:)] + pub unsafe fn itemProviderVisibilityForRepresentationWithTypeIdentifier( + &self, + typeIdentifier: &NSString, + ) -> NSItemProviderRepresentationVisibility; + + #[method_id(@__retain_semantics Other loadDataWithTypeIdentifier:forItemProviderCompletionHandler:)] + pub unsafe fn loadDataWithTypeIdentifier_forItemProviderCompletionHandler( + &self, + typeIdentifier: &NSString, + completionHandler: &Block<(*mut NSData, *mut NSError), ()>, + ) -> Option>; + } +); + +extern_protocol!( + pub struct NSItemProviderReading; + + unsafe impl NSItemProviderReading { + #[method_id(@__retain_semantics Other readableTypeIdentifiersForItemProvider)] + pub unsafe fn readableTypeIdentifiersForItemProvider() -> Id, Shared>; + + #[method_id(@__retain_semantics Other objectWithItemProviderData:typeIdentifier:error:)] + pub unsafe fn objectWithItemProviderData_typeIdentifier_error( + data: &NSData, + typeIdentifier: &NSString, + ) -> Result, Id>; + } +); + +pub type NSItemProviderCompletionHandler = *mut Block<(*mut NSSecureCoding, *mut NSError), ()>; + +pub type NSItemProviderLoadHandler = *mut Block< + ( + NSItemProviderCompletionHandler, + *const Class, + *mut NSDictionary, + ), + (), +>; + +extern_class!( + #[derive(Debug)] + pub struct NSItemProvider; + + unsafe impl ClassType for NSItemProvider { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSItemProvider { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(registerDataRepresentationForTypeIdentifier:visibility:loadHandler:)] + pub unsafe fn registerDataRepresentationForTypeIdentifier_visibility_loadHandler( + &self, + typeIdentifier: &NSString, + visibility: NSItemProviderRepresentationVisibility, + loadHandler: &Block< + (NonNull>,), + *mut NSProgress, + >, + ); + + #[method(registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:)] + pub unsafe fn registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler( + &self, + typeIdentifier: &NSString, + fileOptions: NSItemProviderFileOptions, + visibility: NSItemProviderRepresentationVisibility, + loadHandler: &Block< + (NonNull>,), + *mut NSProgress, + >, + ); + + #[method_id(@__retain_semantics Other registeredTypeIdentifiers)] + pub unsafe fn registeredTypeIdentifiers(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other registeredTypeIdentifiersWithFileOptions:)] + pub unsafe fn registeredTypeIdentifiersWithFileOptions( + &self, + fileOptions: NSItemProviderFileOptions, + ) -> Id, Shared>; + + #[method(hasItemConformingToTypeIdentifier:)] + pub unsafe fn hasItemConformingToTypeIdentifier(&self, typeIdentifier: &NSString) -> bool; + + #[method(hasRepresentationConformingToTypeIdentifier:fileOptions:)] + pub unsafe fn hasRepresentationConformingToTypeIdentifier_fileOptions( + &self, + typeIdentifier: &NSString, + fileOptions: NSItemProviderFileOptions, + ) -> bool; + + #[method_id(@__retain_semantics Other loadDataRepresentationForTypeIdentifier:completionHandler:)] + pub unsafe fn loadDataRepresentationForTypeIdentifier_completionHandler( + &self, + typeIdentifier: &NSString, + completionHandler: &Block<(*mut NSData, *mut NSError), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Other loadFileRepresentationForTypeIdentifier:completionHandler:)] + pub unsafe fn loadFileRepresentationForTypeIdentifier_completionHandler( + &self, + typeIdentifier: &NSString, + completionHandler: &Block<(*mut NSURL, *mut NSError), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Other loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:)] + pub unsafe fn loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( + &self, + typeIdentifier: &NSString, + completionHandler: &Block<(*mut NSURL, Bool, *mut NSError), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Other suggestedName)] + pub unsafe fn suggestedName(&self) -> Option>; + + #[method(setSuggestedName:)] + pub unsafe fn setSuggestedName(&self, suggestedName: Option<&NSString>); + + #[method_id(@__retain_semantics Init initWithObject:)] + pub unsafe fn initWithObject( + this: Option>, + object: &NSItemProviderWriting, + ) -> Id; + + #[method(registerObject:visibility:)] + pub unsafe fn registerObject_visibility( + &self, + object: &NSItemProviderWriting, + visibility: NSItemProviderRepresentationVisibility, + ); + + #[method_id(@__retain_semantics Init initWithItem:typeIdentifier:)] + pub unsafe fn initWithItem_typeIdentifier( + this: Option>, + item: Option<&NSSecureCoding>, + typeIdentifier: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:)] + pub unsafe fn initWithContentsOfURL( + this: Option>, + fileURL: Option<&NSURL>, + ) -> Option>; + + #[method(registerItemForTypeIdentifier:loadHandler:)] + pub unsafe fn registerItemForTypeIdentifier_loadHandler( + &self, + typeIdentifier: &NSString, + loadHandler: NSItemProviderLoadHandler, + ); + + #[method(loadItemForTypeIdentifier:options:completionHandler:)] + pub unsafe fn loadItemForTypeIdentifier_options_completionHandler( + &self, + typeIdentifier: &NSString, + options: Option<&NSDictionary>, + completionHandler: NSItemProviderCompletionHandler, + ); + } +); + +extern_static!(NSItemProviderPreferredImageSizeKey: &'static NSString); + +extern_methods!( + /// NSPreviewSupport + unsafe impl NSItemProvider { + #[method(previewImageHandler)] + pub unsafe fn previewImageHandler(&self) -> NSItemProviderLoadHandler; + + #[method(setPreviewImageHandler:)] + pub unsafe fn setPreviewImageHandler(&self, previewImageHandler: NSItemProviderLoadHandler); + + #[method(loadPreviewImageWithOptions:completionHandler:)] + pub unsafe fn loadPreviewImageWithOptions_completionHandler( + &self, + options: Option<&NSDictionary>, + completionHandler: NSItemProviderCompletionHandler, + ); + } +); + +extern_static!(NSExtensionJavaScriptPreprocessingResultsKey: Option<&'static NSString>); + +extern_static!(NSExtensionJavaScriptFinalizeArgumentKey: Option<&'static NSString>); + +extern_static!(NSItemProviderErrorDomain: &'static NSString); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSItemProviderErrorCode { + NSItemProviderUnknownError = -1, + NSItemProviderItemUnavailableError = -1000, + NSItemProviderUnexpectedValueClassError = -1100, + NSItemProviderUnavailableCoercionError = -1200, + } +); diff --git a/crates/icrate/src/generated/Foundation/NSJSONSerialization.rs b/crates/icrate/src/generated/Foundation/NSJSONSerialization.rs new file mode 100644 index 000000000..a34f2d565 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSJSONSerialization.rs @@ -0,0 +1,60 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSJSONReadingOptions { + NSJSONReadingMutableContainers = 1 << 0, + NSJSONReadingMutableLeaves = 1 << 1, + NSJSONReadingFragmentsAllowed = 1 << 2, + NSJSONReadingJSON5Allowed = 1 << 3, + NSJSONReadingTopLevelDictionaryAssumed = 1 << 4, + NSJSONReadingAllowFragments = NSJSONReadingFragmentsAllowed, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSJSONWritingOptions { + NSJSONWritingPrettyPrinted = 1 << 0, + NSJSONWritingSortedKeys = 1 << 1, + NSJSONWritingFragmentsAllowed = 1 << 2, + NSJSONWritingWithoutEscapingSlashes = 1 << 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSJSONSerialization; + + unsafe impl ClassType for NSJSONSerialization { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSJSONSerialization { + #[method(isValidJSONObject:)] + pub unsafe fn isValidJSONObject(obj: &Object) -> bool; + + #[method_id(@__retain_semantics Other dataWithJSONObject:options:error:)] + pub unsafe fn dataWithJSONObject_options_error( + obj: &Object, + opt: NSJSONWritingOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other JSONObjectWithData:options:error:)] + pub unsafe fn JSONObjectWithData_options_error( + data: &NSData, + opt: NSJSONReadingOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other JSONObjectWithStream:options:error:)] + pub unsafe fn JSONObjectWithStream_options_error( + stream: &NSInputStream, + opt: NSJSONReadingOptions, + ) -> Result, Id>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSKeyValueCoding.rs b/crates/icrate/src/generated/Foundation/NSKeyValueCoding.rs new file mode 100644 index 000000000..9ce059959 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSKeyValueCoding.rs @@ -0,0 +1,202 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSUndefinedKeyException: &'static NSExceptionName); + +pub type NSKeyValueOperator = NSString; + +extern_static!(NSAverageKeyValueOperator: &'static NSKeyValueOperator); + +extern_static!(NSCountKeyValueOperator: &'static NSKeyValueOperator); + +extern_static!(NSDistinctUnionOfArraysKeyValueOperator: &'static NSKeyValueOperator); + +extern_static!(NSDistinctUnionOfObjectsKeyValueOperator: &'static NSKeyValueOperator); + +extern_static!(NSDistinctUnionOfSetsKeyValueOperator: &'static NSKeyValueOperator); + +extern_static!(NSMaximumKeyValueOperator: &'static NSKeyValueOperator); + +extern_static!(NSMinimumKeyValueOperator: &'static NSKeyValueOperator); + +extern_static!(NSSumKeyValueOperator: &'static NSKeyValueOperator); + +extern_static!(NSUnionOfArraysKeyValueOperator: &'static NSKeyValueOperator); + +extern_static!(NSUnionOfObjectsKeyValueOperator: &'static NSKeyValueOperator); + +extern_static!(NSUnionOfSetsKeyValueOperator: &'static NSKeyValueOperator); + +extern_methods!( + /// NSKeyValueCoding + unsafe impl NSObject { + #[method(accessInstanceVariablesDirectly)] + pub unsafe fn accessInstanceVariablesDirectly() -> bool; + + #[method_id(@__retain_semantics Other valueForKey:)] + pub unsafe fn valueForKey(&self, key: &NSString) -> Option>; + + #[method(setValue:forKey:)] + pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString); + + #[method(validateValue:forKey:error:)] + pub unsafe fn validateValue_forKey_error( + &self, + ioValue: NonNull<*mut Object>, + inKey: &NSString, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other mutableArrayValueForKey:)] + pub unsafe fn mutableArrayValueForKey(&self, key: &NSString) -> Id; + + #[method_id(@__retain_semantics Other mutableOrderedSetValueForKey:)] + pub unsafe fn mutableOrderedSetValueForKey( + &self, + key: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other mutableSetValueForKey:)] + pub unsafe fn mutableSetValueForKey(&self, key: &NSString) -> Id; + + #[method_id(@__retain_semantics Other valueForKeyPath:)] + pub unsafe fn valueForKeyPath(&self, keyPath: &NSString) -> Option>; + + #[method(setValue:forKeyPath:)] + pub unsafe fn setValue_forKeyPath(&self, value: Option<&Object>, keyPath: &NSString); + + #[method(validateValue:forKeyPath:error:)] + pub unsafe fn validateValue_forKeyPath_error( + &self, + ioValue: NonNull<*mut Object>, + inKeyPath: &NSString, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other mutableArrayValueForKeyPath:)] + pub unsafe fn mutableArrayValueForKeyPath( + &self, + keyPath: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other mutableOrderedSetValueForKeyPath:)] + pub unsafe fn mutableOrderedSetValueForKeyPath( + &self, + keyPath: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other mutableSetValueForKeyPath:)] + pub unsafe fn mutableSetValueForKeyPath( + &self, + keyPath: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other valueForUndefinedKey:)] + pub unsafe fn valueForUndefinedKey(&self, key: &NSString) -> Option>; + + #[method(setValue:forUndefinedKey:)] + pub unsafe fn setValue_forUndefinedKey(&self, value: Option<&Object>, key: &NSString); + + #[method(setNilValueForKey:)] + pub unsafe fn setNilValueForKey(&self, key: &NSString); + + #[method_id(@__retain_semantics Other dictionaryWithValuesForKeys:)] + pub unsafe fn dictionaryWithValuesForKeys( + &self, + keys: &NSArray, + ) -> Id, Shared>; + + #[method(setValuesForKeysWithDictionary:)] + pub unsafe fn setValuesForKeysWithDictionary( + &self, + keyedValues: &NSDictionary, + ); + } +); + +extern_methods!( + /// NSKeyValueCoding + unsafe impl NSArray { + #[method_id(@__retain_semantics Other valueForKey:)] + pub unsafe fn valueForKey(&self, key: &NSString) -> Id; + + #[method(setValue:forKey:)] + pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString); + } +); + +extern_methods!( + /// NSKeyValueCoding + unsafe impl NSDictionary { + #[method_id(@__retain_semantics Other valueForKey:)] + pub unsafe fn valueForKey(&self, key: &NSString) -> Option>; + } +); + +extern_methods!( + /// NSKeyValueCoding + unsafe impl NSMutableDictionary { + #[method(setValue:forKey:)] + pub unsafe fn setValue_forKey(&self, value: Option<&ObjectType>, key: &NSString); + } +); + +extern_methods!( + /// NSKeyValueCoding + unsafe impl NSOrderedSet { + #[method_id(@__retain_semantics Other valueForKey:)] + pub unsafe fn valueForKey(&self, key: &NSString) -> Id; + + #[method(setValue:forKey:)] + pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString); + } +); + +extern_methods!( + /// NSKeyValueCoding + unsafe impl NSSet { + #[method_id(@__retain_semantics Other valueForKey:)] + pub unsafe fn valueForKey(&self, key: &NSString) -> Id; + + #[method(setValue:forKey:)] + pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString); + } +); + +extern_methods!( + /// NSDeprecatedKeyValueCoding + unsafe impl NSObject { + #[method(useStoredAccessor)] + pub unsafe fn useStoredAccessor() -> bool; + + #[method_id(@__retain_semantics Other storedValueForKey:)] + pub unsafe fn storedValueForKey(&self, key: &NSString) -> Option>; + + #[method(takeStoredValue:forKey:)] + pub unsafe fn takeStoredValue_forKey(&self, value: Option<&Object>, key: &NSString); + + #[method(takeValue:forKey:)] + pub unsafe fn takeValue_forKey(&self, value: Option<&Object>, key: &NSString); + + #[method(takeValue:forKeyPath:)] + pub unsafe fn takeValue_forKeyPath(&self, value: Option<&Object>, keyPath: &NSString); + + #[method_id(@__retain_semantics Other handleQueryWithUnboundKey:)] + pub unsafe fn handleQueryWithUnboundKey( + &self, + key: &NSString, + ) -> Option>; + + #[method(handleTakeValue:forUnboundKey:)] + pub unsafe fn handleTakeValue_forUnboundKey(&self, value: Option<&Object>, key: &NSString); + + #[method(unableToSetNilForKey:)] + pub unsafe fn unableToSetNilForKey(&self, key: &NSString); + + #[method_id(@__retain_semantics Other valuesForKeys:)] + pub unsafe fn valuesForKeys(&self, keys: &NSArray) -> Id; + + #[method(takeValuesFromDictionary:)] + pub unsafe fn takeValuesFromDictionary(&self, properties: &NSDictionary); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSKeyValueObserving.rs b/crates/icrate/src/generated/Foundation/NSKeyValueObserving.rs new file mode 100644 index 000000000..5a2441bc4 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSKeyValueObserving.rs @@ -0,0 +1,260 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSKeyValueObservingOptions { + NSKeyValueObservingOptionNew = 0x01, + NSKeyValueObservingOptionOld = 0x02, + NSKeyValueObservingOptionInitial = 0x04, + NSKeyValueObservingOptionPrior = 0x08, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSKeyValueChange { + NSKeyValueChangeSetting = 1, + NSKeyValueChangeInsertion = 2, + NSKeyValueChangeRemoval = 3, + NSKeyValueChangeReplacement = 4, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSKeyValueSetMutationKind { + NSKeyValueUnionSetMutation = 1, + NSKeyValueMinusSetMutation = 2, + NSKeyValueIntersectSetMutation = 3, + NSKeyValueSetSetMutation = 4, + } +); + +pub type NSKeyValueChangeKey = NSString; + +extern_static!(NSKeyValueChangeKindKey: &'static NSKeyValueChangeKey); + +extern_static!(NSKeyValueChangeNewKey: &'static NSKeyValueChangeKey); + +extern_static!(NSKeyValueChangeOldKey: &'static NSKeyValueChangeKey); + +extern_static!(NSKeyValueChangeIndexesKey: &'static NSKeyValueChangeKey); + +extern_static!(NSKeyValueChangeNotificationIsPriorKey: &'static NSKeyValueChangeKey); + +extern_methods!( + /// NSKeyValueObserving + unsafe impl NSObject { + #[method(observeValueForKeyPath:ofObject:change:context:)] + pub unsafe fn observeValueForKeyPath_ofObject_change_context( + &self, + keyPath: Option<&NSString>, + object: Option<&Object>, + change: Option<&NSDictionary>, + context: *mut c_void, + ); + } +); + +extern_methods!( + /// NSKeyValueObserverRegistration + unsafe impl NSObject { + #[method(addObserver:forKeyPath:options:context:)] + pub unsafe fn addObserver_forKeyPath_options_context( + &self, + observer: &NSObject, + keyPath: &NSString, + options: NSKeyValueObservingOptions, + context: *mut c_void, + ); + + #[method(removeObserver:forKeyPath:context:)] + pub unsafe fn removeObserver_forKeyPath_context( + &self, + observer: &NSObject, + keyPath: &NSString, + context: *mut c_void, + ); + + #[method(removeObserver:forKeyPath:)] + pub unsafe fn removeObserver_forKeyPath(&self, observer: &NSObject, keyPath: &NSString); + } +); + +extern_methods!( + /// NSKeyValueObserverRegistration + unsafe impl NSArray { + #[method(addObserver:toObjectsAtIndexes:forKeyPath:options:context:)] + pub unsafe fn addObserver_toObjectsAtIndexes_forKeyPath_options_context( + &self, + observer: &NSObject, + indexes: &NSIndexSet, + keyPath: &NSString, + options: NSKeyValueObservingOptions, + context: *mut c_void, + ); + + #[method(removeObserver:fromObjectsAtIndexes:forKeyPath:context:)] + pub unsafe fn removeObserver_fromObjectsAtIndexes_forKeyPath_context( + &self, + observer: &NSObject, + indexes: &NSIndexSet, + keyPath: &NSString, + context: *mut c_void, + ); + + #[method(removeObserver:fromObjectsAtIndexes:forKeyPath:)] + pub unsafe fn removeObserver_fromObjectsAtIndexes_forKeyPath( + &self, + observer: &NSObject, + indexes: &NSIndexSet, + keyPath: &NSString, + ); + + #[method(addObserver:forKeyPath:options:context:)] + pub unsafe fn addObserver_forKeyPath_options_context( + &self, + observer: &NSObject, + keyPath: &NSString, + options: NSKeyValueObservingOptions, + context: *mut c_void, + ); + + #[method(removeObserver:forKeyPath:context:)] + pub unsafe fn removeObserver_forKeyPath_context( + &self, + observer: &NSObject, + keyPath: &NSString, + context: *mut c_void, + ); + + #[method(removeObserver:forKeyPath:)] + pub unsafe fn removeObserver_forKeyPath(&self, observer: &NSObject, keyPath: &NSString); + } +); + +extern_methods!( + /// NSKeyValueObserverRegistration + unsafe impl NSOrderedSet { + #[method(addObserver:forKeyPath:options:context:)] + pub unsafe fn addObserver_forKeyPath_options_context( + &self, + observer: &NSObject, + keyPath: &NSString, + options: NSKeyValueObservingOptions, + context: *mut c_void, + ); + + #[method(removeObserver:forKeyPath:context:)] + pub unsafe fn removeObserver_forKeyPath_context( + &self, + observer: &NSObject, + keyPath: &NSString, + context: *mut c_void, + ); + + #[method(removeObserver:forKeyPath:)] + pub unsafe fn removeObserver_forKeyPath(&self, observer: &NSObject, keyPath: &NSString); + } +); + +extern_methods!( + /// NSKeyValueObserverRegistration + unsafe impl NSSet { + #[method(addObserver:forKeyPath:options:context:)] + pub unsafe fn addObserver_forKeyPath_options_context( + &self, + observer: &NSObject, + keyPath: &NSString, + options: NSKeyValueObservingOptions, + context: *mut c_void, + ); + + #[method(removeObserver:forKeyPath:context:)] + pub unsafe fn removeObserver_forKeyPath_context( + &self, + observer: &NSObject, + keyPath: &NSString, + context: *mut c_void, + ); + + #[method(removeObserver:forKeyPath:)] + pub unsafe fn removeObserver_forKeyPath(&self, observer: &NSObject, keyPath: &NSString); + } +); + +extern_methods!( + /// NSKeyValueObserverNotification + unsafe impl NSObject { + #[method(willChangeValueForKey:)] + pub unsafe fn willChangeValueForKey(&self, key: &NSString); + + #[method(didChangeValueForKey:)] + pub unsafe fn didChangeValueForKey(&self, key: &NSString); + + #[method(willChange:valuesAtIndexes:forKey:)] + pub unsafe fn willChange_valuesAtIndexes_forKey( + &self, + changeKind: NSKeyValueChange, + indexes: &NSIndexSet, + key: &NSString, + ); + + #[method(didChange:valuesAtIndexes:forKey:)] + pub unsafe fn didChange_valuesAtIndexes_forKey( + &self, + changeKind: NSKeyValueChange, + indexes: &NSIndexSet, + key: &NSString, + ); + + #[method(willChangeValueForKey:withSetMutation:usingObjects:)] + pub unsafe fn willChangeValueForKey_withSetMutation_usingObjects( + &self, + key: &NSString, + mutationKind: NSKeyValueSetMutationKind, + objects: &NSSet, + ); + + #[method(didChangeValueForKey:withSetMutation:usingObjects:)] + pub unsafe fn didChangeValueForKey_withSetMutation_usingObjects( + &self, + key: &NSString, + mutationKind: NSKeyValueSetMutationKind, + objects: &NSSet, + ); + } +); + +extern_methods!( + /// NSKeyValueObservingCustomization + unsafe impl NSObject { + #[method_id(@__retain_semantics Other keyPathsForValuesAffectingValueForKey:)] + pub unsafe fn keyPathsForValuesAffectingValueForKey( + key: &NSString, + ) -> Id, Shared>; + + #[method(automaticallyNotifiesObserversForKey:)] + pub unsafe fn automaticallyNotifiesObserversForKey(key: &NSString) -> bool; + + #[method(observationInfo)] + pub unsafe fn observationInfo(&self) -> *mut c_void; + + #[method(setObservationInfo:)] + pub unsafe fn setObservationInfo(&self, observationInfo: *mut c_void); + } +); + +extern_methods!( + /// NSDeprecatedKeyValueObservingCustomization + unsafe impl NSObject { + #[method(setKeys:triggerChangeNotificationsForDependentKey:)] + pub unsafe fn setKeys_triggerChangeNotificationsForDependentKey( + keys: &NSArray, + dependentKey: &NSString, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSKeyedArchiver.rs b/crates/icrate/src/generated/Foundation/NSKeyedArchiver.rs new file mode 100644 index 000000000..97eeb3bcf --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSKeyedArchiver.rs @@ -0,0 +1,338 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSInvalidArchiveOperationException: &'static NSExceptionName); + +extern_static!(NSInvalidUnarchiveOperationException: &'static NSExceptionName); + +extern_static!(NSKeyedArchiveRootObjectKey: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSKeyedArchiver; + + unsafe impl ClassType for NSKeyedArchiver { + type Super = NSCoder; + } +); + +extern_methods!( + unsafe impl NSKeyedArchiver { + #[method_id(@__retain_semantics Init initRequiringSecureCoding:)] + pub unsafe fn initRequiringSecureCoding( + this: Option>, + requiresSecureCoding: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other archivedDataWithRootObject:requiringSecureCoding:error:)] + pub unsafe fn archivedDataWithRootObject_requiringSecureCoding_error( + object: &Object, + requiresSecureCoding: bool, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initForWritingWithMutableData:)] + pub unsafe fn initForWritingWithMutableData( + this: Option>, + data: &NSMutableData, + ) -> Id; + + #[method_id(@__retain_semantics Other archivedDataWithRootObject:)] + pub unsafe fn archivedDataWithRootObject(rootObject: &Object) -> Id; + + #[method(archiveRootObject:toFile:)] + pub unsafe fn archiveRootObject_toFile(rootObject: &Object, path: &NSString) -> bool; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSKeyedArchiverDelegate>); + + #[method(outputFormat)] + pub unsafe fn outputFormat(&self) -> NSPropertyListFormat; + + #[method(setOutputFormat:)] + pub unsafe fn setOutputFormat(&self, outputFormat: NSPropertyListFormat); + + #[method_id(@__retain_semantics Other encodedData)] + pub unsafe fn encodedData(&self) -> Id; + + #[method(finishEncoding)] + pub unsafe fn finishEncoding(&self); + + #[method(encodeObject:forKey:)] + pub unsafe fn encodeObject_forKey(&self, object: Option<&Object>, key: &NSString); + + #[method(encodeConditionalObject:forKey:)] + pub unsafe fn encodeConditionalObject_forKey( + &self, + object: Option<&Object>, + key: &NSString, + ); + + #[method(encodeBool:forKey:)] + pub unsafe fn encodeBool_forKey(&self, value: bool, key: &NSString); + + #[method(encodeInt:forKey:)] + pub unsafe fn encodeInt_forKey(&self, value: c_int, key: &NSString); + + #[method(encodeInt32:forKey:)] + pub unsafe fn encodeInt32_forKey(&self, value: i32, key: &NSString); + + #[method(encodeInt64:forKey:)] + pub unsafe fn encodeInt64_forKey(&self, value: i64, key: &NSString); + + #[method(encodeFloat:forKey:)] + pub unsafe fn encodeFloat_forKey(&self, value: c_float, key: &NSString); + + #[method(encodeDouble:forKey:)] + pub unsafe fn encodeDouble_forKey(&self, value: c_double, key: &NSString); + + #[method(encodeBytes:length:forKey:)] + pub unsafe fn encodeBytes_length_forKey( + &self, + bytes: *mut u8, + length: NSUInteger, + key: &NSString, + ); + + #[method(requiresSecureCoding)] + pub unsafe fn requiresSecureCoding(&self) -> bool; + + #[method(setRequiresSecureCoding:)] + pub unsafe fn setRequiresSecureCoding(&self, requiresSecureCoding: bool); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSKeyedUnarchiver; + + unsafe impl ClassType for NSKeyedUnarchiver { + type Super = NSCoder; + } +); + +extern_methods!( + unsafe impl NSKeyedUnarchiver { + #[method_id(@__retain_semantics Init initForReadingFromData:error:)] + pub unsafe fn initForReadingFromData_error( + this: Option>, + data: &NSData, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other unarchivedObjectOfClass:fromData:error:)] + pub unsafe fn unarchivedObjectOfClass_fromData_error( + cls: &Class, + data: &NSData, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other unarchivedArrayOfObjectsOfClass:fromData:error:)] + pub unsafe fn unarchivedArrayOfObjectsOfClass_fromData_error( + cls: &Class, + data: &NSData, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other unarchivedDictionaryWithKeysOfClass:objectsOfClass:fromData:error:)] + pub unsafe fn unarchivedDictionaryWithKeysOfClass_objectsOfClass_fromData_error( + keyCls: &Class, + valueCls: &Class, + data: &NSData, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other unarchivedObjectOfClasses:fromData:error:)] + pub unsafe fn unarchivedObjectOfClasses_fromData_error( + classes: &NSSet, + data: &NSData, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other unarchivedArrayOfObjectsOfClasses:fromData:error:)] + pub unsafe fn unarchivedArrayOfObjectsOfClasses_fromData_error( + classes: &NSSet, + data: &NSData, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other unarchivedDictionaryWithKeysOfClasses:objectsOfClasses:fromData:error:)] + pub unsafe fn unarchivedDictionaryWithKeysOfClasses_objectsOfClasses_fromData_error( + keyClasses: &NSSet, + valueClasses: &NSSet, + data: &NSData, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initForReadingWithData:)] + pub unsafe fn initForReadingWithData( + this: Option>, + data: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Other unarchiveObjectWithData:)] + pub unsafe fn unarchiveObjectWithData(data: &NSData) -> Option>; + + #[method_id(@__retain_semantics Other unarchiveTopLevelObjectWithData:error:)] + pub unsafe fn unarchiveTopLevelObjectWithData_error( + data: &NSData, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other unarchiveObjectWithFile:)] + pub unsafe fn unarchiveObjectWithFile(path: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSKeyedUnarchiverDelegate>); + + #[method(finishDecoding)] + pub unsafe fn finishDecoding(&self); + + #[method(containsValueForKey:)] + pub unsafe fn containsValueForKey(&self, key: &NSString) -> bool; + + #[method_id(@__retain_semantics Other decodeObjectForKey:)] + pub unsafe fn decodeObjectForKey(&self, key: &NSString) -> Option>; + + #[method(decodeBoolForKey:)] + pub unsafe fn decodeBoolForKey(&self, key: &NSString) -> bool; + + #[method(decodeIntForKey:)] + pub unsafe fn decodeIntForKey(&self, key: &NSString) -> c_int; + + #[method(decodeInt32ForKey:)] + pub unsafe fn decodeInt32ForKey(&self, key: &NSString) -> i32; + + #[method(decodeInt64ForKey:)] + pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> i64; + + #[method(decodeFloatForKey:)] + pub unsafe fn decodeFloatForKey(&self, key: &NSString) -> c_float; + + #[method(decodeDoubleForKey:)] + pub unsafe fn decodeDoubleForKey(&self, key: &NSString) -> c_double; + + #[method(decodeBytesForKey:returnedLength:)] + pub unsafe fn decodeBytesForKey_returnedLength( + &self, + key: &NSString, + lengthp: *mut NSUInteger, + ) -> *mut u8; + + #[method(requiresSecureCoding)] + pub unsafe fn requiresSecureCoding(&self) -> bool; + + #[method(setRequiresSecureCoding:)] + pub unsafe fn setRequiresSecureCoding(&self, requiresSecureCoding: bool); + + #[method(decodingFailurePolicy)] + pub unsafe fn decodingFailurePolicy(&self) -> NSDecodingFailurePolicy; + + #[method(setDecodingFailurePolicy:)] + pub unsafe fn setDecodingFailurePolicy( + &self, + decodingFailurePolicy: NSDecodingFailurePolicy, + ); + } +); + +extern_protocol!( + pub struct NSKeyedArchiverDelegate; + + unsafe impl NSKeyedArchiverDelegate { + #[optional] + #[method_id(@__retain_semantics Other archiver:willEncodeObject:)] + pub unsafe fn archiver_willEncodeObject( + &self, + archiver: &NSKeyedArchiver, + object: &Object, + ) -> Option>; + + #[optional] + #[method(archiver:didEncodeObject:)] + pub unsafe fn archiver_didEncodeObject( + &self, + archiver: &NSKeyedArchiver, + object: Option<&Object>, + ); + + #[optional] + #[method(archiver:willReplaceObject:withObject:)] + pub unsafe fn archiver_willReplaceObject_withObject( + &self, + archiver: &NSKeyedArchiver, + object: Option<&Object>, + newObject: Option<&Object>, + ); + + #[optional] + #[method(archiverWillFinish:)] + pub unsafe fn archiverWillFinish(&self, archiver: &NSKeyedArchiver); + + #[optional] + #[method(archiverDidFinish:)] + pub unsafe fn archiverDidFinish(&self, archiver: &NSKeyedArchiver); + } +); + +extern_protocol!( + pub struct NSKeyedUnarchiverDelegate; + + unsafe impl NSKeyedUnarchiverDelegate { + #[optional] + #[method(unarchiver:cannotDecodeObjectOfClassName:originalClasses:)] + pub unsafe fn unarchiver_cannotDecodeObjectOfClassName_originalClasses( + &self, + unarchiver: &NSKeyedUnarchiver, + name: &NSString, + classNames: &NSArray, + ) -> Option<&'static Class>; + + #[optional] + #[method(unarchiver:willReplaceObject:withObject:)] + pub unsafe fn unarchiver_willReplaceObject_withObject( + &self, + unarchiver: &NSKeyedUnarchiver, + object: &Object, + newObject: &Object, + ); + + #[optional] + #[method(unarchiverWillFinish:)] + pub unsafe fn unarchiverWillFinish(&self, unarchiver: &NSKeyedUnarchiver); + + #[optional] + #[method(unarchiverDidFinish:)] + pub unsafe fn unarchiverDidFinish(&self, unarchiver: &NSKeyedUnarchiver); + } +); + +extern_methods!( + /// NSKeyedArchiverObjectSubstitution + unsafe impl NSObject { + #[method(classForKeyedArchiver)] + pub unsafe fn classForKeyedArchiver(&self) -> Option<&'static Class>; + + #[method_id(@__retain_semantics Other replacementObjectForKeyedArchiver:)] + pub unsafe fn replacementObjectForKeyedArchiver( + &self, + archiver: &NSKeyedArchiver, + ) -> Option>; + + #[method_id(@__retain_semantics Other classFallbacksForKeyedArchiver)] + pub unsafe fn classFallbacksForKeyedArchiver() -> Id, Shared>; + } +); + +extern_methods!( + /// NSKeyedUnarchiverObjectSubstitution + unsafe impl NSObject { + #[method(classForKeyedUnarchiver)] + pub unsafe fn classForKeyedUnarchiver() -> &'static Class; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSLengthFormatter.rs b/crates/icrate/src/generated/Foundation/NSLengthFormatter.rs new file mode 100644 index 000000000..9e79a3fbe --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSLengthFormatter.rs @@ -0,0 +1,81 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSLengthFormatterUnit { + NSLengthFormatterUnitMillimeter = 8, + NSLengthFormatterUnitCentimeter = 9, + NSLengthFormatterUnitMeter = 11, + NSLengthFormatterUnitKilometer = 14, + NSLengthFormatterUnitInch = (5 << 8) + 1, + NSLengthFormatterUnitFoot = (5 << 8) + 2, + NSLengthFormatterUnitYard = (5 << 8) + 3, + NSLengthFormatterUnitMile = (5 << 8) + 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSLengthFormatter; + + unsafe impl ClassType for NSLengthFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSLengthFormatter { + #[method_id(@__retain_semantics Other numberFormatter)] + pub unsafe fn numberFormatter(&self) -> Id; + + #[method(setNumberFormatter:)] + pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>); + + #[method(unitStyle)] + pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle; + + #[method(setUnitStyle:)] + pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle); + + #[method(isForPersonHeightUse)] + pub unsafe fn isForPersonHeightUse(&self) -> bool; + + #[method(setForPersonHeightUse:)] + pub unsafe fn setForPersonHeightUse(&self, forPersonHeightUse: bool); + + #[method_id(@__retain_semantics Other stringFromValue:unit:)] + pub unsafe fn stringFromValue_unit( + &self, + value: c_double, + unit: NSLengthFormatterUnit, + ) -> Id; + + #[method_id(@__retain_semantics Other stringFromMeters:)] + pub unsafe fn stringFromMeters(&self, numberInMeters: c_double) -> Id; + + #[method_id(@__retain_semantics Other unitStringFromValue:unit:)] + pub unsafe fn unitStringFromValue_unit( + &self, + value: c_double, + unit: NSLengthFormatterUnit, + ) -> Id; + + #[method_id(@__retain_semantics Other unitStringFromMeters:usedUnit:)] + pub unsafe fn unitStringFromMeters_usedUnit( + &self, + numberInMeters: c_double, + unitp: *mut NSLengthFormatterUnit, + ) -> Id; + + #[method(getObjectValue:forString:errorDescription:)] + pub unsafe fn getObjectValue_forString_errorDescription( + &self, + obj: *mut *mut Object, + string: &NSString, + error: *mut *mut NSString, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSLinguisticTagger.rs b/crates/icrate/src/generated/Foundation/NSLinguisticTagger.rs new file mode 100644 index 000000000..05b83f1ff --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSLinguisticTagger.rs @@ -0,0 +1,305 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSLinguisticTagScheme = NSString; + +extern_static!(NSLinguisticTagSchemeTokenType: &'static NSLinguisticTagScheme); + +extern_static!(NSLinguisticTagSchemeLexicalClass: &'static NSLinguisticTagScheme); + +extern_static!(NSLinguisticTagSchemeNameType: &'static NSLinguisticTagScheme); + +extern_static!(NSLinguisticTagSchemeNameTypeOrLexicalClass: &'static NSLinguisticTagScheme); + +extern_static!(NSLinguisticTagSchemeLemma: &'static NSLinguisticTagScheme); + +extern_static!(NSLinguisticTagSchemeLanguage: &'static NSLinguisticTagScheme); + +extern_static!(NSLinguisticTagSchemeScript: &'static NSLinguisticTagScheme); + +pub type NSLinguisticTag = NSString; + +extern_static!(NSLinguisticTagWord: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagPunctuation: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagWhitespace: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagOther: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagNoun: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagVerb: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagAdjective: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagAdverb: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagPronoun: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagDeterminer: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagParticle: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagPreposition: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagNumber: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagConjunction: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagInterjection: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagClassifier: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagIdiom: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagOtherWord: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagSentenceTerminator: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagOpenQuote: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagCloseQuote: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagOpenParenthesis: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagCloseParenthesis: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagWordJoiner: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagDash: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagOtherPunctuation: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagParagraphBreak: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagOtherWhitespace: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagPersonalName: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagPlaceName: &'static NSLinguisticTag); + +extern_static!(NSLinguisticTagOrganizationName: &'static NSLinguisticTag); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSLinguisticTaggerUnit { + NSLinguisticTaggerUnitWord = 0, + NSLinguisticTaggerUnitSentence = 1, + NSLinguisticTaggerUnitParagraph = 2, + NSLinguisticTaggerUnitDocument = 3, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSLinguisticTaggerOptions { + NSLinguisticTaggerOmitWords = 1 << 0, + NSLinguisticTaggerOmitPunctuation = 1 << 1, + NSLinguisticTaggerOmitWhitespace = 1 << 2, + NSLinguisticTaggerOmitOther = 1 << 3, + NSLinguisticTaggerJoinNames = 1 << 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSLinguisticTagger; + + unsafe impl ClassType for NSLinguisticTagger { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSLinguisticTagger { + #[method_id(@__retain_semantics Init initWithTagSchemes:options:)] + pub unsafe fn initWithTagSchemes_options( + this: Option>, + tagSchemes: &NSArray, + opts: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other tagSchemes)] + pub unsafe fn tagSchemes(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other string)] + pub unsafe fn string(&self) -> Option>; + + #[method(setString:)] + pub unsafe fn setString(&self, string: Option<&NSString>); + + #[method_id(@__retain_semantics Other availableTagSchemesForUnit:language:)] + pub unsafe fn availableTagSchemesForUnit_language( + unit: NSLinguisticTaggerUnit, + language: &NSString, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other availableTagSchemesForLanguage:)] + pub unsafe fn availableTagSchemesForLanguage( + language: &NSString, + ) -> Id, Shared>; + + #[method(setOrthography:range:)] + pub unsafe fn setOrthography_range( + &self, + orthography: Option<&NSOrthography>, + range: NSRange, + ); + + #[method_id(@__retain_semantics Other orthographyAtIndex:effectiveRange:)] + pub unsafe fn orthographyAtIndex_effectiveRange( + &self, + charIndex: NSUInteger, + effectiveRange: NSRangePointer, + ) -> Option>; + + #[method(stringEditedInRange:changeInLength:)] + pub unsafe fn stringEditedInRange_changeInLength( + &self, + newRange: NSRange, + delta: NSInteger, + ); + + #[method(tokenRangeAtIndex:unit:)] + pub unsafe fn tokenRangeAtIndex_unit( + &self, + charIndex: NSUInteger, + unit: NSLinguisticTaggerUnit, + ) -> NSRange; + + #[method(sentenceRangeForRange:)] + pub unsafe fn sentenceRangeForRange(&self, range: NSRange) -> NSRange; + + #[method(enumerateTagsInRange:unit:scheme:options:usingBlock:)] + pub unsafe fn enumerateTagsInRange_unit_scheme_options_usingBlock( + &self, + range: NSRange, + unit: NSLinguisticTaggerUnit, + scheme: &NSLinguisticTagScheme, + options: NSLinguisticTaggerOptions, + block: &Block<(*mut NSLinguisticTag, NSRange, NonNull), ()>, + ); + + #[method_id(@__retain_semantics Other tagAtIndex:unit:scheme:tokenRange:)] + pub unsafe fn tagAtIndex_unit_scheme_tokenRange( + &self, + charIndex: NSUInteger, + unit: NSLinguisticTaggerUnit, + scheme: &NSLinguisticTagScheme, + tokenRange: NSRangePointer, + ) -> Option>; + + #[method_id(@__retain_semantics Other tagsInRange:unit:scheme:options:tokenRanges:)] + pub unsafe fn tagsInRange_unit_scheme_options_tokenRanges( + &self, + range: NSRange, + unit: NSLinguisticTaggerUnit, + scheme: &NSLinguisticTagScheme, + options: NSLinguisticTaggerOptions, + tokenRanges: *mut *mut NSArray, + ) -> Id, Shared>; + + #[method(enumerateTagsInRange:scheme:options:usingBlock:)] + pub unsafe fn enumerateTagsInRange_scheme_options_usingBlock( + &self, + range: NSRange, + tagScheme: &NSLinguisticTagScheme, + opts: NSLinguisticTaggerOptions, + block: &Block<(*mut NSLinguisticTag, NSRange, NSRange, NonNull), ()>, + ); + + #[method_id(@__retain_semantics Other tagAtIndex:scheme:tokenRange:sentenceRange:)] + pub unsafe fn tagAtIndex_scheme_tokenRange_sentenceRange( + &self, + charIndex: NSUInteger, + scheme: &NSLinguisticTagScheme, + tokenRange: NSRangePointer, + sentenceRange: NSRangePointer, + ) -> Option>; + + #[method_id(@__retain_semantics Other tagsInRange:scheme:options:tokenRanges:)] + pub unsafe fn tagsInRange_scheme_options_tokenRanges( + &self, + range: NSRange, + tagScheme: &NSString, + opts: NSLinguisticTaggerOptions, + tokenRanges: *mut *mut NSArray, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other dominantLanguage)] + pub unsafe fn dominantLanguage(&self) -> Option>; + + #[method_id(@__retain_semantics Other dominantLanguageForString:)] + pub unsafe fn dominantLanguageForString(string: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other tagForString:atIndex:unit:scheme:orthography:tokenRange:)] + pub unsafe fn tagForString_atIndex_unit_scheme_orthography_tokenRange( + string: &NSString, + charIndex: NSUInteger, + unit: NSLinguisticTaggerUnit, + scheme: &NSLinguisticTagScheme, + orthography: Option<&NSOrthography>, + tokenRange: NSRangePointer, + ) -> Option>; + + #[method_id(@__retain_semantics Other tagsForString:range:unit:scheme:options:orthography:tokenRanges:)] + pub unsafe fn tagsForString_range_unit_scheme_options_orthography_tokenRanges( + string: &NSString, + range: NSRange, + unit: NSLinguisticTaggerUnit, + scheme: &NSLinguisticTagScheme, + options: NSLinguisticTaggerOptions, + orthography: Option<&NSOrthography>, + tokenRanges: *mut *mut NSArray, + ) -> Id, Shared>; + + #[method(enumerateTagsForString:range:unit:scheme:options:orthography:usingBlock:)] + pub unsafe fn enumerateTagsForString_range_unit_scheme_options_orthography_usingBlock( + string: &NSString, + range: NSRange, + unit: NSLinguisticTaggerUnit, + scheme: &NSLinguisticTagScheme, + options: NSLinguisticTaggerOptions, + orthography: Option<&NSOrthography>, + block: &Block<(*mut NSLinguisticTag, NSRange, NonNull), ()>, + ); + + #[method_id(@__retain_semantics Other possibleTagsAtIndex:scheme:tokenRange:sentenceRange:scores:)] + pub unsafe fn possibleTagsAtIndex_scheme_tokenRange_sentenceRange_scores( + &self, + charIndex: NSUInteger, + tagScheme: &NSString, + tokenRange: NSRangePointer, + sentenceRange: NSRangePointer, + scores: *mut *mut NSArray, + ) -> Option, Shared>>; + } +); + +extern_methods!( + /// NSLinguisticAnalysis + unsafe impl NSString { + #[method_id(@__retain_semantics Other linguisticTagsInRange:scheme:options:orthography:tokenRanges:)] + pub unsafe fn linguisticTagsInRange_scheme_options_orthography_tokenRanges( + &self, + range: NSRange, + scheme: &NSLinguisticTagScheme, + options: NSLinguisticTaggerOptions, + orthography: Option<&NSOrthography>, + tokenRanges: *mut *mut NSArray, + ) -> Id, Shared>; + + #[method(enumerateLinguisticTagsInRange:scheme:options:orthography:usingBlock:)] + pub unsafe fn enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock( + &self, + range: NSRange, + scheme: &NSLinguisticTagScheme, + options: NSLinguisticTaggerOptions, + orthography: Option<&NSOrthography>, + block: &Block<(*mut NSLinguisticTag, NSRange, NSRange, NonNull), ()>, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSListFormatter.rs b/crates/icrate/src/generated/Foundation/NSListFormatter.rs new file mode 100644 index 000000000..ab79eaa36 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSListFormatter.rs @@ -0,0 +1,43 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSListFormatter; + + unsafe impl ClassType for NSListFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSListFormatter { + #[method_id(@__retain_semantics Other locale)] + pub unsafe fn locale(&self) -> Id; + + #[method(setLocale:)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + + #[method_id(@__retain_semantics Other itemFormatter)] + pub unsafe fn itemFormatter(&self) -> Option>; + + #[method(setItemFormatter:)] + pub unsafe fn setItemFormatter(&self, itemFormatter: Option<&NSFormatter>); + + #[method_id(@__retain_semantics Other localizedStringByJoiningStrings:)] + pub unsafe fn localizedStringByJoiningStrings( + strings: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other stringFromItems:)] + pub unsafe fn stringFromItems(&self, items: &NSArray) -> Option>; + + #[method_id(@__retain_semantics Other stringForObjectValue:)] + pub unsafe fn stringForObjectValue( + &self, + obj: Option<&Object>, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSLocale.rs b/crates/icrate/src/generated/Foundation/NSLocale.rs new file mode 100644 index 000000000..1ae565a07 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSLocale.rs @@ -0,0 +1,307 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSLocaleKey = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSLocale; + + unsafe impl ClassType for NSLocale { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSLocale { + #[method_id(@__retain_semantics Other objectForKey:)] + pub unsafe fn objectForKey(&self, key: &NSLocaleKey) -> Option>; + + #[method_id(@__retain_semantics Other displayNameForKey:value:)] + pub unsafe fn displayNameForKey_value( + &self, + key: &NSLocaleKey, + value: &Object, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithLocaleIdentifier:)] + pub unsafe fn initWithLocaleIdentifier( + this: Option>, + string: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_methods!( + /// NSExtendedLocale + unsafe impl NSLocale { + #[method_id(@__retain_semantics Other localeIdentifier)] + pub unsafe fn localeIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Other localizedStringForLocaleIdentifier:)] + pub unsafe fn localizedStringForLocaleIdentifier( + &self, + localeIdentifier: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other languageCode)] + pub unsafe fn languageCode(&self) -> Id; + + #[method_id(@__retain_semantics Other localizedStringForLanguageCode:)] + pub unsafe fn localizedStringForLanguageCode( + &self, + languageCode: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other countryCode)] + pub unsafe fn countryCode(&self) -> Option>; + + #[method_id(@__retain_semantics Other localizedStringForCountryCode:)] + pub unsafe fn localizedStringForCountryCode( + &self, + countryCode: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other scriptCode)] + pub unsafe fn scriptCode(&self) -> Option>; + + #[method_id(@__retain_semantics Other localizedStringForScriptCode:)] + pub unsafe fn localizedStringForScriptCode( + &self, + scriptCode: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other variantCode)] + pub unsafe fn variantCode(&self) -> Option>; + + #[method_id(@__retain_semantics Other localizedStringForVariantCode:)] + pub unsafe fn localizedStringForVariantCode( + &self, + variantCode: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other exemplarCharacterSet)] + pub unsafe fn exemplarCharacterSet(&self) -> Id; + + #[method_id(@__retain_semantics Other calendarIdentifier)] + pub unsafe fn calendarIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Other localizedStringForCalendarIdentifier:)] + pub unsafe fn localizedStringForCalendarIdentifier( + &self, + calendarIdentifier: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other collationIdentifier)] + pub unsafe fn collationIdentifier(&self) -> Option>; + + #[method_id(@__retain_semantics Other localizedStringForCollationIdentifier:)] + pub unsafe fn localizedStringForCollationIdentifier( + &self, + collationIdentifier: &NSString, + ) -> Option>; + + #[method(usesMetricSystem)] + pub unsafe fn usesMetricSystem(&self) -> bool; + + #[method_id(@__retain_semantics Other decimalSeparator)] + pub unsafe fn decimalSeparator(&self) -> Id; + + #[method_id(@__retain_semantics Other groupingSeparator)] + pub unsafe fn groupingSeparator(&self) -> Id; + + #[method_id(@__retain_semantics Other currencySymbol)] + pub unsafe fn currencySymbol(&self) -> Id; + + #[method_id(@__retain_semantics Other currencyCode)] + pub unsafe fn currencyCode(&self) -> Option>; + + #[method_id(@__retain_semantics Other localizedStringForCurrencyCode:)] + pub unsafe fn localizedStringForCurrencyCode( + &self, + currencyCode: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other collatorIdentifier)] + pub unsafe fn collatorIdentifier(&self) -> Id; + + #[method_id(@__retain_semantics Other localizedStringForCollatorIdentifier:)] + pub unsafe fn localizedStringForCollatorIdentifier( + &self, + collatorIdentifier: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other quotationBeginDelimiter)] + pub unsafe fn quotationBeginDelimiter(&self) -> Id; + + #[method_id(@__retain_semantics Other quotationEndDelimiter)] + pub unsafe fn quotationEndDelimiter(&self) -> Id; + + #[method_id(@__retain_semantics Other alternateQuotationBeginDelimiter)] + pub unsafe fn alternateQuotationBeginDelimiter(&self) -> Id; + + #[method_id(@__retain_semantics Other alternateQuotationEndDelimiter)] + pub unsafe fn alternateQuotationEndDelimiter(&self) -> Id; + } +); + +extern_methods!( + /// NSLocaleCreation + unsafe impl NSLocale { + #[method_id(@__retain_semantics Other autoupdatingCurrentLocale)] + pub unsafe fn autoupdatingCurrentLocale() -> Id; + + #[method_id(@__retain_semantics Other currentLocale)] + pub unsafe fn currentLocale() -> Id; + + #[method_id(@__retain_semantics Other systemLocale)] + pub unsafe fn systemLocale() -> Id; + + #[method_id(@__retain_semantics Other localeWithLocaleIdentifier:)] + pub unsafe fn localeWithLocaleIdentifier(ident: &NSString) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSLocaleLanguageDirection { + NSLocaleLanguageDirectionUnknown = 0, + NSLocaleLanguageDirectionLeftToRight = 1, + NSLocaleLanguageDirectionRightToLeft = 2, + NSLocaleLanguageDirectionTopToBottom = 3, + NSLocaleLanguageDirectionBottomToTop = 4, + } +); + +extern_methods!( + /// NSLocaleGeneralInfo + unsafe impl NSLocale { + #[method_id(@__retain_semantics Other availableLocaleIdentifiers)] + pub unsafe fn availableLocaleIdentifiers() -> Id, Shared>; + + #[method_id(@__retain_semantics Other ISOLanguageCodes)] + pub unsafe fn ISOLanguageCodes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other ISOCountryCodes)] + pub unsafe fn ISOCountryCodes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other ISOCurrencyCodes)] + pub unsafe fn ISOCurrencyCodes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other commonISOCurrencyCodes)] + pub unsafe fn commonISOCurrencyCodes() -> Id, Shared>; + + #[method_id(@__retain_semantics Other preferredLanguages)] + pub unsafe fn preferredLanguages() -> Id, Shared>; + + #[method_id(@__retain_semantics Other componentsFromLocaleIdentifier:)] + pub unsafe fn componentsFromLocaleIdentifier( + string: &NSString, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other localeIdentifierFromComponents:)] + pub unsafe fn localeIdentifierFromComponents( + dict: &NSDictionary, + ) -> Id; + + #[method_id(@__retain_semantics Other canonicalLocaleIdentifierFromString:)] + pub unsafe fn canonicalLocaleIdentifierFromString( + string: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other canonicalLanguageIdentifierFromString:)] + pub unsafe fn canonicalLanguageIdentifierFromString( + string: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other localeIdentifierFromWindowsLocaleCode:)] + pub unsafe fn localeIdentifierFromWindowsLocaleCode( + lcid: u32, + ) -> Option>; + + #[method(windowsLocaleCodeFromLocaleIdentifier:)] + pub unsafe fn windowsLocaleCodeFromLocaleIdentifier(localeIdentifier: &NSString) -> u32; + + #[method(characterDirectionForLanguage:)] + pub unsafe fn characterDirectionForLanguage( + isoLangCode: &NSString, + ) -> NSLocaleLanguageDirection; + + #[method(lineDirectionForLanguage:)] + pub unsafe fn lineDirectionForLanguage(isoLangCode: &NSString) + -> NSLocaleLanguageDirection; + } +); + +extern_static!(NSCurrentLocaleDidChangeNotification: &'static NSNotificationName); + +extern_static!(NSLocaleIdentifier: &'static NSLocaleKey); + +extern_static!(NSLocaleLanguageCode: &'static NSLocaleKey); + +extern_static!(NSLocaleCountryCode: &'static NSLocaleKey); + +extern_static!(NSLocaleScriptCode: &'static NSLocaleKey); + +extern_static!(NSLocaleVariantCode: &'static NSLocaleKey); + +extern_static!(NSLocaleExemplarCharacterSet: &'static NSLocaleKey); + +extern_static!(NSLocaleCalendar: &'static NSLocaleKey); + +extern_static!(NSLocaleCollationIdentifier: &'static NSLocaleKey); + +extern_static!(NSLocaleUsesMetricSystem: &'static NSLocaleKey); + +extern_static!(NSLocaleMeasurementSystem: &'static NSLocaleKey); + +extern_static!(NSLocaleDecimalSeparator: &'static NSLocaleKey); + +extern_static!(NSLocaleGroupingSeparator: &'static NSLocaleKey); + +extern_static!(NSLocaleCurrencySymbol: &'static NSLocaleKey); + +extern_static!(NSLocaleCurrencyCode: &'static NSLocaleKey); + +extern_static!(NSLocaleCollatorIdentifier: &'static NSLocaleKey); + +extern_static!(NSLocaleQuotationBeginDelimiterKey: &'static NSLocaleKey); + +extern_static!(NSLocaleQuotationEndDelimiterKey: &'static NSLocaleKey); + +extern_static!(NSLocaleAlternateQuotationBeginDelimiterKey: &'static NSLocaleKey); + +extern_static!(NSLocaleAlternateQuotationEndDelimiterKey: &'static NSLocaleKey); + +extern_static!(NSGregorianCalendar: &'static NSString); + +extern_static!(NSBuddhistCalendar: &'static NSString); + +extern_static!(NSChineseCalendar: &'static NSString); + +extern_static!(NSHebrewCalendar: &'static NSString); + +extern_static!(NSIslamicCalendar: &'static NSString); + +extern_static!(NSIslamicCivilCalendar: &'static NSString); + +extern_static!(NSJapaneseCalendar: &'static NSString); + +extern_static!(NSRepublicOfChinaCalendar: &'static NSString); + +extern_static!(NSPersianCalendar: &'static NSString); + +extern_static!(NSIndianCalendar: &'static NSString); + +extern_static!(NSISO8601Calendar: &'static NSString); diff --git a/crates/icrate/src/generated/Foundation/NSLock.rs b/crates/icrate/src/generated/Foundation/NSLock.rs new file mode 100644 index 000000000..53644be43 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSLock.rs @@ -0,0 +1,147 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSLocking; + + unsafe impl NSLocking { + #[method(lock)] + pub unsafe fn lock(&self); + + #[method(unlock)] + pub unsafe fn unlock(&self); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSLock; + + unsafe impl ClassType for NSLock { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSLock { + #[method(tryLock)] + pub unsafe fn tryLock(&self) -> bool; + + #[method(lockBeforeDate:)] + pub unsafe fn lockBeforeDate(&self, limit: &NSDate) -> bool; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSConditionLock; + + unsafe impl ClassType for NSConditionLock { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSConditionLock { + #[method_id(@__retain_semantics Init initWithCondition:)] + pub unsafe fn initWithCondition( + this: Option>, + condition: NSInteger, + ) -> Id; + + #[method(condition)] + pub unsafe fn condition(&self) -> NSInteger; + + #[method(lockWhenCondition:)] + pub unsafe fn lockWhenCondition(&self, condition: NSInteger); + + #[method(tryLock)] + pub unsafe fn tryLock(&self) -> bool; + + #[method(tryLockWhenCondition:)] + pub unsafe fn tryLockWhenCondition(&self, condition: NSInteger) -> bool; + + #[method(unlockWithCondition:)] + pub unsafe fn unlockWithCondition(&self, condition: NSInteger); + + #[method(lockBeforeDate:)] + pub unsafe fn lockBeforeDate(&self, limit: &NSDate) -> bool; + + #[method(lockWhenCondition:beforeDate:)] + pub unsafe fn lockWhenCondition_beforeDate( + &self, + condition: NSInteger, + limit: &NSDate, + ) -> bool; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSRecursiveLock; + + unsafe impl ClassType for NSRecursiveLock { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSRecursiveLock { + #[method(tryLock)] + pub unsafe fn tryLock(&self) -> bool; + + #[method(lockBeforeDate:)] + pub unsafe fn lockBeforeDate(&self, limit: &NSDate) -> bool; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCondition; + + unsafe impl ClassType for NSCondition { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCondition { + #[method(wait)] + pub unsafe fn wait(&self); + + #[method(waitUntilDate:)] + pub unsafe fn waitUntilDate(&self, limit: &NSDate) -> bool; + + #[method(signal)] + pub unsafe fn signal(&self); + + #[method(broadcast)] + pub unsafe fn broadcast(&self); + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSMapTable.rs b/crates/icrate/src/generated/Foundation/NSMapTable.rs new file mode 100644 index 000000000..a8c502857 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSMapTable.rs @@ -0,0 +1,278 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSMapTableStrongMemory: NSPointerFunctionsOptions = NSPointerFunctionsStrongMemory); + +extern_static!( + NSMapTableZeroingWeakMemory: NSPointerFunctionsOptions = NSPointerFunctionsZeroingWeakMemory +); + +extern_static!(NSMapTableCopyIn: NSPointerFunctionsOptions = NSPointerFunctionsCopyIn); + +extern_static!( + NSMapTableObjectPointerPersonality: NSPointerFunctionsOptions = + NSPointerFunctionsObjectPointerPersonality +); + +extern_static!(NSMapTableWeakMemory: NSPointerFunctionsOptions = NSPointerFunctionsWeakMemory); + +pub type NSMapTableOptions = NSUInteger; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSMapTable { + _inner0: PhantomData<*mut KeyType>, + _inner1: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSMapTable { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMapTable { + #[method_id(@__retain_semantics Init initWithKeyOptions:valueOptions:capacity:)] + pub unsafe fn initWithKeyOptions_valueOptions_capacity( + this: Option>, + keyOptions: NSPointerFunctionsOptions, + valueOptions: NSPointerFunctionsOptions, + initialCapacity: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithKeyPointerFunctions:valuePointerFunctions:capacity:)] + pub unsafe fn initWithKeyPointerFunctions_valuePointerFunctions_capacity( + this: Option>, + keyFunctions: &NSPointerFunctions, + valueFunctions: &NSPointerFunctions, + initialCapacity: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other mapTableWithKeyOptions:valueOptions:)] + pub unsafe fn mapTableWithKeyOptions_valueOptions( + keyOptions: NSPointerFunctionsOptions, + valueOptions: NSPointerFunctionsOptions, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other mapTableWithStrongToStrongObjects)] + pub unsafe fn mapTableWithStrongToStrongObjects() -> Id; + + #[method_id(@__retain_semantics Other mapTableWithWeakToStrongObjects)] + pub unsafe fn mapTableWithWeakToStrongObjects() -> Id; + + #[method_id(@__retain_semantics Other mapTableWithStrongToWeakObjects)] + pub unsafe fn mapTableWithStrongToWeakObjects() -> Id; + + #[method_id(@__retain_semantics Other mapTableWithWeakToWeakObjects)] + pub unsafe fn mapTableWithWeakToWeakObjects() -> Id; + + #[method_id(@__retain_semantics Other strongToStrongObjectsMapTable)] + pub unsafe fn strongToStrongObjectsMapTable() -> Id, Shared>; + + #[method_id(@__retain_semantics Other weakToStrongObjectsMapTable)] + pub unsafe fn weakToStrongObjectsMapTable() -> Id, Shared>; + + #[method_id(@__retain_semantics Other strongToWeakObjectsMapTable)] + pub unsafe fn strongToWeakObjectsMapTable() -> Id, Shared>; + + #[method_id(@__retain_semantics Other weakToWeakObjectsMapTable)] + pub unsafe fn weakToWeakObjectsMapTable() -> Id, Shared>; + + #[method_id(@__retain_semantics Other keyPointerFunctions)] + pub unsafe fn keyPointerFunctions(&self) -> Id; + + #[method_id(@__retain_semantics Other valuePointerFunctions)] + pub unsafe fn valuePointerFunctions(&self) -> Id; + + #[method_id(@__retain_semantics Other objectForKey:)] + pub unsafe fn objectForKey(&self, aKey: Option<&KeyType>) + -> Option>; + + #[method(removeObjectForKey:)] + pub unsafe fn removeObjectForKey(&self, aKey: Option<&KeyType>); + + #[method(setObject:forKey:)] + pub unsafe fn setObject_forKey( + &self, + anObject: Option<&ObjectType>, + aKey: Option<&KeyType>, + ); + + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other keyEnumerator)] + pub unsafe fn keyEnumerator(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Option, Shared>>; + + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + + #[method_id(@__retain_semantics Other dictionaryRepresentation)] + pub unsafe fn dictionaryRepresentation( + &self, + ) -> Id, Shared>; + } +); + +extern_struct!( + pub struct NSMapEnumerator { + _pi: NSUInteger, + _si: NSUInteger, + _bs: *mut c_void, + } +); + +extern_fn!( + pub unsafe fn NSFreeMapTable(table: &NSMapTable); +); + +extern_fn!( + pub unsafe fn NSResetMapTable(table: &NSMapTable); +); + +extern_fn!( + pub unsafe fn NSCompareMapTables(table1: &NSMapTable, table2: &NSMapTable) -> Bool; +); + +extern_fn!( + pub unsafe fn NSCopyMapTableWithZone( + table: &NSMapTable, + zone: *mut NSZone, + ) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSMapMember( + table: &NSMapTable, + key: NonNull, + originalKey: *mut *mut c_void, + value: *mut *mut c_void, + ) -> Bool; +); + +extern_fn!( + pub unsafe fn NSMapGet(table: &NSMapTable, key: *mut c_void) -> *mut c_void; +); + +extern_fn!( + pub unsafe fn NSMapInsert(table: &NSMapTable, key: *mut c_void, value: *mut c_void); +); + +extern_fn!( + pub unsafe fn NSMapInsertKnownAbsent(table: &NSMapTable, key: *mut c_void, value: *mut c_void); +); + +extern_fn!( + pub unsafe fn NSMapInsertIfAbsent( + table: &NSMapTable, + key: *mut c_void, + value: *mut c_void, + ) -> *mut c_void; +); + +extern_fn!( + pub unsafe fn NSMapRemove(table: &NSMapTable, key: *mut c_void); +); + +extern_fn!( + pub unsafe fn NSEnumerateMapTable(table: &NSMapTable) -> NSMapEnumerator; +); + +extern_fn!( + pub unsafe fn NSNextMapEnumeratorPair( + enumerator: NonNull, + key: *mut *mut c_void, + value: *mut *mut c_void, + ) -> Bool; +); + +extern_fn!( + pub unsafe fn NSEndMapTableEnumeration(enumerator: NonNull); +); + +extern_fn!( + pub unsafe fn NSCountMapTable(table: &NSMapTable) -> NSUInteger; +); + +extern_fn!( + pub unsafe fn NSStringFromMapTable(table: &NSMapTable) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSAllMapTableKeys(table: &NSMapTable) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSAllMapTableValues(table: &NSMapTable) -> NonNull; +); + +extern_struct!( + pub struct NSMapTableKeyCallBacks { + pub hash: Option, NonNull) -> NSUInteger>, + pub isEqual: Option< + unsafe extern "C" fn(NonNull, NonNull, NonNull) -> Bool, + >, + pub retain: Option, NonNull)>, + pub release: Option, NonNull)>, + pub describe: + Option, NonNull) -> *mut NSString>, + pub notAKeyMarker: *mut c_void, + } +); + +extern_struct!( + pub struct NSMapTableValueCallBacks { + pub retain: Option, NonNull)>, + pub release: Option, NonNull)>, + pub describe: + Option, NonNull) -> *mut NSString>, + } +); + +extern_fn!( + pub unsafe fn NSCreateMapTableWithZone( + keyCallBacks: NSMapTableKeyCallBacks, + valueCallBacks: NSMapTableValueCallBacks, + capacity: NSUInteger, + zone: *mut NSZone, + ) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSCreateMapTable( + keyCallBacks: NSMapTableKeyCallBacks, + valueCallBacks: NSMapTableValueCallBacks, + capacity: NSUInteger, + ) -> NonNull; +); + +extern_static!(NSIntegerMapKeyCallBacks: NSMapTableKeyCallBacks); + +extern_static!(NSNonOwnedPointerMapKeyCallBacks: NSMapTableKeyCallBacks); + +extern_static!(NSNonOwnedPointerOrNullMapKeyCallBacks: NSMapTableKeyCallBacks); + +extern_static!(NSNonRetainedObjectMapKeyCallBacks: NSMapTableKeyCallBacks); + +extern_static!(NSObjectMapKeyCallBacks: NSMapTableKeyCallBacks); + +extern_static!(NSOwnedPointerMapKeyCallBacks: NSMapTableKeyCallBacks); + +extern_static!(NSIntMapKeyCallBacks: NSMapTableKeyCallBacks); + +extern_static!(NSIntegerMapValueCallBacks: NSMapTableValueCallBacks); + +extern_static!(NSNonOwnedPointerMapValueCallBacks: NSMapTableValueCallBacks); + +extern_static!(NSObjectMapValueCallBacks: NSMapTableValueCallBacks); + +extern_static!(NSNonRetainedObjectMapValueCallBacks: NSMapTableValueCallBacks); + +extern_static!(NSOwnedPointerMapValueCallBacks: NSMapTableValueCallBacks); + +extern_static!(NSIntMapValueCallBacks: NSMapTableValueCallBacks); diff --git a/crates/icrate/src/generated/Foundation/NSMassFormatter.rs b/crates/icrate/src/generated/Foundation/NSMassFormatter.rs new file mode 100644 index 000000000..cfee0b847 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSMassFormatter.rs @@ -0,0 +1,81 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSMassFormatterUnit { + NSMassFormatterUnitGram = 11, + NSMassFormatterUnitKilogram = 14, + NSMassFormatterUnitOunce = (6 << 8) + 1, + NSMassFormatterUnitPound = (6 << 8) + 2, + NSMassFormatterUnitStone = (6 << 8) + 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMassFormatter; + + unsafe impl ClassType for NSMassFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSMassFormatter { + #[method_id(@__retain_semantics Other numberFormatter)] + pub unsafe fn numberFormatter(&self) -> Id; + + #[method(setNumberFormatter:)] + pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>); + + #[method(unitStyle)] + pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle; + + #[method(setUnitStyle:)] + pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle); + + #[method(isForPersonMassUse)] + pub unsafe fn isForPersonMassUse(&self) -> bool; + + #[method(setForPersonMassUse:)] + pub unsafe fn setForPersonMassUse(&self, forPersonMassUse: bool); + + #[method_id(@__retain_semantics Other stringFromValue:unit:)] + pub unsafe fn stringFromValue_unit( + &self, + value: c_double, + unit: NSMassFormatterUnit, + ) -> Id; + + #[method_id(@__retain_semantics Other stringFromKilograms:)] + pub unsafe fn stringFromKilograms( + &self, + numberInKilograms: c_double, + ) -> Id; + + #[method_id(@__retain_semantics Other unitStringFromValue:unit:)] + pub unsafe fn unitStringFromValue_unit( + &self, + value: c_double, + unit: NSMassFormatterUnit, + ) -> Id; + + #[method_id(@__retain_semantics Other unitStringFromKilograms:usedUnit:)] + pub unsafe fn unitStringFromKilograms_usedUnit( + &self, + numberInKilograms: c_double, + unitp: *mut NSMassFormatterUnit, + ) -> Id; + + #[method(getObjectValue:forString:errorDescription:)] + pub unsafe fn getObjectValue_forString_errorDescription( + &self, + obj: *mut *mut Object, + string: &NSString, + error: *mut *mut NSString, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSMeasurement.rs b/crates/icrate/src/generated/Foundation/NSMeasurement.rs new file mode 100644 index 000000000..d7e38bf16 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSMeasurement.rs @@ -0,0 +1,56 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSMeasurement { + _inner0: PhantomData<*mut UnitType>, + } + + unsafe impl ClassType for NSMeasurement { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMeasurement { + #[method_id(@__retain_semantics Other unit)] + pub unsafe fn unit(&self) -> Id; + + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithDoubleValue:unit:)] + pub unsafe fn initWithDoubleValue_unit( + this: Option>, + doubleValue: c_double, + unit: &UnitType, + ) -> Id; + + #[method(canBeConvertedToUnit:)] + pub unsafe fn canBeConvertedToUnit(&self, unit: &NSUnit) -> bool; + + #[method_id(@__retain_semantics Other measurementByConvertingToUnit:)] + pub unsafe fn measurementByConvertingToUnit( + &self, + unit: &NSUnit, + ) -> Id; + + #[method_id(@__retain_semantics Other measurementByAddingMeasurement:)] + pub unsafe fn measurementByAddingMeasurement( + &self, + measurement: &NSMeasurement, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other measurementBySubtractingMeasurement:)] + pub unsafe fn measurementBySubtractingMeasurement( + &self, + measurement: &NSMeasurement, + ) -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSMeasurementFormatter.rs b/crates/icrate/src/generated/Foundation/NSMeasurementFormatter.rs new file mode 100644 index 000000000..e7c4eeb2e --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSMeasurementFormatter.rs @@ -0,0 +1,59 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSMeasurementFormatterUnitOptions { + NSMeasurementFormatterUnitOptionsProvidedUnit = 1 << 0, + NSMeasurementFormatterUnitOptionsNaturalScale = 1 << 1, + NSMeasurementFormatterUnitOptionsTemperatureWithoutUnit = 1 << 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMeasurementFormatter; + + unsafe impl ClassType for NSMeasurementFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSMeasurementFormatter { + #[method(unitOptions)] + pub unsafe fn unitOptions(&self) -> NSMeasurementFormatterUnitOptions; + + #[method(setUnitOptions:)] + pub unsafe fn setUnitOptions(&self, unitOptions: NSMeasurementFormatterUnitOptions); + + #[method(unitStyle)] + pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle; + + #[method(setUnitStyle:)] + pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle); + + #[method_id(@__retain_semantics Other locale)] + pub unsafe fn locale(&self) -> Id; + + #[method(setLocale:)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + + #[method_id(@__retain_semantics Other numberFormatter)] + pub unsafe fn numberFormatter(&self) -> Id; + + #[method(setNumberFormatter:)] + pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>); + + #[method_id(@__retain_semantics Other stringFromMeasurement:)] + pub unsafe fn stringFromMeasurement( + &self, + measurement: &NSMeasurement, + ) -> Id; + + #[method_id(@__retain_semantics Other stringFromUnit:)] + pub unsafe fn stringFromUnit(&self, unit: &NSUnit) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSMetadata.rs b/crates/icrate/src/generated/Foundation/NSMetadata.rs new file mode 100644 index 000000000..358d1022c --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSMetadata.rs @@ -0,0 +1,274 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSMetadataQuery; + + unsafe impl ClassType for NSMetadataQuery { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMetadataQuery { + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSMetadataQueryDelegate>); + + #[method_id(@__retain_semantics Other predicate)] + pub unsafe fn predicate(&self) -> Option>; + + #[method(setPredicate:)] + pub unsafe fn setPredicate(&self, predicate: Option<&NSPredicate>); + + #[method_id(@__retain_semantics Other sortDescriptors)] + pub unsafe fn sortDescriptors(&self) -> Id, Shared>; + + #[method(setSortDescriptors:)] + pub unsafe fn setSortDescriptors(&self, sortDescriptors: &NSArray); + + #[method_id(@__retain_semantics Other valueListAttributes)] + pub unsafe fn valueListAttributes(&self) -> Id, Shared>; + + #[method(setValueListAttributes:)] + pub unsafe fn setValueListAttributes(&self, valueListAttributes: &NSArray); + + #[method_id(@__retain_semantics Other groupingAttributes)] + pub unsafe fn groupingAttributes(&self) -> Option, Shared>>; + + #[method(setGroupingAttributes:)] + pub unsafe fn setGroupingAttributes(&self, groupingAttributes: Option<&NSArray>); + + #[method(notificationBatchingInterval)] + pub unsafe fn notificationBatchingInterval(&self) -> NSTimeInterval; + + #[method(setNotificationBatchingInterval:)] + pub unsafe fn setNotificationBatchingInterval( + &self, + notificationBatchingInterval: NSTimeInterval, + ); + + #[method_id(@__retain_semantics Other searchScopes)] + pub unsafe fn searchScopes(&self) -> Id; + + #[method(setSearchScopes:)] + pub unsafe fn setSearchScopes(&self, searchScopes: &NSArray); + + #[method_id(@__retain_semantics Other searchItems)] + pub unsafe fn searchItems(&self) -> Option>; + + #[method(setSearchItems:)] + pub unsafe fn setSearchItems(&self, searchItems: Option<&NSArray>); + + #[method_id(@__retain_semantics Other operationQueue)] + pub unsafe fn operationQueue(&self) -> Option>; + + #[method(setOperationQueue:)] + pub unsafe fn setOperationQueue(&self, operationQueue: Option<&NSOperationQueue>); + + #[method(startQuery)] + pub unsafe fn startQuery(&self) -> bool; + + #[method(stopQuery)] + pub unsafe fn stopQuery(&self); + + #[method(isStarted)] + pub unsafe fn isStarted(&self) -> bool; + + #[method(isGathering)] + pub unsafe fn isGathering(&self) -> bool; + + #[method(isStopped)] + pub unsafe fn isStopped(&self) -> bool; + + #[method(disableUpdates)] + pub unsafe fn disableUpdates(&self); + + #[method(enableUpdates)] + pub unsafe fn enableUpdates(&self); + + #[method(resultCount)] + pub unsafe fn resultCount(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other resultAtIndex:)] + pub unsafe fn resultAtIndex(&self, idx: NSUInteger) -> Id; + + #[method(enumerateResultsUsingBlock:)] + pub unsafe fn enumerateResultsUsingBlock( + &self, + block: &Block<(NonNull, NSUInteger, NonNull), ()>, + ); + + #[method(enumerateResultsWithOptions:usingBlock:)] + pub unsafe fn enumerateResultsWithOptions_usingBlock( + &self, + opts: NSEnumerationOptions, + block: &Block<(NonNull, NSUInteger, NonNull), ()>, + ); + + #[method_id(@__retain_semantics Other results)] + pub unsafe fn results(&self) -> Id; + + #[method(indexOfResult:)] + pub unsafe fn indexOfResult(&self, result: &Object) -> NSUInteger; + + #[method_id(@__retain_semantics Other valueLists)] + pub unsafe fn valueLists( + &self, + ) -> Id>, Shared>; + + #[method_id(@__retain_semantics Other groupedResults)] + pub unsafe fn groupedResults(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other valueOfAttribute:forResultAtIndex:)] + pub unsafe fn valueOfAttribute_forResultAtIndex( + &self, + attrName: &NSString, + idx: NSUInteger, + ) -> Option>; + } +); + +extern_protocol!( + pub struct NSMetadataQueryDelegate; + + unsafe impl NSMetadataQueryDelegate { + #[optional] + #[method_id(@__retain_semantics Other metadataQuery:replacementObjectForResultObject:)] + pub unsafe fn metadataQuery_replacementObjectForResultObject( + &self, + query: &NSMetadataQuery, + result: &NSMetadataItem, + ) -> Id; + + #[optional] + #[method_id(@__retain_semantics Other metadataQuery:replacementValueForAttribute:value:)] + pub unsafe fn metadataQuery_replacementValueForAttribute_value( + &self, + query: &NSMetadataQuery, + attrName: &NSString, + attrValue: &Object, + ) -> Id; + } +); + +extern_static!(NSMetadataQueryDidStartGatheringNotification: &'static NSNotificationName); + +extern_static!(NSMetadataQueryGatheringProgressNotification: &'static NSNotificationName); + +extern_static!(NSMetadataQueryDidFinishGatheringNotification: &'static NSNotificationName); + +extern_static!(NSMetadataQueryDidUpdateNotification: &'static NSNotificationName); + +extern_static!(NSMetadataQueryUpdateAddedItemsKey: &'static NSString); + +extern_static!(NSMetadataQueryUpdateChangedItemsKey: &'static NSString); + +extern_static!(NSMetadataQueryUpdateRemovedItemsKey: &'static NSString); + +extern_static!(NSMetadataQueryResultContentRelevanceAttribute: &'static NSString); + +extern_static!(NSMetadataQueryUserHomeScope: &'static NSString); + +extern_static!(NSMetadataQueryLocalComputerScope: &'static NSString); + +extern_static!(NSMetadataQueryNetworkScope: &'static NSString); + +extern_static!(NSMetadataQueryIndexedLocalComputerScope: &'static NSString); + +extern_static!(NSMetadataQueryIndexedNetworkScope: &'static NSString); + +extern_static!(NSMetadataQueryUbiquitousDocumentsScope: &'static NSString); + +extern_static!(NSMetadataQueryUbiquitousDataScope: &'static NSString); + +extern_static!(NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSMetadataItem; + + unsafe impl ClassType for NSMetadataItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMetadataItem { + #[method_id(@__retain_semantics Init initWithURL:)] + pub unsafe fn initWithURL( + this: Option>, + url: &NSURL, + ) -> Option>; + + #[method_id(@__retain_semantics Other valueForAttribute:)] + pub unsafe fn valueForAttribute(&self, key: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other valuesForAttributes:)] + pub unsafe fn valuesForAttributes( + &self, + keys: &NSArray, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other attributes)] + pub unsafe fn attributes(&self) -> Id, Shared>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMetadataQueryAttributeValueTuple; + + unsafe impl ClassType for NSMetadataQueryAttributeValueTuple { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMetadataQueryAttributeValueTuple { + #[method_id(@__retain_semantics Other attribute)] + pub unsafe fn attribute(&self) -> Id; + + #[method_id(@__retain_semantics Other value)] + pub unsafe fn value(&self) -> Option>; + + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMetadataQueryResultGroup; + + unsafe impl ClassType for NSMetadataQueryResultGroup { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMetadataQueryResultGroup { + #[method_id(@__retain_semantics Other attribute)] + pub unsafe fn attribute(&self) -> Id; + + #[method_id(@__retain_semantics Other value)] + pub unsafe fn value(&self) -> Id; + + #[method_id(@__retain_semantics Other subgroups)] + pub unsafe fn subgroups(&self) -> Option, Shared>>; + + #[method(resultCount)] + pub unsafe fn resultCount(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other resultAtIndex:)] + pub unsafe fn resultAtIndex(&self, idx: NSUInteger) -> Id; + + #[method_id(@__retain_semantics Other results)] + pub unsafe fn results(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSMetadataAttributes.rs b/crates/icrate/src/generated/Foundation/NSMetadataAttributes.rs new file mode 100644 index 000000000..cc1a2c95e --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSMetadataAttributes.rs @@ -0,0 +1,366 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSMetadataItemFSNameKey: &'static NSString); + +extern_static!(NSMetadataItemDisplayNameKey: &'static NSString); + +extern_static!(NSMetadataItemURLKey: &'static NSString); + +extern_static!(NSMetadataItemPathKey: &'static NSString); + +extern_static!(NSMetadataItemFSSizeKey: &'static NSString); + +extern_static!(NSMetadataItemFSCreationDateKey: &'static NSString); + +extern_static!(NSMetadataItemFSContentChangeDateKey: &'static NSString); + +extern_static!(NSMetadataItemContentTypeKey: &'static NSString); + +extern_static!(NSMetadataItemContentTypeTreeKey: &'static NSString); + +extern_static!(NSMetadataItemIsUbiquitousKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemHasUnresolvedConflictsKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemIsDownloadedKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemDownloadingStatusKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemDownloadingStatusNotDownloaded: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemDownloadingStatusDownloaded: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemDownloadingStatusCurrent: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemIsDownloadingKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemIsUploadedKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemIsUploadingKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemPercentDownloadedKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemPercentUploadedKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemDownloadingErrorKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemUploadingErrorKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemDownloadRequestedKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemIsExternalDocumentKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemContainerDisplayNameKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemURLInLocalContainerKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousItemIsSharedKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousSharedItemCurrentUserRoleKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousSharedItemCurrentUserPermissionsKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousSharedItemOwnerNameComponentsKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousSharedItemMostRecentEditorNameComponentsKey: &'static NSString); + +extern_static!(NSMetadataUbiquitousSharedItemRoleOwner: &'static NSString); + +extern_static!(NSMetadataUbiquitousSharedItemRoleParticipant: &'static NSString); + +extern_static!(NSMetadataUbiquitousSharedItemPermissionsReadOnly: &'static NSString); + +extern_static!(NSMetadataUbiquitousSharedItemPermissionsReadWrite: &'static NSString); + +extern_static!(NSMetadataItemAttributeChangeDateKey: &'static NSString); + +extern_static!(NSMetadataItemKeywordsKey: &'static NSString); + +extern_static!(NSMetadataItemTitleKey: &'static NSString); + +extern_static!(NSMetadataItemAuthorsKey: &'static NSString); + +extern_static!(NSMetadataItemEditorsKey: &'static NSString); + +extern_static!(NSMetadataItemParticipantsKey: &'static NSString); + +extern_static!(NSMetadataItemProjectsKey: &'static NSString); + +extern_static!(NSMetadataItemDownloadedDateKey: &'static NSString); + +extern_static!(NSMetadataItemWhereFromsKey: &'static NSString); + +extern_static!(NSMetadataItemCommentKey: &'static NSString); + +extern_static!(NSMetadataItemCopyrightKey: &'static NSString); + +extern_static!(NSMetadataItemLastUsedDateKey: &'static NSString); + +extern_static!(NSMetadataItemContentCreationDateKey: &'static NSString); + +extern_static!(NSMetadataItemContentModificationDateKey: &'static NSString); + +extern_static!(NSMetadataItemDateAddedKey: &'static NSString); + +extern_static!(NSMetadataItemDurationSecondsKey: &'static NSString); + +extern_static!(NSMetadataItemContactKeywordsKey: &'static NSString); + +extern_static!(NSMetadataItemVersionKey: &'static NSString); + +extern_static!(NSMetadataItemPixelHeightKey: &'static NSString); + +extern_static!(NSMetadataItemPixelWidthKey: &'static NSString); + +extern_static!(NSMetadataItemPixelCountKey: &'static NSString); + +extern_static!(NSMetadataItemColorSpaceKey: &'static NSString); + +extern_static!(NSMetadataItemBitsPerSampleKey: &'static NSString); + +extern_static!(NSMetadataItemFlashOnOffKey: &'static NSString); + +extern_static!(NSMetadataItemFocalLengthKey: &'static NSString); + +extern_static!(NSMetadataItemAcquisitionMakeKey: &'static NSString); + +extern_static!(NSMetadataItemAcquisitionModelKey: &'static NSString); + +extern_static!(NSMetadataItemISOSpeedKey: &'static NSString); + +extern_static!(NSMetadataItemOrientationKey: &'static NSString); + +extern_static!(NSMetadataItemLayerNamesKey: &'static NSString); + +extern_static!(NSMetadataItemWhiteBalanceKey: &'static NSString); + +extern_static!(NSMetadataItemApertureKey: &'static NSString); + +extern_static!(NSMetadataItemProfileNameKey: &'static NSString); + +extern_static!(NSMetadataItemResolutionWidthDPIKey: &'static NSString); + +extern_static!(NSMetadataItemResolutionHeightDPIKey: &'static NSString); + +extern_static!(NSMetadataItemExposureModeKey: &'static NSString); + +extern_static!(NSMetadataItemExposureTimeSecondsKey: &'static NSString); + +extern_static!(NSMetadataItemEXIFVersionKey: &'static NSString); + +extern_static!(NSMetadataItemCameraOwnerKey: &'static NSString); + +extern_static!(NSMetadataItemFocalLength35mmKey: &'static NSString); + +extern_static!(NSMetadataItemLensModelKey: &'static NSString); + +extern_static!(NSMetadataItemEXIFGPSVersionKey: &'static NSString); + +extern_static!(NSMetadataItemAltitudeKey: &'static NSString); + +extern_static!(NSMetadataItemLatitudeKey: &'static NSString); + +extern_static!(NSMetadataItemLongitudeKey: &'static NSString); + +extern_static!(NSMetadataItemSpeedKey: &'static NSString); + +extern_static!(NSMetadataItemTimestampKey: &'static NSString); + +extern_static!(NSMetadataItemGPSTrackKey: &'static NSString); + +extern_static!(NSMetadataItemImageDirectionKey: &'static NSString); + +extern_static!(NSMetadataItemNamedLocationKey: &'static NSString); + +extern_static!(NSMetadataItemGPSStatusKey: &'static NSString); + +extern_static!(NSMetadataItemGPSMeasureModeKey: &'static NSString); + +extern_static!(NSMetadataItemGPSDOPKey: &'static NSString); + +extern_static!(NSMetadataItemGPSMapDatumKey: &'static NSString); + +extern_static!(NSMetadataItemGPSDestLatitudeKey: &'static NSString); + +extern_static!(NSMetadataItemGPSDestLongitudeKey: &'static NSString); + +extern_static!(NSMetadataItemGPSDestBearingKey: &'static NSString); + +extern_static!(NSMetadataItemGPSDestDistanceKey: &'static NSString); + +extern_static!(NSMetadataItemGPSProcessingMethodKey: &'static NSString); + +extern_static!(NSMetadataItemGPSAreaInformationKey: &'static NSString); + +extern_static!(NSMetadataItemGPSDateStampKey: &'static NSString); + +extern_static!(NSMetadataItemGPSDifferentalKey: &'static NSString); + +extern_static!(NSMetadataItemCodecsKey: &'static NSString); + +extern_static!(NSMetadataItemMediaTypesKey: &'static NSString); + +extern_static!(NSMetadataItemStreamableKey: &'static NSString); + +extern_static!(NSMetadataItemTotalBitRateKey: &'static NSString); + +extern_static!(NSMetadataItemVideoBitRateKey: &'static NSString); + +extern_static!(NSMetadataItemAudioBitRateKey: &'static NSString); + +extern_static!(NSMetadataItemDeliveryTypeKey: &'static NSString); + +extern_static!(NSMetadataItemAlbumKey: &'static NSString); + +extern_static!(NSMetadataItemHasAlphaChannelKey: &'static NSString); + +extern_static!(NSMetadataItemRedEyeOnOffKey: &'static NSString); + +extern_static!(NSMetadataItemMeteringModeKey: &'static NSString); + +extern_static!(NSMetadataItemMaxApertureKey: &'static NSString); + +extern_static!(NSMetadataItemFNumberKey: &'static NSString); + +extern_static!(NSMetadataItemExposureProgramKey: &'static NSString); + +extern_static!(NSMetadataItemExposureTimeStringKey: &'static NSString); + +extern_static!(NSMetadataItemHeadlineKey: &'static NSString); + +extern_static!(NSMetadataItemInstructionsKey: &'static NSString); + +extern_static!(NSMetadataItemCityKey: &'static NSString); + +extern_static!(NSMetadataItemStateOrProvinceKey: &'static NSString); + +extern_static!(NSMetadataItemCountryKey: &'static NSString); + +extern_static!(NSMetadataItemTextContentKey: &'static NSString); + +extern_static!(NSMetadataItemAudioSampleRateKey: &'static NSString); + +extern_static!(NSMetadataItemAudioChannelCountKey: &'static NSString); + +extern_static!(NSMetadataItemTempoKey: &'static NSString); + +extern_static!(NSMetadataItemKeySignatureKey: &'static NSString); + +extern_static!(NSMetadataItemTimeSignatureKey: &'static NSString); + +extern_static!(NSMetadataItemAudioEncodingApplicationKey: &'static NSString); + +extern_static!(NSMetadataItemComposerKey: &'static NSString); + +extern_static!(NSMetadataItemLyricistKey: &'static NSString); + +extern_static!(NSMetadataItemAudioTrackNumberKey: &'static NSString); + +extern_static!(NSMetadataItemRecordingDateKey: &'static NSString); + +extern_static!(NSMetadataItemMusicalGenreKey: &'static NSString); + +extern_static!(NSMetadataItemIsGeneralMIDISequenceKey: &'static NSString); + +extern_static!(NSMetadataItemRecordingYearKey: &'static NSString); + +extern_static!(NSMetadataItemOrganizationsKey: &'static NSString); + +extern_static!(NSMetadataItemLanguagesKey: &'static NSString); + +extern_static!(NSMetadataItemRightsKey: &'static NSString); + +extern_static!(NSMetadataItemPublishersKey: &'static NSString); + +extern_static!(NSMetadataItemContributorsKey: &'static NSString); + +extern_static!(NSMetadataItemCoverageKey: &'static NSString); + +extern_static!(NSMetadataItemSubjectKey: &'static NSString); + +extern_static!(NSMetadataItemThemeKey: &'static NSString); + +extern_static!(NSMetadataItemDescriptionKey: &'static NSString); + +extern_static!(NSMetadataItemIdentifierKey: &'static NSString); + +extern_static!(NSMetadataItemAudiencesKey: &'static NSString); + +extern_static!(NSMetadataItemNumberOfPagesKey: &'static NSString); + +extern_static!(NSMetadataItemPageWidthKey: &'static NSString); + +extern_static!(NSMetadataItemPageHeightKey: &'static NSString); + +extern_static!(NSMetadataItemSecurityMethodKey: &'static NSString); + +extern_static!(NSMetadataItemCreatorKey: &'static NSString); + +extern_static!(NSMetadataItemEncodingApplicationsKey: &'static NSString); + +extern_static!(NSMetadataItemDueDateKey: &'static NSString); + +extern_static!(NSMetadataItemStarRatingKey: &'static NSString); + +extern_static!(NSMetadataItemPhoneNumbersKey: &'static NSString); + +extern_static!(NSMetadataItemEmailAddressesKey: &'static NSString); + +extern_static!(NSMetadataItemInstantMessageAddressesKey: &'static NSString); + +extern_static!(NSMetadataItemKindKey: &'static NSString); + +extern_static!(NSMetadataItemRecipientsKey: &'static NSString); + +extern_static!(NSMetadataItemFinderCommentKey: &'static NSString); + +extern_static!(NSMetadataItemFontsKey: &'static NSString); + +extern_static!(NSMetadataItemAppleLoopsRootKeyKey: &'static NSString); + +extern_static!(NSMetadataItemAppleLoopsKeyFilterTypeKey: &'static NSString); + +extern_static!(NSMetadataItemAppleLoopsLoopModeKey: &'static NSString); + +extern_static!(NSMetadataItemAppleLoopDescriptorsKey: &'static NSString); + +extern_static!(NSMetadataItemMusicalInstrumentCategoryKey: &'static NSString); + +extern_static!(NSMetadataItemMusicalInstrumentNameKey: &'static NSString); + +extern_static!(NSMetadataItemCFBundleIdentifierKey: &'static NSString); + +extern_static!(NSMetadataItemInformationKey: &'static NSString); + +extern_static!(NSMetadataItemDirectorKey: &'static NSString); + +extern_static!(NSMetadataItemProducerKey: &'static NSString); + +extern_static!(NSMetadataItemGenreKey: &'static NSString); + +extern_static!(NSMetadataItemPerformersKey: &'static NSString); + +extern_static!(NSMetadataItemOriginalFormatKey: &'static NSString); + +extern_static!(NSMetadataItemOriginalSourceKey: &'static NSString); + +extern_static!(NSMetadataItemAuthorEmailAddressesKey: &'static NSString); + +extern_static!(NSMetadataItemRecipientEmailAddressesKey: &'static NSString); + +extern_static!(NSMetadataItemAuthorAddressesKey: &'static NSString); + +extern_static!(NSMetadataItemRecipientAddressesKey: &'static NSString); + +extern_static!(NSMetadataItemIsLikelyJunkKey: &'static NSString); + +extern_static!(NSMetadataItemExecutableArchitecturesKey: &'static NSString); + +extern_static!(NSMetadataItemExecutablePlatformKey: &'static NSString); + +extern_static!(NSMetadataItemApplicationCategoriesKey: &'static NSString); + +extern_static!(NSMetadataItemIsApplicationManagedKey: &'static NSString); diff --git a/crates/icrate/src/generated/Foundation/NSMethodSignature.rs b/crates/icrate/src/generated/Foundation/NSMethodSignature.rs new file mode 100644 index 000000000..921ab735c --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSMethodSignature.rs @@ -0,0 +1,40 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSMethodSignature; + + unsafe impl ClassType for NSMethodSignature { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMethodSignature { + #[method_id(@__retain_semantics Other signatureWithObjCTypes:)] + pub unsafe fn signatureWithObjCTypes( + types: NonNull, + ) -> Option>; + + #[method(numberOfArguments)] + pub unsafe fn numberOfArguments(&self) -> NSUInteger; + + #[method(getArgumentTypeAtIndex:)] + pub unsafe fn getArgumentTypeAtIndex(&self, idx: NSUInteger) -> NonNull; + + #[method(frameLength)] + pub unsafe fn frameLength(&self) -> NSUInteger; + + #[method(isOneway)] + pub unsafe fn isOneway(&self) -> bool; + + #[method(methodReturnType)] + pub unsafe fn methodReturnType(&self) -> NonNull; + + #[method(methodReturnLength)] + pub unsafe fn methodReturnLength(&self) -> NSUInteger; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSMorphology.rs b/crates/icrate/src/generated/Foundation/NSMorphology.rs new file mode 100644 index 000000000..e9b547e28 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSMorphology.rs @@ -0,0 +1,158 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSGrammaticalGender { + NSGrammaticalGenderNotSet = 0, + NSGrammaticalGenderFeminine = 1, + NSGrammaticalGenderMasculine = 2, + NSGrammaticalGenderNeuter = 3, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSGrammaticalPartOfSpeech { + NSGrammaticalPartOfSpeechNotSet = 0, + NSGrammaticalPartOfSpeechDeterminer = 1, + NSGrammaticalPartOfSpeechPronoun = 2, + NSGrammaticalPartOfSpeechLetter = 3, + NSGrammaticalPartOfSpeechAdverb = 4, + NSGrammaticalPartOfSpeechParticle = 5, + NSGrammaticalPartOfSpeechAdjective = 6, + NSGrammaticalPartOfSpeechAdposition = 7, + NSGrammaticalPartOfSpeechVerb = 8, + NSGrammaticalPartOfSpeechNoun = 9, + NSGrammaticalPartOfSpeechConjunction = 10, + NSGrammaticalPartOfSpeechNumeral = 11, + NSGrammaticalPartOfSpeechInterjection = 12, + NSGrammaticalPartOfSpeechPreposition = 13, + NSGrammaticalPartOfSpeechAbbreviation = 14, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSGrammaticalNumber { + NSGrammaticalNumberNotSet = 0, + NSGrammaticalNumberSingular = 1, + NSGrammaticalNumberZero = 2, + NSGrammaticalNumberPlural = 3, + NSGrammaticalNumberPluralTwo = 4, + NSGrammaticalNumberPluralFew = 5, + NSGrammaticalNumberPluralMany = 6, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMorphology; + + unsafe impl ClassType for NSMorphology { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMorphology { + #[method(grammaticalGender)] + pub unsafe fn grammaticalGender(&self) -> NSGrammaticalGender; + + #[method(setGrammaticalGender:)] + pub unsafe fn setGrammaticalGender(&self, grammaticalGender: NSGrammaticalGender); + + #[method(partOfSpeech)] + pub unsafe fn partOfSpeech(&self) -> NSGrammaticalPartOfSpeech; + + #[method(setPartOfSpeech:)] + pub unsafe fn setPartOfSpeech(&self, partOfSpeech: NSGrammaticalPartOfSpeech); + + #[method(number)] + pub unsafe fn number(&self) -> NSGrammaticalNumber; + + #[method(setNumber:)] + pub unsafe fn setNumber(&self, number: NSGrammaticalNumber); + } +); + +extern_methods!( + /// NSCustomPronouns + unsafe impl NSMorphology { + #[method_id(@__retain_semantics Other customPronounForLanguage:)] + pub unsafe fn customPronounForLanguage( + &self, + language: &NSString, + ) -> Option>; + + #[method(setCustomPronoun:forLanguage:error:)] + pub unsafe fn setCustomPronoun_forLanguage_error( + &self, + features: Option<&NSMorphologyCustomPronoun>, + language: &NSString, + ) -> Result<(), Id>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMorphologyCustomPronoun; + + unsafe impl ClassType for NSMorphologyCustomPronoun { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSMorphologyCustomPronoun { + #[method(isSupportedForLanguage:)] + pub unsafe fn isSupportedForLanguage(language: &NSString) -> bool; + + #[method_id(@__retain_semantics Other requiredKeysForLanguage:)] + pub unsafe fn requiredKeysForLanguage(language: &NSString) + -> Id, Shared>; + + #[method_id(@__retain_semantics Other subjectForm)] + pub unsafe fn subjectForm(&self) -> Option>; + + #[method(setSubjectForm:)] + pub unsafe fn setSubjectForm(&self, subjectForm: Option<&NSString>); + + #[method_id(@__retain_semantics Other objectForm)] + pub unsafe fn objectForm(&self) -> Option>; + + #[method(setObjectForm:)] + pub unsafe fn setObjectForm(&self, objectForm: Option<&NSString>); + + #[method_id(@__retain_semantics Other possessiveForm)] + pub unsafe fn possessiveForm(&self) -> Option>; + + #[method(setPossessiveForm:)] + pub unsafe fn setPossessiveForm(&self, possessiveForm: Option<&NSString>); + + #[method_id(@__retain_semantics Other possessiveAdjectiveForm)] + pub unsafe fn possessiveAdjectiveForm(&self) -> Option>; + + #[method(setPossessiveAdjectiveForm:)] + pub unsafe fn setPossessiveAdjectiveForm(&self, possessiveAdjectiveForm: Option<&NSString>); + + #[method_id(@__retain_semantics Other reflexiveForm)] + pub unsafe fn reflexiveForm(&self) -> Option>; + + #[method(setReflexiveForm:)] + pub unsafe fn setReflexiveForm(&self, reflexiveForm: Option<&NSString>); + } +); + +extern_methods!( + /// NSMorphologyUserSettings + unsafe impl NSMorphology { + #[method(isUnspecified)] + pub unsafe fn isUnspecified(&self) -> bool; + + #[method_id(@__retain_semantics Other userMorphology)] + pub unsafe fn userMorphology() -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSNetServices.rs b/crates/icrate/src/generated/Foundation/NSNetServices.rs new file mode 100644 index 000000000..73027c999 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSNetServices.rs @@ -0,0 +1,301 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSNetServicesErrorCode: &'static NSString); + +extern_static!(NSNetServicesErrorDomain: &'static NSErrorDomain); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSNetServicesError { + NSNetServicesUnknownError = -72000, + NSNetServicesCollisionError = -72001, + NSNetServicesNotFoundError = -72002, + NSNetServicesActivityInProgress = -72003, + NSNetServicesBadArgumentError = -72004, + NSNetServicesCancelledError = -72005, + NSNetServicesInvalidError = -72006, + NSNetServicesTimeoutError = -72007, + NSNetServicesMissingRequiredConfigurationError = -72008, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSNetServiceOptions { + NSNetServiceNoAutoRename = 1 << 0, + NSNetServiceListenForConnections = 1 << 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSNetService; + + unsafe impl ClassType for NSNetService { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSNetService { + #[method_id(@__retain_semantics Init initWithDomain:type:name:port:)] + pub unsafe fn initWithDomain_type_name_port( + this: Option>, + domain: &NSString, + type_: &NSString, + name: &NSString, + port: c_int, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithDomain:type:name:)] + pub unsafe fn initWithDomain_type_name( + this: Option>, + domain: &NSString, + type_: &NSString, + name: &NSString, + ) -> Id; + + #[method(scheduleInRunLoop:forMode:)] + pub unsafe fn scheduleInRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + + #[method(removeFromRunLoop:forMode:)] + pub unsafe fn removeFromRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSNetServiceDelegate>); + + #[method(includesPeerToPeer)] + pub unsafe fn includesPeerToPeer(&self) -> bool; + + #[method(setIncludesPeerToPeer:)] + pub unsafe fn setIncludesPeerToPeer(&self, includesPeerToPeer: bool); + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other type)] + pub unsafe fn type_(&self) -> Id; + + #[method_id(@__retain_semantics Other domain)] + pub unsafe fn domain(&self) -> Id; + + #[method_id(@__retain_semantics Other hostName)] + pub unsafe fn hostName(&self) -> Option>; + + #[method_id(@__retain_semantics Other addresses)] + pub unsafe fn addresses(&self) -> Option, Shared>>; + + #[method(port)] + pub unsafe fn port(&self) -> NSInteger; + + #[method(publish)] + pub unsafe fn publish(&self); + + #[method(publishWithOptions:)] + pub unsafe fn publishWithOptions(&self, options: NSNetServiceOptions); + + #[method(resolve)] + pub unsafe fn resolve(&self); + + #[method(stop)] + pub unsafe fn stop(&self); + + #[method_id(@__retain_semantics Other dictionaryFromTXTRecordData:)] + pub unsafe fn dictionaryFromTXTRecordData( + txtData: &NSData, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other dataFromTXTRecordDictionary:)] + pub unsafe fn dataFromTXTRecordDictionary( + txtDictionary: &NSDictionary, + ) -> Id; + + #[method(resolveWithTimeout:)] + pub unsafe fn resolveWithTimeout(&self, timeout: NSTimeInterval); + + #[method(setTXTRecordData:)] + pub unsafe fn setTXTRecordData(&self, recordData: Option<&NSData>) -> bool; + + #[method_id(@__retain_semantics Other TXTRecordData)] + pub unsafe fn TXTRecordData(&self) -> Option>; + + #[method(startMonitoring)] + pub unsafe fn startMonitoring(&self); + + #[method(stopMonitoring)] + pub unsafe fn stopMonitoring(&self); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSNetServiceBrowser; + + unsafe impl ClassType for NSNetServiceBrowser { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSNetServiceBrowser { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSNetServiceBrowserDelegate>); + + #[method(includesPeerToPeer)] + pub unsafe fn includesPeerToPeer(&self) -> bool; + + #[method(setIncludesPeerToPeer:)] + pub unsafe fn setIncludesPeerToPeer(&self, includesPeerToPeer: bool); + + #[method(scheduleInRunLoop:forMode:)] + pub unsafe fn scheduleInRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + + #[method(removeFromRunLoop:forMode:)] + pub unsafe fn removeFromRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + + #[method(searchForBrowsableDomains)] + pub unsafe fn searchForBrowsableDomains(&self); + + #[method(searchForRegistrationDomains)] + pub unsafe fn searchForRegistrationDomains(&self); + + #[method(searchForServicesOfType:inDomain:)] + pub unsafe fn searchForServicesOfType_inDomain( + &self, + type_: &NSString, + domainString: &NSString, + ); + + #[method(stop)] + pub unsafe fn stop(&self); + } +); + +extern_protocol!( + pub struct NSNetServiceDelegate; + + unsafe impl NSNetServiceDelegate { + #[optional] + #[method(netServiceWillPublish:)] + pub unsafe fn netServiceWillPublish(&self, sender: &NSNetService); + + #[optional] + #[method(netServiceDidPublish:)] + pub unsafe fn netServiceDidPublish(&self, sender: &NSNetService); + + #[optional] + #[method(netService:didNotPublish:)] + pub unsafe fn netService_didNotPublish( + &self, + sender: &NSNetService, + errorDict: &NSDictionary, + ); + + #[optional] + #[method(netServiceWillResolve:)] + pub unsafe fn netServiceWillResolve(&self, sender: &NSNetService); + + #[optional] + #[method(netServiceDidResolveAddress:)] + pub unsafe fn netServiceDidResolveAddress(&self, sender: &NSNetService); + + #[optional] + #[method(netService:didNotResolve:)] + pub unsafe fn netService_didNotResolve( + &self, + sender: &NSNetService, + errorDict: &NSDictionary, + ); + + #[optional] + #[method(netServiceDidStop:)] + pub unsafe fn netServiceDidStop(&self, sender: &NSNetService); + + #[optional] + #[method(netService:didUpdateTXTRecordData:)] + pub unsafe fn netService_didUpdateTXTRecordData( + &self, + sender: &NSNetService, + data: &NSData, + ); + + #[optional] + #[method(netService:didAcceptConnectionWithInputStream:outputStream:)] + pub unsafe fn netService_didAcceptConnectionWithInputStream_outputStream( + &self, + sender: &NSNetService, + inputStream: &NSInputStream, + outputStream: &NSOutputStream, + ); + } +); + +extern_protocol!( + pub struct NSNetServiceBrowserDelegate; + + unsafe impl NSNetServiceBrowserDelegate { + #[optional] + #[method(netServiceBrowserWillSearch:)] + pub unsafe fn netServiceBrowserWillSearch(&self, browser: &NSNetServiceBrowser); + + #[optional] + #[method(netServiceBrowserDidStopSearch:)] + pub unsafe fn netServiceBrowserDidStopSearch(&self, browser: &NSNetServiceBrowser); + + #[optional] + #[method(netServiceBrowser:didNotSearch:)] + pub unsafe fn netServiceBrowser_didNotSearch( + &self, + browser: &NSNetServiceBrowser, + errorDict: &NSDictionary, + ); + + #[optional] + #[method(netServiceBrowser:didFindDomain:moreComing:)] + pub unsafe fn netServiceBrowser_didFindDomain_moreComing( + &self, + browser: &NSNetServiceBrowser, + domainString: &NSString, + moreComing: bool, + ); + + #[optional] + #[method(netServiceBrowser:didFindService:moreComing:)] + pub unsafe fn netServiceBrowser_didFindService_moreComing( + &self, + browser: &NSNetServiceBrowser, + service: &NSNetService, + moreComing: bool, + ); + + #[optional] + #[method(netServiceBrowser:didRemoveDomain:moreComing:)] + pub unsafe fn netServiceBrowser_didRemoveDomain_moreComing( + &self, + browser: &NSNetServiceBrowser, + domainString: &NSString, + moreComing: bool, + ); + + #[optional] + #[method(netServiceBrowser:didRemoveService:moreComing:)] + pub unsafe fn netServiceBrowser_didRemoveService_moreComing( + &self, + browser: &NSNetServiceBrowser, + service: &NSNetService, + moreComing: bool, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSNotification.rs b/crates/icrate/src/generated/Foundation/NSNotification.rs new file mode 100644 index 000000000..727cf4e89 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSNotification.rs @@ -0,0 +1,126 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSNotificationName = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSNotification; + + unsafe impl ClassType for NSNotification { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSNotification { + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other object)] + pub unsafe fn object(&self) -> Option>; + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + + #[method_id(@__retain_semantics Init initWithName:object:userInfo:)] + pub unsafe fn initWithName_object_userInfo( + this: Option>, + name: &NSNotificationName, + object: Option<&Object>, + userInfo: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_methods!( + /// NSNotificationCreation + unsafe impl NSNotification { + #[method_id(@__retain_semantics Other notificationWithName:object:)] + pub unsafe fn notificationWithName_object( + aName: &NSNotificationName, + anObject: Option<&Object>, + ) -> Id; + + #[method_id(@__retain_semantics Other notificationWithName:object:userInfo:)] + pub unsafe fn notificationWithName_object_userInfo( + aName: &NSNotificationName, + anObject: Option<&Object>, + aUserInfo: Option<&NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSNotificationCenter; + + unsafe impl ClassType for NSNotificationCenter { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSNotificationCenter { + #[method_id(@__retain_semantics Other defaultCenter)] + pub unsafe fn defaultCenter() -> Id; + + #[method(addObserver:selector:name:object:)] + pub unsafe fn addObserver_selector_name_object( + &self, + observer: &Object, + aSelector: Sel, + aName: Option<&NSNotificationName>, + anObject: Option<&Object>, + ); + + #[method(postNotification:)] + pub unsafe fn postNotification(&self, notification: &NSNotification); + + #[method(postNotificationName:object:)] + pub unsafe fn postNotificationName_object( + &self, + aName: &NSNotificationName, + anObject: Option<&Object>, + ); + + #[method(postNotificationName:object:userInfo:)] + pub unsafe fn postNotificationName_object_userInfo( + &self, + aName: &NSNotificationName, + anObject: Option<&Object>, + aUserInfo: Option<&NSDictionary>, + ); + + #[method(removeObserver:)] + pub unsafe fn removeObserver(&self, observer: &Object); + + #[method(removeObserver:name:object:)] + pub unsafe fn removeObserver_name_object( + &self, + observer: &Object, + aName: Option<&NSNotificationName>, + anObject: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other addObserverForName:object:queue:usingBlock:)] + pub unsafe fn addObserverForName_object_queue_usingBlock( + &self, + name: Option<&NSNotificationName>, + obj: Option<&Object>, + queue: Option<&NSOperationQueue>, + block: &Block<(NonNull,), ()>, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSNotificationQueue.rs b/crates/icrate/src/generated/Foundation/NSNotificationQueue.rs new file mode 100644 index 000000000..9e953e3d7 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSNotificationQueue.rs @@ -0,0 +1,67 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSPostingStyle { + NSPostWhenIdle = 1, + NSPostASAP = 2, + NSPostNow = 3, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSNotificationCoalescing { + NSNotificationNoCoalescing = 0, + NSNotificationCoalescingOnName = 1, + NSNotificationCoalescingOnSender = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSNotificationQueue; + + unsafe impl ClassType for NSNotificationQueue { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSNotificationQueue { + #[method_id(@__retain_semantics Other defaultQueue)] + pub unsafe fn defaultQueue() -> Id; + + #[method_id(@__retain_semantics Init initWithNotificationCenter:)] + pub unsafe fn initWithNotificationCenter( + this: Option>, + notificationCenter: &NSNotificationCenter, + ) -> Id; + + #[method(enqueueNotification:postingStyle:)] + pub unsafe fn enqueueNotification_postingStyle( + &self, + notification: &NSNotification, + postingStyle: NSPostingStyle, + ); + + #[method(enqueueNotification:postingStyle:coalesceMask:forModes:)] + pub unsafe fn enqueueNotification_postingStyle_coalesceMask_forModes( + &self, + notification: &NSNotification, + postingStyle: NSPostingStyle, + coalesceMask: NSNotificationCoalescing, + modes: Option<&NSArray>, + ); + + #[method(dequeueNotificationsMatching:coalesceMask:)] + pub unsafe fn dequeueNotificationsMatching_coalesceMask( + &self, + notification: &NSNotification, + coalesceMask: NSUInteger, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSNull.rs b/crates/icrate/src/generated/Foundation/NSNull.rs new file mode 100644 index 000000000..4fe215944 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSNull.rs @@ -0,0 +1,20 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSNull; + + unsafe impl ClassType for NSNull { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSNull { + #[method_id(@__retain_semantics Other null)] + pub unsafe fn null() -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSNumberFormatter.rs b/crates/icrate/src/generated/Foundation/NSNumberFormatter.rs new file mode 100644 index 000000000..11fff3c0f --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSNumberFormatter.rs @@ -0,0 +1,539 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSNumberFormatterBehavior { + NSNumberFormatterBehaviorDefault = 0, + NSNumberFormatterBehavior10_0 = 1000, + NSNumberFormatterBehavior10_4 = 1040, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSNumberFormatterStyle { + NSNumberFormatterNoStyle = 0, + NSNumberFormatterDecimalStyle = 1, + NSNumberFormatterCurrencyStyle = 2, + NSNumberFormatterPercentStyle = 3, + NSNumberFormatterScientificStyle = 4, + NSNumberFormatterSpellOutStyle = 5, + NSNumberFormatterOrdinalStyle = 6, + NSNumberFormatterCurrencyISOCodeStyle = 8, + NSNumberFormatterCurrencyPluralStyle = 9, + NSNumberFormatterCurrencyAccountingStyle = 10, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSNumberFormatterPadPosition { + NSNumberFormatterPadBeforePrefix = 0, + NSNumberFormatterPadAfterPrefix = 1, + NSNumberFormatterPadBeforeSuffix = 2, + NSNumberFormatterPadAfterSuffix = 3, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSNumberFormatterRoundingMode { + NSNumberFormatterRoundCeiling = 0, + NSNumberFormatterRoundFloor = 1, + NSNumberFormatterRoundDown = 2, + NSNumberFormatterRoundUp = 3, + NSNumberFormatterRoundHalfEven = 4, + NSNumberFormatterRoundHalfDown = 5, + NSNumberFormatterRoundHalfUp = 6, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSNumberFormatter; + + unsafe impl ClassType for NSNumberFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSNumberFormatter { + #[method(formattingContext)] + pub unsafe fn formattingContext(&self) -> NSFormattingContext; + + #[method(setFormattingContext:)] + pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext); + + #[method(getObjectValue:forString:range:error:)] + pub unsafe fn getObjectValue_forString_range_error( + &self, + obj: *mut *mut Object, + string: &NSString, + rangep: *mut NSRange, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other stringFromNumber:)] + pub unsafe fn stringFromNumber(&self, number: &NSNumber) -> Option>; + + #[method_id(@__retain_semantics Other numberFromString:)] + pub unsafe fn numberFromString(&self, string: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other localizedStringFromNumber:numberStyle:)] + pub unsafe fn localizedStringFromNumber_numberStyle( + num: &NSNumber, + nstyle: NSNumberFormatterStyle, + ) -> Id; + + #[method(defaultFormatterBehavior)] + pub unsafe fn defaultFormatterBehavior() -> NSNumberFormatterBehavior; + + #[method(setDefaultFormatterBehavior:)] + pub unsafe fn setDefaultFormatterBehavior(behavior: NSNumberFormatterBehavior); + + #[method(numberStyle)] + pub unsafe fn numberStyle(&self) -> NSNumberFormatterStyle; + + #[method(setNumberStyle:)] + pub unsafe fn setNumberStyle(&self, numberStyle: NSNumberFormatterStyle); + + #[method_id(@__retain_semantics Other locale)] + pub unsafe fn locale(&self) -> Id; + + #[method(setLocale:)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + + #[method(generatesDecimalNumbers)] + pub unsafe fn generatesDecimalNumbers(&self) -> bool; + + #[method(setGeneratesDecimalNumbers:)] + pub unsafe fn setGeneratesDecimalNumbers(&self, generatesDecimalNumbers: bool); + + #[method(formatterBehavior)] + pub unsafe fn formatterBehavior(&self) -> NSNumberFormatterBehavior; + + #[method(setFormatterBehavior:)] + pub unsafe fn setFormatterBehavior(&self, formatterBehavior: NSNumberFormatterBehavior); + + #[method_id(@__retain_semantics Other negativeFormat)] + pub unsafe fn negativeFormat(&self) -> Id; + + #[method(setNegativeFormat:)] + pub unsafe fn setNegativeFormat(&self, negativeFormat: Option<&NSString>); + + #[method_id(@__retain_semantics Other textAttributesForNegativeValues)] + pub unsafe fn textAttributesForNegativeValues( + &self, + ) -> Option, Shared>>; + + #[method(setTextAttributesForNegativeValues:)] + pub unsafe fn setTextAttributesForNegativeValues( + &self, + textAttributesForNegativeValues: Option<&NSDictionary>, + ); + + #[method_id(@__retain_semantics Other positiveFormat)] + pub unsafe fn positiveFormat(&self) -> Id; + + #[method(setPositiveFormat:)] + pub unsafe fn setPositiveFormat(&self, positiveFormat: Option<&NSString>); + + #[method_id(@__retain_semantics Other textAttributesForPositiveValues)] + pub unsafe fn textAttributesForPositiveValues( + &self, + ) -> Option, Shared>>; + + #[method(setTextAttributesForPositiveValues:)] + pub unsafe fn setTextAttributesForPositiveValues( + &self, + textAttributesForPositiveValues: Option<&NSDictionary>, + ); + + #[method(allowsFloats)] + pub unsafe fn allowsFloats(&self) -> bool; + + #[method(setAllowsFloats:)] + pub unsafe fn setAllowsFloats(&self, allowsFloats: bool); + + #[method_id(@__retain_semantics Other decimalSeparator)] + pub unsafe fn decimalSeparator(&self) -> Id; + + #[method(setDecimalSeparator:)] + pub unsafe fn setDecimalSeparator(&self, decimalSeparator: Option<&NSString>); + + #[method(alwaysShowsDecimalSeparator)] + pub unsafe fn alwaysShowsDecimalSeparator(&self) -> bool; + + #[method(setAlwaysShowsDecimalSeparator:)] + pub unsafe fn setAlwaysShowsDecimalSeparator(&self, alwaysShowsDecimalSeparator: bool); + + #[method_id(@__retain_semantics Other currencyDecimalSeparator)] + pub unsafe fn currencyDecimalSeparator(&self) -> Id; + + #[method(setCurrencyDecimalSeparator:)] + pub unsafe fn setCurrencyDecimalSeparator( + &self, + currencyDecimalSeparator: Option<&NSString>, + ); + + #[method(usesGroupingSeparator)] + pub unsafe fn usesGroupingSeparator(&self) -> bool; + + #[method(setUsesGroupingSeparator:)] + pub unsafe fn setUsesGroupingSeparator(&self, usesGroupingSeparator: bool); + + #[method_id(@__retain_semantics Other groupingSeparator)] + pub unsafe fn groupingSeparator(&self) -> Id; + + #[method(setGroupingSeparator:)] + pub unsafe fn setGroupingSeparator(&self, groupingSeparator: Option<&NSString>); + + #[method_id(@__retain_semantics Other zeroSymbol)] + pub unsafe fn zeroSymbol(&self) -> Option>; + + #[method(setZeroSymbol:)] + pub unsafe fn setZeroSymbol(&self, zeroSymbol: Option<&NSString>); + + #[method_id(@__retain_semantics Other textAttributesForZero)] + pub unsafe fn textAttributesForZero( + &self, + ) -> Option, Shared>>; + + #[method(setTextAttributesForZero:)] + pub unsafe fn setTextAttributesForZero( + &self, + textAttributesForZero: Option<&NSDictionary>, + ); + + #[method_id(@__retain_semantics Other nilSymbol)] + pub unsafe fn nilSymbol(&self) -> Id; + + #[method(setNilSymbol:)] + pub unsafe fn setNilSymbol(&self, nilSymbol: &NSString); + + #[method_id(@__retain_semantics Other textAttributesForNil)] + pub unsafe fn textAttributesForNil( + &self, + ) -> Option, Shared>>; + + #[method(setTextAttributesForNil:)] + pub unsafe fn setTextAttributesForNil( + &self, + textAttributesForNil: Option<&NSDictionary>, + ); + + #[method_id(@__retain_semantics Other notANumberSymbol)] + pub unsafe fn notANumberSymbol(&self) -> Id; + + #[method(setNotANumberSymbol:)] + pub unsafe fn setNotANumberSymbol(&self, notANumberSymbol: Option<&NSString>); + + #[method_id(@__retain_semantics Other textAttributesForNotANumber)] + pub unsafe fn textAttributesForNotANumber( + &self, + ) -> Option, Shared>>; + + #[method(setTextAttributesForNotANumber:)] + pub unsafe fn setTextAttributesForNotANumber( + &self, + textAttributesForNotANumber: Option<&NSDictionary>, + ); + + #[method_id(@__retain_semantics Other positiveInfinitySymbol)] + pub unsafe fn positiveInfinitySymbol(&self) -> Id; + + #[method(setPositiveInfinitySymbol:)] + pub unsafe fn setPositiveInfinitySymbol(&self, positiveInfinitySymbol: &NSString); + + #[method_id(@__retain_semantics Other textAttributesForPositiveInfinity)] + pub unsafe fn textAttributesForPositiveInfinity( + &self, + ) -> Option, Shared>>; + + #[method(setTextAttributesForPositiveInfinity:)] + pub unsafe fn setTextAttributesForPositiveInfinity( + &self, + textAttributesForPositiveInfinity: Option<&NSDictionary>, + ); + + #[method_id(@__retain_semantics Other negativeInfinitySymbol)] + pub unsafe fn negativeInfinitySymbol(&self) -> Id; + + #[method(setNegativeInfinitySymbol:)] + pub unsafe fn setNegativeInfinitySymbol(&self, negativeInfinitySymbol: &NSString); + + #[method_id(@__retain_semantics Other textAttributesForNegativeInfinity)] + pub unsafe fn textAttributesForNegativeInfinity( + &self, + ) -> Option, Shared>>; + + #[method(setTextAttributesForNegativeInfinity:)] + pub unsafe fn setTextAttributesForNegativeInfinity( + &self, + textAttributesForNegativeInfinity: Option<&NSDictionary>, + ); + + #[method_id(@__retain_semantics Other positivePrefix)] + pub unsafe fn positivePrefix(&self) -> Id; + + #[method(setPositivePrefix:)] + pub unsafe fn setPositivePrefix(&self, positivePrefix: Option<&NSString>); + + #[method_id(@__retain_semantics Other positiveSuffix)] + pub unsafe fn positiveSuffix(&self) -> Id; + + #[method(setPositiveSuffix:)] + pub unsafe fn setPositiveSuffix(&self, positiveSuffix: Option<&NSString>); + + #[method_id(@__retain_semantics Other negativePrefix)] + pub unsafe fn negativePrefix(&self) -> Id; + + #[method(setNegativePrefix:)] + pub unsafe fn setNegativePrefix(&self, negativePrefix: Option<&NSString>); + + #[method_id(@__retain_semantics Other negativeSuffix)] + pub unsafe fn negativeSuffix(&self) -> Id; + + #[method(setNegativeSuffix:)] + pub unsafe fn setNegativeSuffix(&self, negativeSuffix: Option<&NSString>); + + #[method_id(@__retain_semantics Other currencyCode)] + pub unsafe fn currencyCode(&self) -> Id; + + #[method(setCurrencyCode:)] + pub unsafe fn setCurrencyCode(&self, currencyCode: Option<&NSString>); + + #[method_id(@__retain_semantics Other currencySymbol)] + pub unsafe fn currencySymbol(&self) -> Id; + + #[method(setCurrencySymbol:)] + pub unsafe fn setCurrencySymbol(&self, currencySymbol: Option<&NSString>); + + #[method_id(@__retain_semantics Other internationalCurrencySymbol)] + pub unsafe fn internationalCurrencySymbol(&self) -> Id; + + #[method(setInternationalCurrencySymbol:)] + pub unsafe fn setInternationalCurrencySymbol( + &self, + internationalCurrencySymbol: Option<&NSString>, + ); + + #[method_id(@__retain_semantics Other percentSymbol)] + pub unsafe fn percentSymbol(&self) -> Id; + + #[method(setPercentSymbol:)] + pub unsafe fn setPercentSymbol(&self, percentSymbol: Option<&NSString>); + + #[method_id(@__retain_semantics Other perMillSymbol)] + pub unsafe fn perMillSymbol(&self) -> Id; + + #[method(setPerMillSymbol:)] + pub unsafe fn setPerMillSymbol(&self, perMillSymbol: Option<&NSString>); + + #[method_id(@__retain_semantics Other minusSign)] + pub unsafe fn minusSign(&self) -> Id; + + #[method(setMinusSign:)] + pub unsafe fn setMinusSign(&self, minusSign: Option<&NSString>); + + #[method_id(@__retain_semantics Other plusSign)] + pub unsafe fn plusSign(&self) -> Id; + + #[method(setPlusSign:)] + pub unsafe fn setPlusSign(&self, plusSign: Option<&NSString>); + + #[method_id(@__retain_semantics Other exponentSymbol)] + pub unsafe fn exponentSymbol(&self) -> Id; + + #[method(setExponentSymbol:)] + pub unsafe fn setExponentSymbol(&self, exponentSymbol: Option<&NSString>); + + #[method(groupingSize)] + pub unsafe fn groupingSize(&self) -> NSUInteger; + + #[method(setGroupingSize:)] + pub unsafe fn setGroupingSize(&self, groupingSize: NSUInteger); + + #[method(secondaryGroupingSize)] + pub unsafe fn secondaryGroupingSize(&self) -> NSUInteger; + + #[method(setSecondaryGroupingSize:)] + pub unsafe fn setSecondaryGroupingSize(&self, secondaryGroupingSize: NSUInteger); + + #[method_id(@__retain_semantics Other multiplier)] + pub unsafe fn multiplier(&self) -> Option>; + + #[method(setMultiplier:)] + pub unsafe fn setMultiplier(&self, multiplier: Option<&NSNumber>); + + #[method(formatWidth)] + pub unsafe fn formatWidth(&self) -> NSUInteger; + + #[method(setFormatWidth:)] + pub unsafe fn setFormatWidth(&self, formatWidth: NSUInteger); + + #[method_id(@__retain_semantics Other paddingCharacter)] + pub unsafe fn paddingCharacter(&self) -> Id; + + #[method(setPaddingCharacter:)] + pub unsafe fn setPaddingCharacter(&self, paddingCharacter: Option<&NSString>); + + #[method(paddingPosition)] + pub unsafe fn paddingPosition(&self) -> NSNumberFormatterPadPosition; + + #[method(setPaddingPosition:)] + pub unsafe fn setPaddingPosition(&self, paddingPosition: NSNumberFormatterPadPosition); + + #[method(roundingMode)] + pub unsafe fn roundingMode(&self) -> NSNumberFormatterRoundingMode; + + #[method(setRoundingMode:)] + pub unsafe fn setRoundingMode(&self, roundingMode: NSNumberFormatterRoundingMode); + + #[method_id(@__retain_semantics Other roundingIncrement)] + pub unsafe fn roundingIncrement(&self) -> Id; + + #[method(setRoundingIncrement:)] + pub unsafe fn setRoundingIncrement(&self, roundingIncrement: Option<&NSNumber>); + + #[method(minimumIntegerDigits)] + pub unsafe fn minimumIntegerDigits(&self) -> NSUInteger; + + #[method(setMinimumIntegerDigits:)] + pub unsafe fn setMinimumIntegerDigits(&self, minimumIntegerDigits: NSUInteger); + + #[method(maximumIntegerDigits)] + pub unsafe fn maximumIntegerDigits(&self) -> NSUInteger; + + #[method(setMaximumIntegerDigits:)] + pub unsafe fn setMaximumIntegerDigits(&self, maximumIntegerDigits: NSUInteger); + + #[method(minimumFractionDigits)] + pub unsafe fn minimumFractionDigits(&self) -> NSUInteger; + + #[method(setMinimumFractionDigits:)] + pub unsafe fn setMinimumFractionDigits(&self, minimumFractionDigits: NSUInteger); + + #[method(maximumFractionDigits)] + pub unsafe fn maximumFractionDigits(&self) -> NSUInteger; + + #[method(setMaximumFractionDigits:)] + pub unsafe fn setMaximumFractionDigits(&self, maximumFractionDigits: NSUInteger); + + #[method_id(@__retain_semantics Other minimum)] + pub unsafe fn minimum(&self) -> Option>; + + #[method(setMinimum:)] + pub unsafe fn setMinimum(&self, minimum: Option<&NSNumber>); + + #[method_id(@__retain_semantics Other maximum)] + pub unsafe fn maximum(&self) -> Option>; + + #[method(setMaximum:)] + pub unsafe fn setMaximum(&self, maximum: Option<&NSNumber>); + + #[method_id(@__retain_semantics Other currencyGroupingSeparator)] + pub unsafe fn currencyGroupingSeparator(&self) -> Id; + + #[method(setCurrencyGroupingSeparator:)] + pub unsafe fn setCurrencyGroupingSeparator( + &self, + currencyGroupingSeparator: Option<&NSString>, + ); + + #[method(isLenient)] + pub unsafe fn isLenient(&self) -> bool; + + #[method(setLenient:)] + pub unsafe fn setLenient(&self, lenient: bool); + + #[method(usesSignificantDigits)] + pub unsafe fn usesSignificantDigits(&self) -> bool; + + #[method(setUsesSignificantDigits:)] + pub unsafe fn setUsesSignificantDigits(&self, usesSignificantDigits: bool); + + #[method(minimumSignificantDigits)] + pub unsafe fn minimumSignificantDigits(&self) -> NSUInteger; + + #[method(setMinimumSignificantDigits:)] + pub unsafe fn setMinimumSignificantDigits(&self, minimumSignificantDigits: NSUInteger); + + #[method(maximumSignificantDigits)] + pub unsafe fn maximumSignificantDigits(&self) -> NSUInteger; + + #[method(setMaximumSignificantDigits:)] + pub unsafe fn setMaximumSignificantDigits(&self, maximumSignificantDigits: NSUInteger); + + #[method(isPartialStringValidationEnabled)] + pub unsafe fn isPartialStringValidationEnabled(&self) -> bool; + + #[method(setPartialStringValidationEnabled:)] + pub unsafe fn setPartialStringValidationEnabled( + &self, + partialStringValidationEnabled: bool, + ); + } +); + +extern_methods!( + /// NSNumberFormatterCompatibility + unsafe impl NSNumberFormatter { + #[method(hasThousandSeparators)] + pub unsafe fn hasThousandSeparators(&self) -> bool; + + #[method(setHasThousandSeparators:)] + pub unsafe fn setHasThousandSeparators(&self, hasThousandSeparators: bool); + + #[method_id(@__retain_semantics Other thousandSeparator)] + pub unsafe fn thousandSeparator(&self) -> Id; + + #[method(setThousandSeparator:)] + pub unsafe fn setThousandSeparator(&self, thousandSeparator: Option<&NSString>); + + #[method(localizesFormat)] + pub unsafe fn localizesFormat(&self) -> bool; + + #[method(setLocalizesFormat:)] + pub unsafe fn setLocalizesFormat(&self, localizesFormat: bool); + + #[method_id(@__retain_semantics Other format)] + pub unsafe fn format(&self) -> Id; + + #[method(setFormat:)] + pub unsafe fn setFormat(&self, format: &NSString); + + #[method_id(@__retain_semantics Other attributedStringForZero)] + pub unsafe fn attributedStringForZero(&self) -> Id; + + #[method(setAttributedStringForZero:)] + pub unsafe fn setAttributedStringForZero( + &self, + attributedStringForZero: &NSAttributedString, + ); + + #[method_id(@__retain_semantics Other attributedStringForNil)] + pub unsafe fn attributedStringForNil(&self) -> Id; + + #[method(setAttributedStringForNil:)] + pub unsafe fn setAttributedStringForNil(&self, attributedStringForNil: &NSAttributedString); + + #[method_id(@__retain_semantics Other attributedStringForNotANumber)] + pub unsafe fn attributedStringForNotANumber(&self) -> Id; + + #[method(setAttributedStringForNotANumber:)] + pub unsafe fn setAttributedStringForNotANumber( + &self, + attributedStringForNotANumber: &NSAttributedString, + ); + + #[method_id(@__retain_semantics Other roundingBehavior)] + pub unsafe fn roundingBehavior(&self) -> Id; + + #[method(setRoundingBehavior:)] + pub unsafe fn setRoundingBehavior(&self, roundingBehavior: &NSDecimalNumberHandler); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSObjCRuntime.rs b/crates/icrate/src/generated/Foundation/NSObjCRuntime.rs new file mode 100644 index 000000000..4a235cac6 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSObjCRuntime.rs @@ -0,0 +1,80 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSFoundationVersionNumber: c_double); + +pub type NSExceptionName = NSString; + +pub type NSRunLoopMode = NSString; + +extern_fn!( + pub unsafe fn NSStringFromSelector(aSelector: Sel) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSSelectorFromString(aSelectorName: &NSString) -> Sel; +); + +extern_fn!( + pub unsafe fn NSStringFromClass(aClass: &Class) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSClassFromString(aClassName: &NSString) -> *const Class; +); + +extern_fn!( + pub unsafe fn NSStringFromProtocol(proto: &Protocol) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSProtocolFromString(namestr: &NSString) -> *mut Protocol; +); + +extern_fn!( + pub unsafe fn NSGetSizeAndAlignment( + typePtr: NonNull, + sizep: *mut NSUInteger, + alignp: *mut NSUInteger, + ) -> NonNull; +); + +ns_closed_enum!( + #[underlying(NSInteger)] + pub enum NSComparisonResult { + NSOrderedAscending = -1, + NSOrderedSame = 0, + NSOrderedDescending = 1, + } +); + +pub type NSComparator = *mut Block<(NonNull, NonNull), NSComparisonResult>; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSEnumerationOptions { + NSEnumerationConcurrent = 1 << 0, + NSEnumerationReverse = 1 << 1, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSSortOptions { + NSSortConcurrent = 1 << 0, + NSSortStable = 1 << 4, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSQualityOfService { + NSQualityOfServiceUserInteractive = 0x21, + NSQualityOfServiceUserInitiated = 0x19, + NSQualityOfServiceUtility = 0x11, + NSQualityOfServiceBackground = 0x09, + NSQualityOfServiceDefault = -1, + } +); diff --git a/crates/icrate/src/generated/Foundation/NSObject.rs b/crates/icrate/src/generated/Foundation/NSObject.rs new file mode 100644 index 000000000..193669cc1 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSObject.rs @@ -0,0 +1,148 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSCopying; + + unsafe impl NSCopying { + #[method_id(@__retain_semantics CopyOrMutCopy copyWithZone:)] + pub unsafe fn copyWithZone(&self, zone: *mut NSZone) -> Id; + } +); + +extern_protocol!( + pub struct NSMutableCopying; + + unsafe impl NSMutableCopying { + #[method_id(@__retain_semantics CopyOrMutCopy mutableCopyWithZone:)] + pub unsafe fn mutableCopyWithZone(&self, zone: *mut NSZone) -> Id; + } +); + +extern_protocol!( + pub struct NSCoding; + + unsafe impl NSCoding { + #[method(encodeWithCoder:)] + pub unsafe fn encodeWithCoder(&self, coder: &NSCoder); + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_protocol!( + pub struct NSSecureCoding; + + unsafe impl NSSecureCoding { + #[method(supportsSecureCoding)] + pub unsafe fn supportsSecureCoding() -> bool; + } +); + +extern_methods!( + /// NSCoderMethods + unsafe impl NSObject { + #[method(version)] + pub unsafe fn version() -> NSInteger; + + #[method(setVersion:)] + pub unsafe fn setVersion(aVersion: NSInteger); + + #[method(classForCoder)] + pub unsafe fn classForCoder(&self) -> &'static Class; + + #[method_id(@__retain_semantics Other replacementObjectForCoder:)] + pub unsafe fn replacementObjectForCoder( + &self, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_methods!( + /// NSDeprecatedMethods + unsafe impl NSObject { + #[method(poseAsClass:)] + pub unsafe fn poseAsClass(aClass: &Class); + } +); + +extern_protocol!( + pub struct NSDiscardableContent; + + unsafe impl NSDiscardableContent { + #[method(beginContentAccess)] + pub unsafe fn beginContentAccess(&self) -> bool; + + #[method(endContentAccess)] + pub unsafe fn endContentAccess(&self); + + #[method(discardContentIfPossible)] + pub unsafe fn discardContentIfPossible(&self); + + #[method(isContentDiscarded)] + pub unsafe fn isContentDiscarded(&self) -> bool; + } +); + +extern_methods!( + /// NSDiscardableContentProxy + unsafe impl NSObject { + #[method_id(@__retain_semantics Other autoContentAccessingProxy)] + pub unsafe fn autoContentAccessingProxy(&self) -> Id; + } +); + +extern_fn!( + pub unsafe fn NSAllocateObject( + aClass: &Class, + extraBytes: NSUInteger, + zone: *mut NSZone, + ) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSDeallocateObject(object: &Object); +); + +extern_fn!( + pub unsafe fn NSCopyObject( + object: &Object, + extraBytes: NSUInteger, + zone: *mut NSZone, + ) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSShouldRetainWithZone(anObject: &Object, requestedZone: *mut NSZone) -> Bool; +); + +extern_fn!( + pub unsafe fn NSIncrementExtraRefCount(object: &Object); +); + +extern_fn!( + pub unsafe fn NSDecrementExtraRefCountWasZero(object: &Object) -> Bool; +); + +extern_fn!( + pub unsafe fn NSExtraRefCount(object: &Object) -> NSUInteger; +); + +inline_fn!( + pub unsafe fn CFBridgingRetain(X: Option<&Object>) -> CFTypeRef { + todo!() + } +); + +inline_fn!( + pub unsafe fn CFBridgingRelease(X: CFTypeRef) -> *mut Object { + todo!() + } +); diff --git a/crates/icrate/src/generated/Foundation/NSObjectScripting.rs b/crates/icrate/src/generated/Foundation/NSObjectScripting.rs new file mode 100644 index 000000000..2edc067b4 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSObjectScripting.rs @@ -0,0 +1,43 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_methods!( + /// NSScripting + unsafe impl NSObject { + #[method_id(@__retain_semantics Other scriptingValueForSpecifier:)] + pub unsafe fn scriptingValueForSpecifier( + &self, + objectSpecifier: &NSScriptObjectSpecifier, + ) -> Option>; + + #[method_id(@__retain_semantics Other scriptingProperties)] + pub unsafe fn scriptingProperties( + &self, + ) -> Option, Shared>>; + + #[method(setScriptingProperties:)] + pub unsafe fn setScriptingProperties( + &self, + scriptingProperties: Option<&NSDictionary>, + ); + + #[method_id(@__retain_semantics CopyOrMutCopy copyScriptingValue:forKey:withProperties:)] + pub unsafe fn copyScriptingValue_forKey_withProperties( + &self, + value: &Object, + key: &NSString, + properties: &NSDictionary, + ) -> Option>; + + #[method_id(@__retain_semantics New newScriptingObjectOfClass:forValueForKey:withContentsValue:properties:)] + pub unsafe fn newScriptingObjectOfClass_forValueForKey_withContentsValue_properties( + &self, + objectClass: &Class, + key: &NSString, + contentsValue: Option<&Object>, + properties: &NSDictionary, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSOperation.rs b/crates/icrate/src/generated/Foundation/NSOperation.rs new file mode 100644 index 000000000..db1294609 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSOperation.rs @@ -0,0 +1,234 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSOperationQueuePriority { + NSOperationQueuePriorityVeryLow = -8, + NSOperationQueuePriorityLow = -4, + NSOperationQueuePriorityNormal = 0, + NSOperationQueuePriorityHigh = 4, + NSOperationQueuePriorityVeryHigh = 8, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSOperation; + + unsafe impl ClassType for NSOperation { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSOperation { + #[method(start)] + pub unsafe fn start(&self); + + #[method(main)] + pub unsafe fn main(&self); + + #[method(isCancelled)] + pub unsafe fn isCancelled(&self) -> bool; + + #[method(cancel)] + pub unsafe fn cancel(&self); + + #[method(isExecuting)] + pub unsafe fn isExecuting(&self) -> bool; + + #[method(isFinished)] + pub unsafe fn isFinished(&self) -> bool; + + #[method(isConcurrent)] + pub unsafe fn isConcurrent(&self) -> bool; + + #[method(isAsynchronous)] + pub unsafe fn isAsynchronous(&self) -> bool; + + #[method(isReady)] + pub unsafe fn isReady(&self) -> bool; + + #[method(addDependency:)] + pub unsafe fn addDependency(&self, op: &NSOperation); + + #[method(removeDependency:)] + pub unsafe fn removeDependency(&self, op: &NSOperation); + + #[method_id(@__retain_semantics Other dependencies)] + pub unsafe fn dependencies(&self) -> Id, Shared>; + + #[method(queuePriority)] + pub unsafe fn queuePriority(&self) -> NSOperationQueuePriority; + + #[method(setQueuePriority:)] + pub unsafe fn setQueuePriority(&self, queuePriority: NSOperationQueuePriority); + + #[method(completionBlock)] + pub unsafe fn completionBlock(&self) -> *mut Block<(), ()>; + + #[method(setCompletionBlock:)] + pub unsafe fn setCompletionBlock(&self, completionBlock: Option<&Block<(), ()>>); + + #[method(waitUntilFinished)] + pub unsafe fn waitUntilFinished(&self); + + #[method(threadPriority)] + pub unsafe fn threadPriority(&self) -> c_double; + + #[method(setThreadPriority:)] + pub unsafe fn setThreadPriority(&self, threadPriority: c_double); + + #[method(qualityOfService)] + pub unsafe fn qualityOfService(&self) -> NSQualityOfService; + + #[method(setQualityOfService:)] + pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService); + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSBlockOperation; + + unsafe impl ClassType for NSBlockOperation { + type Super = NSOperation; + } +); + +extern_methods!( + unsafe impl NSBlockOperation { + #[method_id(@__retain_semantics Other blockOperationWithBlock:)] + pub unsafe fn blockOperationWithBlock(block: &Block<(), ()>) -> Id; + + #[method(addExecutionBlock:)] + pub unsafe fn addExecutionBlock(&self, block: &Block<(), ()>); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSInvocationOperation; + + unsafe impl ClassType for NSInvocationOperation { + type Super = NSOperation; + } +); + +extern_methods!( + unsafe impl NSInvocationOperation { + #[method_id(@__retain_semantics Init initWithTarget:selector:object:)] + pub unsafe fn initWithTarget_selector_object( + this: Option>, + target: &Object, + sel: Sel, + arg: Option<&Object>, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithInvocation:)] + pub unsafe fn initWithInvocation( + this: Option>, + inv: &NSInvocation, + ) -> Id; + + #[method_id(@__retain_semantics Other invocation)] + pub unsafe fn invocation(&self) -> Id; + + #[method_id(@__retain_semantics Other result)] + pub unsafe fn result(&self) -> Option>; + } +); + +extern_static!(NSInvocationOperationVoidResultException: &'static NSExceptionName); + +extern_static!(NSInvocationOperationCancelledException: &'static NSExceptionName); + +extern_static!(NSOperationQueueDefaultMaxConcurrentOperationCount: NSInteger = -1); + +extern_class!( + #[derive(Debug)] + pub struct NSOperationQueue; + + unsafe impl ClassType for NSOperationQueue { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSOperationQueue { + #[method_id(@__retain_semantics Other progress)] + pub unsafe fn progress(&self) -> Id; + + #[method(addOperation:)] + pub unsafe fn addOperation(&self, op: &NSOperation); + + #[method(addOperations:waitUntilFinished:)] + pub unsafe fn addOperations_waitUntilFinished( + &self, + ops: &NSArray, + wait: bool, + ); + + #[method(addOperationWithBlock:)] + pub unsafe fn addOperationWithBlock(&self, block: &Block<(), ()>); + + #[method(addBarrierBlock:)] + pub unsafe fn addBarrierBlock(&self, barrier: &Block<(), ()>); + + #[method(maxConcurrentOperationCount)] + pub unsafe fn maxConcurrentOperationCount(&self) -> NSInteger; + + #[method(setMaxConcurrentOperationCount:)] + pub unsafe fn setMaxConcurrentOperationCount(&self, maxConcurrentOperationCount: NSInteger); + + #[method(isSuspended)] + pub unsafe fn isSuspended(&self) -> bool; + + #[method(setSuspended:)] + pub unsafe fn setSuspended(&self, suspended: bool); + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + + #[method(qualityOfService)] + pub unsafe fn qualityOfService(&self) -> NSQualityOfService; + + #[method(setQualityOfService:)] + pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService); + + #[method(cancelAllOperations)] + pub unsafe fn cancelAllOperations(&self); + + #[method(waitUntilAllOperationsAreFinished)] + pub unsafe fn waitUntilAllOperationsAreFinished(&self); + + #[method_id(@__retain_semantics Other currentQueue)] + pub unsafe fn currentQueue() -> Option>; + + #[method_id(@__retain_semantics Other mainQueue)] + pub unsafe fn mainQueue() -> Id; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSOperationQueue { + #[method_id(@__retain_semantics Other operations)] + pub unsafe fn operations(&self) -> Id, Shared>; + + #[method(operationCount)] + pub unsafe fn operationCount(&self) -> NSUInteger; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSOrderedCollectionChange.rs b/crates/icrate/src/generated/Foundation/NSOrderedCollectionChange.rs new file mode 100644 index 000000000..f44091090 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSOrderedCollectionChange.rs @@ -0,0 +1,74 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSCollectionChangeType { + NSCollectionChangeInsert = 0, + NSCollectionChangeRemove = 1, + } +); + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSOrderedCollectionChange { + _inner0: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSOrderedCollectionChange { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSOrderedCollectionChange { + #[method_id(@__retain_semantics Other changeWithObject:type:index:)] + pub unsafe fn changeWithObject_type_index( + anObject: Option<&ObjectType>, + type_: NSCollectionChangeType, + index: NSUInteger, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other changeWithObject:type:index:associatedIndex:)] + pub unsafe fn changeWithObject_type_index_associatedIndex( + anObject: Option<&ObjectType>, + type_: NSCollectionChangeType, + index: NSUInteger, + associatedIndex: NSUInteger, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other object)] + pub unsafe fn object(&self) -> Option>; + + #[method(changeType)] + pub unsafe fn changeType(&self) -> NSCollectionChangeType; + + #[method(index)] + pub unsafe fn index(&self) -> NSUInteger; + + #[method(associatedIndex)] + pub unsafe fn associatedIndex(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithObject:type:index:)] + pub unsafe fn initWithObject_type_index( + this: Option>, + anObject: Option<&ObjectType>, + type_: NSCollectionChangeType, + index: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithObject:type:index:associatedIndex:)] + pub unsafe fn initWithObject_type_index_associatedIndex( + this: Option>, + anObject: Option<&ObjectType>, + type_: NSCollectionChangeType, + index: NSUInteger, + associatedIndex: NSUInteger, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSOrderedCollectionDifference.rs b/crates/icrate/src/generated/Foundation/NSOrderedCollectionDifference.rs new file mode 100644 index 000000000..b5345764a --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSOrderedCollectionDifference.rs @@ -0,0 +1,77 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSOrderedCollectionDifferenceCalculationOptions { + NSOrderedCollectionDifferenceCalculationOmitInsertedObjects = 1 << 0, + NSOrderedCollectionDifferenceCalculationOmitRemovedObjects = 1 << 1, + NSOrderedCollectionDifferenceCalculationInferMoves = 1 << 2, + } +); + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSOrderedCollectionDifference { + _inner0: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSOrderedCollectionDifference { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSOrderedCollectionDifference { + #[method_id(@__retain_semantics Init initWithChanges:)] + pub unsafe fn initWithChanges( + this: Option>, + changes: &NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:)] + pub unsafe fn initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges( + this: Option>, + inserts: &NSIndexSet, + insertedObjects: Option<&NSArray>, + removes: &NSIndexSet, + removedObjects: Option<&NSArray>, + changes: &NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:)] + pub unsafe fn initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects( + this: Option>, + inserts: &NSIndexSet, + insertedObjects: Option<&NSArray>, + removes: &NSIndexSet, + removedObjects: Option<&NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Other insertions)] + pub unsafe fn insertions( + &self, + ) -> Id>, Shared>; + + #[method_id(@__retain_semantics Other removals)] + pub unsafe fn removals(&self) + -> Id>, Shared>; + + #[method(hasChanges)] + pub unsafe fn hasChanges(&self) -> bool; + + #[method_id(@__retain_semantics Other differenceByTransformingChangesWithBlock:)] + pub unsafe fn differenceByTransformingChangesWithBlock( + &self, + block: &Block< + (NonNull>,), + NonNull>, + >, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other inverseDifference)] + pub unsafe fn inverseDifference(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSOrderedSet.rs b/crates/icrate/src/generated/Foundation/NSOrderedSet.rs new file mode 100644 index 000000000..101409162 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSOrderedSet.rs @@ -0,0 +1,499 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSOrderedSet { + _inner0: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSOrderedSet { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSOrderedSet { + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other objectAtIndex:)] + pub unsafe fn objectAtIndex(&self, idx: NSUInteger) -> Id; + + #[method(indexOfObject:)] + pub unsafe fn indexOfObject(&self, object: &ObjectType) -> NSUInteger; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithObjects:count:)] + pub unsafe fn initWithObjects_count( + this: Option>, + objects: *mut NonNull, + cnt: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_methods!( + /// NSExtendedOrderedSet + unsafe impl NSOrderedSet { + #[method(getObjects:range:)] + pub unsafe fn getObjects_range(&self, objects: *mut NonNull, range: NSRange); + + #[method_id(@__retain_semantics Other objectsAtIndexes:)] + pub unsafe fn objectsAtIndexes( + &self, + indexes: &NSIndexSet, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other firstObject)] + pub unsafe fn firstObject(&self) -> Option>; + + #[method_id(@__retain_semantics Other lastObject)] + pub unsafe fn lastObject(&self) -> Option>; + + #[method(isEqualToOrderedSet:)] + pub unsafe fn isEqualToOrderedSet(&self, other: &NSOrderedSet) -> bool; + + #[method(containsObject:)] + pub unsafe fn containsObject(&self, object: &ObjectType) -> bool; + + #[method(intersectsOrderedSet:)] + pub unsafe fn intersectsOrderedSet(&self, other: &NSOrderedSet) -> bool; + + #[method(intersectsSet:)] + pub unsafe fn intersectsSet(&self, set: &NSSet) -> bool; + + #[method(isSubsetOfOrderedSet:)] + pub unsafe fn isSubsetOfOrderedSet(&self, other: &NSOrderedSet) -> bool; + + #[method(isSubsetOfSet:)] + pub unsafe fn isSubsetOfSet(&self, set: &NSSet) -> bool; + + #[method_id(@__retain_semantics Other objectAtIndexedSubscript:)] + pub unsafe fn objectAtIndexedSubscript(&self, idx: NSUInteger) -> Id; + + #[method_id(@__retain_semantics Other objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other reverseObjectEnumerator)] + pub unsafe fn reverseObjectEnumerator(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other reversedOrderedSet)] + pub unsafe fn reversedOrderedSet(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other array)] + pub unsafe fn array(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other set)] + pub unsafe fn set(&self) -> Id, Shared>; + + #[method(enumerateObjectsUsingBlock:)] + pub unsafe fn enumerateObjectsUsingBlock( + &self, + block: &Block<(NonNull, NSUInteger, NonNull), ()>, + ); + + #[method(enumerateObjectsWithOptions:usingBlock:)] + pub unsafe fn enumerateObjectsWithOptions_usingBlock( + &self, + opts: NSEnumerationOptions, + block: &Block<(NonNull, NSUInteger, NonNull), ()>, + ); + + #[method(enumerateObjectsAtIndexes:options:usingBlock:)] + pub unsafe fn enumerateObjectsAtIndexes_options_usingBlock( + &self, + s: &NSIndexSet, + opts: NSEnumerationOptions, + block: &Block<(NonNull, NSUInteger, NonNull), ()>, + ); + + #[method(indexOfObjectPassingTest:)] + pub unsafe fn indexOfObjectPassingTest( + &self, + predicate: &Block<(NonNull, NSUInteger, NonNull), Bool>, + ) -> NSUInteger; + + #[method(indexOfObjectWithOptions:passingTest:)] + pub unsafe fn indexOfObjectWithOptions_passingTest( + &self, + opts: NSEnumerationOptions, + predicate: &Block<(NonNull, NSUInteger, NonNull), Bool>, + ) -> NSUInteger; + + #[method(indexOfObjectAtIndexes:options:passingTest:)] + pub unsafe fn indexOfObjectAtIndexes_options_passingTest( + &self, + s: &NSIndexSet, + opts: NSEnumerationOptions, + predicate: &Block<(NonNull, NSUInteger, NonNull), Bool>, + ) -> NSUInteger; + + #[method_id(@__retain_semantics Other indexesOfObjectsPassingTest:)] + pub unsafe fn indexesOfObjectsPassingTest( + &self, + predicate: &Block<(NonNull, NSUInteger, NonNull), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Other indexesOfObjectsWithOptions:passingTest:)] + pub unsafe fn indexesOfObjectsWithOptions_passingTest( + &self, + opts: NSEnumerationOptions, + predicate: &Block<(NonNull, NSUInteger, NonNull), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Other indexesOfObjectsAtIndexes:options:passingTest:)] + pub unsafe fn indexesOfObjectsAtIndexes_options_passingTest( + &self, + s: &NSIndexSet, + opts: NSEnumerationOptions, + predicate: &Block<(NonNull, NSUInteger, NonNull), Bool>, + ) -> Id; + + #[method(indexOfObject:inSortedRange:options:usingComparator:)] + pub unsafe fn indexOfObject_inSortedRange_options_usingComparator( + &self, + object: &ObjectType, + range: NSRange, + opts: NSBinarySearchingOptions, + cmp: NSComparator, + ) -> NSUInteger; + + #[method_id(@__retain_semantics Other sortedArrayUsingComparator:)] + pub unsafe fn sortedArrayUsingComparator( + &self, + cmptr: NSComparator, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other sortedArrayWithOptions:usingComparator:)] + pub unsafe fn sortedArrayWithOptions_usingComparator( + &self, + opts: NSSortOptions, + cmptr: NSComparator, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other description)] + pub unsafe fn description(&self) -> Id; + + #[method_id(@__retain_semantics Other descriptionWithLocale:)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + + #[method_id(@__retain_semantics Other descriptionWithLocale:indent:)] + pub unsafe fn descriptionWithLocale_indent( + &self, + locale: Option<&Object>, + level: NSUInteger, + ) -> Id; + } +); + +extern_methods!( + /// NSOrderedSetCreation + unsafe impl NSOrderedSet { + #[method_id(@__retain_semantics Other orderedSet)] + pub unsafe fn orderedSet() -> Id; + + #[method_id(@__retain_semantics Other orderedSetWithObject:)] + pub unsafe fn orderedSetWithObject(object: &ObjectType) -> Id; + + #[method_id(@__retain_semantics Other orderedSetWithObjects:count:)] + pub unsafe fn orderedSetWithObjects_count( + objects: NonNull>, + cnt: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other orderedSetWithOrderedSet:)] + pub unsafe fn orderedSetWithOrderedSet(set: &NSOrderedSet) -> Id; + + #[method_id(@__retain_semantics Other orderedSetWithOrderedSet:range:copyItems:)] + pub unsafe fn orderedSetWithOrderedSet_range_copyItems( + set: &NSOrderedSet, + range: NSRange, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other orderedSetWithArray:)] + pub unsafe fn orderedSetWithArray(array: &NSArray) -> Id; + + #[method_id(@__retain_semantics Other orderedSetWithArray:range:copyItems:)] + pub unsafe fn orderedSetWithArray_range_copyItems( + array: &NSArray, + range: NSRange, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other orderedSetWithSet:)] + pub unsafe fn orderedSetWithSet(set: &NSSet) -> Id; + + #[method_id(@__retain_semantics Other orderedSetWithSet:copyItems:)] + pub unsafe fn orderedSetWithSet_copyItems( + set: &NSSet, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithObject:)] + pub unsafe fn initWithObject( + this: Option>, + object: &ObjectType, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithOrderedSet:)] + pub unsafe fn initWithOrderedSet( + this: Option>, + set: &NSOrderedSet, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithOrderedSet:copyItems:)] + pub unsafe fn initWithOrderedSet_copyItems( + this: Option>, + set: &NSOrderedSet, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithOrderedSet:range:copyItems:)] + pub unsafe fn initWithOrderedSet_range_copyItems( + this: Option>, + set: &NSOrderedSet, + range: NSRange, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithArray:)] + pub unsafe fn initWithArray( + this: Option>, + array: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithArray:copyItems:)] + pub unsafe fn initWithArray_copyItems( + this: Option>, + set: &NSArray, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithArray:range:copyItems:)] + pub unsafe fn initWithArray_range_copyItems( + this: Option>, + set: &NSArray, + range: NSRange, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithSet:)] + pub unsafe fn initWithSet( + this: Option>, + set: &NSSet, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithSet:copyItems:)] + pub unsafe fn initWithSet_copyItems( + this: Option>, + set: &NSSet, + flag: bool, + ) -> Id; + } +); + +extern_methods!( + /// NSOrderedSetDiffing + unsafe impl NSOrderedSet { + #[method_id(@__retain_semantics Other differenceFromOrderedSet:withOptions:usingEquivalenceTest:)] + pub unsafe fn differenceFromOrderedSet_withOptions_usingEquivalenceTest( + &self, + other: &NSOrderedSet, + options: NSOrderedCollectionDifferenceCalculationOptions, + block: &Block<(NonNull, NonNull), Bool>, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other differenceFromOrderedSet:withOptions:)] + pub unsafe fn differenceFromOrderedSet_withOptions( + &self, + other: &NSOrderedSet, + options: NSOrderedCollectionDifferenceCalculationOptions, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other differenceFromOrderedSet:)] + pub unsafe fn differenceFromOrderedSet( + &self, + other: &NSOrderedSet, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other orderedSetByApplyingDifference:)] + pub unsafe fn orderedSetByApplyingDifference( + &self, + difference: &NSOrderedCollectionDifference, + ) -> Option, Shared>>; + } +); + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSMutableOrderedSet { + _inner0: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSMutableOrderedSet { + type Super = NSOrderedSet; + } +); + +extern_methods!( + unsafe impl NSMutableOrderedSet { + #[method(insertObject:atIndex:)] + pub unsafe fn insertObject_atIndex(&self, object: &ObjectType, idx: NSUInteger); + + #[method(removeObjectAtIndex:)] + pub unsafe fn removeObjectAtIndex(&self, idx: NSUInteger); + + #[method(replaceObjectAtIndex:withObject:)] + pub unsafe fn replaceObjectAtIndex_withObject(&self, idx: NSUInteger, object: &ObjectType); + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCapacity:)] + pub unsafe fn initWithCapacity( + this: Option>, + numItems: NSUInteger, + ) -> Id; + } +); + +extern_methods!( + /// NSExtendedMutableOrderedSet + unsafe impl NSMutableOrderedSet { + #[method(addObject:)] + pub unsafe fn addObject(&self, object: &ObjectType); + + #[method(addObjects:count:)] + pub unsafe fn addObjects_count(&self, objects: *mut NonNull, count: NSUInteger); + + #[method(addObjectsFromArray:)] + pub unsafe fn addObjectsFromArray(&self, array: &NSArray); + + #[method(exchangeObjectAtIndex:withObjectAtIndex:)] + pub unsafe fn exchangeObjectAtIndex_withObjectAtIndex( + &self, + idx1: NSUInteger, + idx2: NSUInteger, + ); + + #[method(moveObjectsAtIndexes:toIndex:)] + pub unsafe fn moveObjectsAtIndexes_toIndex(&self, indexes: &NSIndexSet, idx: NSUInteger); + + #[method(insertObjects:atIndexes:)] + pub unsafe fn insertObjects_atIndexes( + &self, + objects: &NSArray, + indexes: &NSIndexSet, + ); + + #[method(setObject:atIndex:)] + pub unsafe fn setObject_atIndex(&self, obj: &ObjectType, idx: NSUInteger); + + #[method(setObject:atIndexedSubscript:)] + pub unsafe fn setObject_atIndexedSubscript(&self, obj: &ObjectType, idx: NSUInteger); + + #[method(replaceObjectsInRange:withObjects:count:)] + pub unsafe fn replaceObjectsInRange_withObjects_count( + &self, + range: NSRange, + objects: *mut NonNull, + count: NSUInteger, + ); + + #[method(replaceObjectsAtIndexes:withObjects:)] + pub unsafe fn replaceObjectsAtIndexes_withObjects( + &self, + indexes: &NSIndexSet, + objects: &NSArray, + ); + + #[method(removeObjectsInRange:)] + pub unsafe fn removeObjectsInRange(&self, range: NSRange); + + #[method(removeObjectsAtIndexes:)] + pub unsafe fn removeObjectsAtIndexes(&self, indexes: &NSIndexSet); + + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + + #[method(removeObject:)] + pub unsafe fn removeObject(&self, object: &ObjectType); + + #[method(removeObjectsInArray:)] + pub unsafe fn removeObjectsInArray(&self, array: &NSArray); + + #[method(intersectOrderedSet:)] + pub unsafe fn intersectOrderedSet(&self, other: &NSOrderedSet); + + #[method(minusOrderedSet:)] + pub unsafe fn minusOrderedSet(&self, other: &NSOrderedSet); + + #[method(unionOrderedSet:)] + pub unsafe fn unionOrderedSet(&self, other: &NSOrderedSet); + + #[method(intersectSet:)] + pub unsafe fn intersectSet(&self, other: &NSSet); + + #[method(minusSet:)] + pub unsafe fn minusSet(&self, other: &NSSet); + + #[method(unionSet:)] + pub unsafe fn unionSet(&self, other: &NSSet); + + #[method(sortUsingComparator:)] + pub unsafe fn sortUsingComparator(&self, cmptr: NSComparator); + + #[method(sortWithOptions:usingComparator:)] + pub unsafe fn sortWithOptions_usingComparator( + &self, + opts: NSSortOptions, + cmptr: NSComparator, + ); + + #[method(sortRange:options:usingComparator:)] + pub unsafe fn sortRange_options_usingComparator( + &self, + range: NSRange, + opts: NSSortOptions, + cmptr: NSComparator, + ); + } +); + +extern_methods!( + /// NSMutableOrderedSetCreation + unsafe impl NSMutableOrderedSet { + #[method_id(@__retain_semantics Other orderedSetWithCapacity:)] + pub unsafe fn orderedSetWithCapacity(numItems: NSUInteger) -> Id; + } +); + +extern_methods!( + /// NSMutableOrderedSetDiffing + unsafe impl NSMutableOrderedSet { + #[method(applyDifference:)] + pub unsafe fn applyDifference( + &self, + difference: &NSOrderedCollectionDifference, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSOrthography.rs b/crates/icrate/src/generated/Foundation/NSOrthography.rs new file mode 100644 index 000000000..6e7d25562 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSOrthography.rs @@ -0,0 +1,76 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSOrthography; + + unsafe impl ClassType for NSOrthography { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSOrthography { + #[method_id(@__retain_semantics Other dominantScript)] + pub unsafe fn dominantScript(&self) -> Id; + + #[method_id(@__retain_semantics Other languageMap)] + pub unsafe fn languageMap(&self) -> Id>, Shared>; + + #[method_id(@__retain_semantics Init initWithDominantScript:languageMap:)] + pub unsafe fn initWithDominantScript_languageMap( + this: Option>, + script: &NSString, + map: &NSDictionary>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_methods!( + /// NSOrthographyExtended + unsafe impl NSOrthography { + #[method_id(@__retain_semantics Other languagesForScript:)] + pub unsafe fn languagesForScript( + &self, + script: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other dominantLanguageForScript:)] + pub unsafe fn dominantLanguageForScript( + &self, + script: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other dominantLanguage)] + pub unsafe fn dominantLanguage(&self) -> Id; + + #[method_id(@__retain_semantics Other allScripts)] + pub unsafe fn allScripts(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other allLanguages)] + pub unsafe fn allLanguages(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other defaultOrthographyForLanguage:)] + pub unsafe fn defaultOrthographyForLanguage(language: &NSString) -> Id; + } +); + +extern_methods!( + /// NSOrthographyCreation + unsafe impl NSOrthography { + #[method_id(@__retain_semantics Other orthographyWithDominantScript:languageMap:)] + pub unsafe fn orthographyWithDominantScript_languageMap( + script: &NSString, + map: &NSDictionary>, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSPathUtilities.rs b/crates/icrate/src/generated/Foundation/NSPathUtilities.rs new file mode 100644 index 000000000..909bd0bf4 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSPathUtilities.rs @@ -0,0 +1,163 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_methods!( + /// NSStringPathExtensions + unsafe impl NSString { + #[method_id(@__retain_semantics Other pathWithComponents:)] + pub unsafe fn pathWithComponents(components: &NSArray) -> Id; + + #[method_id(@__retain_semantics Other pathComponents)] + pub unsafe fn pathComponents(&self) -> Id, Shared>; + + #[method(isAbsolutePath)] + pub unsafe fn isAbsolutePath(&self) -> bool; + + #[method_id(@__retain_semantics Other lastPathComponent)] + pub unsafe fn lastPathComponent(&self) -> Id; + + #[method_id(@__retain_semantics Other stringByDeletingLastPathComponent)] + pub unsafe fn stringByDeletingLastPathComponent(&self) -> Id; + + #[method_id(@__retain_semantics Other stringByAppendingPathComponent:)] + pub fn stringByAppendingPathComponent(&self, str: &NSString) -> Id; + + #[method_id(@__retain_semantics Other pathExtension)] + pub unsafe fn pathExtension(&self) -> Id; + + #[method_id(@__retain_semantics Other stringByDeletingPathExtension)] + pub unsafe fn stringByDeletingPathExtension(&self) -> Id; + + #[method_id(@__retain_semantics Other stringByAppendingPathExtension:)] + pub unsafe fn stringByAppendingPathExtension( + &self, + str: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other stringByAbbreviatingWithTildeInPath)] + pub unsafe fn stringByAbbreviatingWithTildeInPath(&self) -> Id; + + #[method_id(@__retain_semantics Other stringByExpandingTildeInPath)] + pub unsafe fn stringByExpandingTildeInPath(&self) -> Id; + + #[method_id(@__retain_semantics Other stringByStandardizingPath)] + pub unsafe fn stringByStandardizingPath(&self) -> Id; + + #[method_id(@__retain_semantics Other stringByResolvingSymlinksInPath)] + pub unsafe fn stringByResolvingSymlinksInPath(&self) -> Id; + + #[method_id(@__retain_semantics Other stringsByAppendingPaths:)] + pub unsafe fn stringsByAppendingPaths( + &self, + paths: &NSArray, + ) -> Id, Shared>; + + #[method(completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:)] + pub unsafe fn completePathIntoString_caseSensitive_matchesIntoArray_filterTypes( + &self, + outputName: *mut *mut NSString, + flag: bool, + outputArray: *mut *mut NSArray, + filterTypes: Option<&NSArray>, + ) -> NSUInteger; + + #[method(fileSystemRepresentation)] + pub unsafe fn fileSystemRepresentation(&self) -> NonNull; + + #[method(getFileSystemRepresentation:maxLength:)] + pub unsafe fn getFileSystemRepresentation_maxLength( + &self, + cname: NonNull, + max: NSUInteger, + ) -> bool; + } +); + +extern_methods!( + /// NSArrayPathExtensions + unsafe impl NSArray { + #[method_id(@__retain_semantics Other pathsMatchingExtensions:)] + pub unsafe fn pathsMatchingExtensions( + &self, + filterTypes: &NSArray, + ) -> Id, Shared>; + } +); + +extern_fn!( + pub unsafe fn NSUserName() -> NonNull; +); + +extern_fn!( + pub unsafe fn NSFullUserName() -> NonNull; +); + +extern_fn!( + pub unsafe fn NSHomeDirectory() -> NonNull; +); + +extern_fn!( + pub unsafe fn NSHomeDirectoryForUser(userName: Option<&NSString>) -> *mut NSString; +); + +extern_fn!( + pub unsafe fn NSTemporaryDirectory() -> NonNull; +); + +extern_fn!( + pub unsafe fn NSOpenStepRootDirectory() -> NonNull; +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSSearchPathDirectory { + NSApplicationDirectory = 1, + NSDemoApplicationDirectory = 2, + NSDeveloperApplicationDirectory = 3, + NSAdminApplicationDirectory = 4, + NSLibraryDirectory = 5, + NSDeveloperDirectory = 6, + NSUserDirectory = 7, + NSDocumentationDirectory = 8, + NSDocumentDirectory = 9, + NSCoreServiceDirectory = 10, + NSAutosavedInformationDirectory = 11, + NSDesktopDirectory = 12, + NSCachesDirectory = 13, + NSApplicationSupportDirectory = 14, + NSDownloadsDirectory = 15, + NSInputMethodsDirectory = 16, + NSMoviesDirectory = 17, + NSMusicDirectory = 18, + NSPicturesDirectory = 19, + NSPrinterDescriptionDirectory = 20, + NSSharedPublicDirectory = 21, + NSPreferencePanesDirectory = 22, + NSApplicationScriptsDirectory = 23, + NSItemReplacementDirectory = 99, + NSAllApplicationsDirectory = 100, + NSAllLibrariesDirectory = 101, + NSTrashDirectory = 102, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSSearchPathDomainMask { + NSUserDomainMask = 1, + NSLocalDomainMask = 2, + NSNetworkDomainMask = 4, + NSSystemDomainMask = 8, + NSAllDomainsMask = 0x0ffff, + } +); + +extern_fn!( + pub unsafe fn NSSearchPathForDirectoriesInDomains( + directory: NSSearchPathDirectory, + domainMask: NSSearchPathDomainMask, + expandTilde: Bool, + ) -> NonNull>; +); diff --git a/crates/icrate/src/generated/Foundation/NSPersonNameComponents.rs b/crates/icrate/src/generated/Foundation/NSPersonNameComponents.rs new file mode 100644 index 000000000..c5e94da2d --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSPersonNameComponents.rs @@ -0,0 +1,62 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPersonNameComponents; + + unsafe impl ClassType for NSPersonNameComponents { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPersonNameComponents { + #[method_id(@__retain_semantics Other namePrefix)] + pub unsafe fn namePrefix(&self) -> Option>; + + #[method(setNamePrefix:)] + pub unsafe fn setNamePrefix(&self, namePrefix: Option<&NSString>); + + #[method_id(@__retain_semantics Other givenName)] + pub unsafe fn givenName(&self) -> Option>; + + #[method(setGivenName:)] + pub unsafe fn setGivenName(&self, givenName: Option<&NSString>); + + #[method_id(@__retain_semantics Other middleName)] + pub unsafe fn middleName(&self) -> Option>; + + #[method(setMiddleName:)] + pub unsafe fn setMiddleName(&self, middleName: Option<&NSString>); + + #[method_id(@__retain_semantics Other familyName)] + pub unsafe fn familyName(&self) -> Option>; + + #[method(setFamilyName:)] + pub unsafe fn setFamilyName(&self, familyName: Option<&NSString>); + + #[method_id(@__retain_semantics Other nameSuffix)] + pub unsafe fn nameSuffix(&self) -> Option>; + + #[method(setNameSuffix:)] + pub unsafe fn setNameSuffix(&self, nameSuffix: Option<&NSString>); + + #[method_id(@__retain_semantics Other nickname)] + pub unsafe fn nickname(&self) -> Option>; + + #[method(setNickname:)] + pub unsafe fn setNickname(&self, nickname: Option<&NSString>); + + #[method_id(@__retain_semantics Other phoneticRepresentation)] + pub unsafe fn phoneticRepresentation(&self) -> Option>; + + #[method(setPhoneticRepresentation:)] + pub unsafe fn setPhoneticRepresentation( + &self, + phoneticRepresentation: Option<&NSPersonNameComponents>, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSPersonNameComponentsFormatter.rs b/crates/icrate/src/generated/Foundation/NSPersonNameComponentsFormatter.rs new file mode 100644 index 000000000..4895bc125 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSPersonNameComponentsFormatter.rs @@ -0,0 +1,102 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSPersonNameComponentsFormatterStyle { + NSPersonNameComponentsFormatterStyleDefault = 0, + NSPersonNameComponentsFormatterStyleShort = 1, + NSPersonNameComponentsFormatterStyleMedium = 2, + NSPersonNameComponentsFormatterStyleLong = 3, + NSPersonNameComponentsFormatterStyleAbbreviated = 4, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSPersonNameComponentsFormatterOptions { + NSPersonNameComponentsFormatterPhonetic = 1 << 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPersonNameComponentsFormatter; + + unsafe impl ClassType for NSPersonNameComponentsFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSPersonNameComponentsFormatter { + #[method(style)] + pub unsafe fn style(&self) -> NSPersonNameComponentsFormatterStyle; + + #[method(setStyle:)] + pub unsafe fn setStyle(&self, style: NSPersonNameComponentsFormatterStyle); + + #[method(isPhonetic)] + pub unsafe fn isPhonetic(&self) -> bool; + + #[method(setPhonetic:)] + pub unsafe fn setPhonetic(&self, phonetic: bool); + + #[method_id(@__retain_semantics Other locale)] + pub unsafe fn locale(&self) -> Id; + + #[method(setLocale:)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + + #[method_id(@__retain_semantics Other localizedStringFromPersonNameComponents:style:options:)] + pub unsafe fn localizedStringFromPersonNameComponents_style_options( + components: &NSPersonNameComponents, + nameFormatStyle: NSPersonNameComponentsFormatterStyle, + nameOptions: NSPersonNameComponentsFormatterOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other stringFromPersonNameComponents:)] + pub unsafe fn stringFromPersonNameComponents( + &self, + components: &NSPersonNameComponents, + ) -> Id; + + #[method_id(@__retain_semantics Other annotatedStringFromPersonNameComponents:)] + pub unsafe fn annotatedStringFromPersonNameComponents( + &self, + components: &NSPersonNameComponents, + ) -> Id; + + #[method_id(@__retain_semantics Other personNameComponentsFromString:)] + pub unsafe fn personNameComponentsFromString( + &self, + string: &NSString, + ) -> Option>; + + #[method(getObjectValue:forString:errorDescription:)] + pub unsafe fn getObjectValue_forString_errorDescription( + &self, + obj: *mut *mut Object, + string: &NSString, + error: *mut *mut NSString, + ) -> bool; + } +); + +extern_static!(NSPersonNameComponentKey: &'static NSString); + +extern_static!(NSPersonNameComponentGivenName: &'static NSString); + +extern_static!(NSPersonNameComponentFamilyName: &'static NSString); + +extern_static!(NSPersonNameComponentMiddleName: &'static NSString); + +extern_static!(NSPersonNameComponentPrefix: &'static NSString); + +extern_static!(NSPersonNameComponentSuffix: &'static NSString); + +extern_static!(NSPersonNameComponentNickname: &'static NSString); + +extern_static!(NSPersonNameComponentDelimiter: &'static NSString); diff --git a/crates/icrate/src/generated/Foundation/NSPointerArray.rs b/crates/icrate/src/generated/Foundation/NSPointerArray.rs new file mode 100644 index 000000000..a288a0b83 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSPointerArray.rs @@ -0,0 +1,90 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPointerArray; + + unsafe impl ClassType for NSPointerArray { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPointerArray { + #[method_id(@__retain_semantics Init initWithOptions:)] + pub unsafe fn initWithOptions( + this: Option>, + options: NSPointerFunctionsOptions, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithPointerFunctions:)] + pub unsafe fn initWithPointerFunctions( + this: Option>, + functions: &NSPointerFunctions, + ) -> Id; + + #[method_id(@__retain_semantics Other pointerArrayWithOptions:)] + pub unsafe fn pointerArrayWithOptions( + options: NSPointerFunctionsOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other pointerArrayWithPointerFunctions:)] + pub unsafe fn pointerArrayWithPointerFunctions( + functions: &NSPointerFunctions, + ) -> Id; + + #[method_id(@__retain_semantics Other pointerFunctions)] + pub unsafe fn pointerFunctions(&self) -> Id; + + #[method(pointerAtIndex:)] + pub unsafe fn pointerAtIndex(&self, index: NSUInteger) -> *mut c_void; + + #[method(addPointer:)] + pub unsafe fn addPointer(&self, pointer: *mut c_void); + + #[method(removePointerAtIndex:)] + pub unsafe fn removePointerAtIndex(&self, index: NSUInteger); + + #[method(insertPointer:atIndex:)] + pub unsafe fn insertPointer_atIndex(&self, item: *mut c_void, index: NSUInteger); + + #[method(replacePointerAtIndex:withPointer:)] + pub unsafe fn replacePointerAtIndex_withPointer( + &self, + index: NSUInteger, + item: *mut c_void, + ); + + #[method(compact)] + pub unsafe fn compact(&self); + + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + + #[method(setCount:)] + pub unsafe fn setCount(&self, count: NSUInteger); + } +); + +extern_methods!( + /// NSPointerArrayConveniences + unsafe impl NSPointerArray { + #[method_id(@__retain_semantics Other pointerArrayWithStrongObjects)] + pub unsafe fn pointerArrayWithStrongObjects() -> Id; + + #[method_id(@__retain_semantics Other pointerArrayWithWeakObjects)] + pub unsafe fn pointerArrayWithWeakObjects() -> Id; + + #[method_id(@__retain_semantics Other strongObjectsPointerArray)] + pub unsafe fn strongObjectsPointerArray() -> Id; + + #[method_id(@__retain_semantics Other weakObjectsPointerArray)] + pub unsafe fn weakObjectsPointerArray() -> Id; + + #[method_id(@__retain_semantics Other allObjects)] + pub unsafe fn allObjects(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSPointerFunctions.rs b/crates/icrate/src/generated/Foundation/NSPointerFunctions.rs new file mode 100644 index 000000000..7d675f0c2 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSPointerFunctions.rs @@ -0,0 +1,169 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSPointerFunctionsOptions { + NSPointerFunctionsStrongMemory = 0 << 0, + NSPointerFunctionsZeroingWeakMemory = 1 << 0, + NSPointerFunctionsOpaqueMemory = 2 << 0, + NSPointerFunctionsMallocMemory = 3 << 0, + NSPointerFunctionsMachVirtualMemory = 4 << 0, + NSPointerFunctionsWeakMemory = 5 << 0, + NSPointerFunctionsObjectPersonality = 0 << 8, + NSPointerFunctionsOpaquePersonality = 1 << 8, + NSPointerFunctionsObjectPointerPersonality = 2 << 8, + NSPointerFunctionsCStringPersonality = 3 << 8, + NSPointerFunctionsStructPersonality = 4 << 8, + NSPointerFunctionsIntegerPersonality = 5 << 8, + NSPointerFunctionsCopyIn = 1 << 16, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPointerFunctions; + + unsafe impl ClassType for NSPointerFunctions { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPointerFunctions { + #[method_id(@__retain_semantics Init initWithOptions:)] + pub unsafe fn initWithOptions( + this: Option>, + options: NSPointerFunctionsOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other pointerFunctionsWithOptions:)] + pub unsafe fn pointerFunctionsWithOptions( + options: NSPointerFunctionsOptions, + ) -> Id; + + #[method(hashFunction)] + pub unsafe fn hashFunction( + &self, + ) -> Option< + unsafe extern "C" fn( + NonNull, + Option) -> NSUInteger>, + ) -> NSUInteger, + >; + + #[method(setHashFunction:)] + pub unsafe fn setHashFunction( + &self, + hashFunction: Option< + unsafe extern "C" fn( + NonNull, + Option) -> NSUInteger>, + ) -> NSUInteger, + >, + ); + + #[method(isEqualFunction)] + pub unsafe fn isEqualFunction( + &self, + ) -> Option< + unsafe extern "C" fn( + NonNull, + NonNull, + Option) -> NSUInteger>, + ) -> Bool, + >; + + #[method(setIsEqualFunction:)] + pub unsafe fn setIsEqualFunction( + &self, + isEqualFunction: Option< + unsafe extern "C" fn( + NonNull, + NonNull, + Option) -> NSUInteger>, + ) -> Bool, + >, + ); + + #[method(sizeFunction)] + pub unsafe fn sizeFunction( + &self, + ) -> Option) -> NSUInteger>; + + #[method(setSizeFunction:)] + pub unsafe fn setSizeFunction( + &self, + sizeFunction: Option) -> NSUInteger>, + ); + + #[method(descriptionFunction)] + pub unsafe fn descriptionFunction( + &self, + ) -> Option) -> *mut NSString>; + + #[method(setDescriptionFunction:)] + pub unsafe fn setDescriptionFunction( + &self, + descriptionFunction: Option) -> *mut NSString>, + ); + + #[method(relinquishFunction)] + pub unsafe fn relinquishFunction( + &self, + ) -> Option< + unsafe extern "C" fn( + NonNull, + Option) -> NSUInteger>, + ), + >; + + #[method(setRelinquishFunction:)] + pub unsafe fn setRelinquishFunction( + &self, + relinquishFunction: Option< + unsafe extern "C" fn( + NonNull, + Option) -> NSUInteger>, + ), + >, + ); + + #[method(acquireFunction)] + pub unsafe fn acquireFunction( + &self, + ) -> Option< + unsafe extern "C" fn( + NonNull, + Option) -> NSUInteger>, + Bool, + ) -> NonNull, + >; + + #[method(setAcquireFunction:)] + pub unsafe fn setAcquireFunction( + &self, + acquireFunction: Option< + unsafe extern "C" fn( + NonNull, + Option) -> NSUInteger>, + Bool, + ) -> NonNull, + >, + ); + + #[method(usesStrongWriteBarrier)] + pub unsafe fn usesStrongWriteBarrier(&self) -> bool; + + #[method(setUsesStrongWriteBarrier:)] + pub unsafe fn setUsesStrongWriteBarrier(&self, usesStrongWriteBarrier: bool); + + #[method(usesWeakReadAndWriteBarriers)] + pub unsafe fn usesWeakReadAndWriteBarriers(&self) -> bool; + + #[method(setUsesWeakReadAndWriteBarriers:)] + pub unsafe fn setUsesWeakReadAndWriteBarriers(&self, usesWeakReadAndWriteBarriers: bool); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSPort.rs b/crates/icrate/src/generated/Foundation/NSPort.rs new file mode 100644 index 000000000..6fbe45a52 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSPort.rs @@ -0,0 +1,243 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSSocketNativeHandle = c_int; + +extern_static!(NSPortDidBecomeInvalidNotification: &'static NSNotificationName); + +extern_class!( + #[derive(Debug)] + pub struct NSPort; + + unsafe impl ClassType for NSPort { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPort { + #[method_id(@__retain_semantics Other port)] + pub unsafe fn port() -> Id; + + #[method(invalidate)] + pub unsafe fn invalidate(&self); + + #[method(isValid)] + pub unsafe fn isValid(&self) -> bool; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, anObject: Option<&NSPortDelegate>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(scheduleInRunLoop:forMode:)] + pub unsafe fn scheduleInRunLoop_forMode(&self, runLoop: &NSRunLoop, mode: &NSRunLoopMode); + + #[method(removeFromRunLoop:forMode:)] + pub unsafe fn removeFromRunLoop_forMode(&self, runLoop: &NSRunLoop, mode: &NSRunLoopMode); + + #[method(reservedSpaceLength)] + pub unsafe fn reservedSpaceLength(&self) -> NSUInteger; + + #[method(sendBeforeDate:components:from:reserved:)] + pub unsafe fn sendBeforeDate_components_from_reserved( + &self, + limitDate: &NSDate, + components: Option<&NSMutableArray>, + receivePort: Option<&NSPort>, + headerSpaceReserved: NSUInteger, + ) -> bool; + + #[method(sendBeforeDate:msgid:components:from:reserved:)] + pub unsafe fn sendBeforeDate_msgid_components_from_reserved( + &self, + limitDate: &NSDate, + msgID: NSUInteger, + components: Option<&NSMutableArray>, + receivePort: Option<&NSPort>, + headerSpaceReserved: NSUInteger, + ) -> bool; + + #[method(addConnection:toRunLoop:forMode:)] + pub unsafe fn addConnection_toRunLoop_forMode( + &self, + conn: &NSConnection, + runLoop: &NSRunLoop, + mode: &NSRunLoopMode, + ); + + #[method(removeConnection:fromRunLoop:forMode:)] + pub unsafe fn removeConnection_fromRunLoop_forMode( + &self, + conn: &NSConnection, + runLoop: &NSRunLoop, + mode: &NSRunLoopMode, + ); + } +); + +extern_protocol!( + pub struct NSPortDelegate; + + unsafe impl NSPortDelegate { + #[optional] + #[method(handlePortMessage:)] + pub unsafe fn handlePortMessage(&self, message: &NSPortMessage); + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSMachPortOptions { + NSMachPortDeallocateNone = 0, + NSMachPortDeallocateSendRight = 1 << 0, + NSMachPortDeallocateReceiveRight = 1 << 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMachPort; + + unsafe impl ClassType for NSMachPort { + type Super = NSPort; + } +); + +extern_methods!( + unsafe impl NSMachPort { + #[method_id(@__retain_semantics Other portWithMachPort:)] + pub unsafe fn portWithMachPort(machPort: u32) -> Id; + + #[method_id(@__retain_semantics Init initWithMachPort:)] + pub unsafe fn initWithMachPort( + this: Option>, + machPort: u32, + ) -> Id; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, anObject: Option<&NSMachPortDelegate>); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method_id(@__retain_semantics Other portWithMachPort:options:)] + pub unsafe fn portWithMachPort_options( + machPort: u32, + f: NSMachPortOptions, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithMachPort:options:)] + pub unsafe fn initWithMachPort_options( + this: Option>, + machPort: u32, + f: NSMachPortOptions, + ) -> Id; + + #[method(machPort)] + pub unsafe fn machPort(&self) -> u32; + + #[method(scheduleInRunLoop:forMode:)] + pub unsafe fn scheduleInRunLoop_forMode(&self, runLoop: &NSRunLoop, mode: &NSRunLoopMode); + + #[method(removeFromRunLoop:forMode:)] + pub unsafe fn removeFromRunLoop_forMode(&self, runLoop: &NSRunLoop, mode: &NSRunLoopMode); + } +); + +extern_protocol!( + pub struct NSMachPortDelegate; + + unsafe impl NSMachPortDelegate { + #[optional] + #[method(handleMachMessage:)] + pub unsafe fn handleMachMessage(&self, msg: NonNull); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMessagePort; + + unsafe impl ClassType for NSMessagePort { + type Super = NSPort; + } +); + +extern_methods!( + unsafe impl NSMessagePort {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSSocketPort; + + unsafe impl ClassType for NSSocketPort { + type Super = NSPort; + } +); + +extern_methods!( + unsafe impl NSSocketPort { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithTCPPort:)] + pub unsafe fn initWithTCPPort( + this: Option>, + port: c_ushort, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithProtocolFamily:socketType:protocol:address:)] + pub unsafe fn initWithProtocolFamily_socketType_protocol_address( + this: Option>, + family: c_int, + type_: c_int, + protocol: c_int, + address: &NSData, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithProtocolFamily:socketType:protocol:socket:)] + pub unsafe fn initWithProtocolFamily_socketType_protocol_socket( + this: Option>, + family: c_int, + type_: c_int, + protocol: c_int, + sock: NSSocketNativeHandle, + ) -> Option>; + + #[method_id(@__retain_semantics Init initRemoteWithTCPPort:host:)] + pub unsafe fn initRemoteWithTCPPort_host( + this: Option>, + port: c_ushort, + hostName: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Init initRemoteWithProtocolFamily:socketType:protocol:address:)] + pub unsafe fn initRemoteWithProtocolFamily_socketType_protocol_address( + this: Option>, + family: c_int, + type_: c_int, + protocol: c_int, + address: &NSData, + ) -> Id; + + #[method(protocolFamily)] + pub unsafe fn protocolFamily(&self) -> c_int; + + #[method(socketType)] + pub unsafe fn socketType(&self) -> c_int; + + #[method(protocol)] + pub unsafe fn protocol(&self) -> c_int; + + #[method_id(@__retain_semantics Other address)] + pub unsafe fn address(&self) -> Id; + + #[method(socket)] + pub unsafe fn socket(&self) -> NSSocketNativeHandle; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSPortCoder.rs b/crates/icrate/src/generated/Foundation/NSPortCoder.rs new file mode 100644 index 000000000..0626405c7 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSPortCoder.rs @@ -0,0 +1,64 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPortCoder; + + unsafe impl ClassType for NSPortCoder { + type Super = NSCoder; + } +); + +extern_methods!( + unsafe impl NSPortCoder { + #[method(isBycopy)] + pub unsafe fn isBycopy(&self) -> bool; + + #[method(isByref)] + pub unsafe fn isByref(&self) -> bool; + + #[method(encodePortObject:)] + pub unsafe fn encodePortObject(&self, aport: &NSPort); + + #[method_id(@__retain_semantics Other decodePortObject)] + pub unsafe fn decodePortObject(&self) -> Option>; + + #[method_id(@__retain_semantics Other connection)] + pub unsafe fn connection(&self) -> Option>; + + #[method_id(@__retain_semantics Other portCoderWithReceivePort:sendPort:components:)] + pub unsafe fn portCoderWithReceivePort_sendPort_components( + rcvPort: Option<&NSPort>, + sndPort: Option<&NSPort>, + comps: Option<&NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithReceivePort:sendPort:components:)] + pub unsafe fn initWithReceivePort_sendPort_components( + this: Option>, + rcvPort: Option<&NSPort>, + sndPort: Option<&NSPort>, + comps: Option<&NSArray>, + ) -> Id; + + #[method(dispatch)] + pub unsafe fn dispatch(&self); + } +); + +extern_methods!( + /// NSDistributedObjects + unsafe impl NSObject { + #[method(classForPortCoder)] + pub unsafe fn classForPortCoder(&self) -> &'static Class; + + #[method_id(@__retain_semantics Other replacementObjectForPortCoder:)] + pub unsafe fn replacementObjectForPortCoder( + &self, + coder: &NSPortCoder, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSPortMessage.rs b/crates/icrate/src/generated/Foundation/NSPortMessage.rs new file mode 100644 index 000000000..f9e9ca91e --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSPortMessage.rs @@ -0,0 +1,43 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPortMessage; + + unsafe impl ClassType for NSPortMessage { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPortMessage { + #[method_id(@__retain_semantics Init initWithSendPort:receivePort:components:)] + pub unsafe fn initWithSendPort_receivePort_components( + this: Option>, + sendPort: Option<&NSPort>, + replyPort: Option<&NSPort>, + components: Option<&NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Other components)] + pub unsafe fn components(&self) -> Option>; + + #[method_id(@__retain_semantics Other receivePort)] + pub unsafe fn receivePort(&self) -> Option>; + + #[method_id(@__retain_semantics Other sendPort)] + pub unsafe fn sendPort(&self) -> Option>; + + #[method(sendBeforeDate:)] + pub unsafe fn sendBeforeDate(&self, date: &NSDate) -> bool; + + #[method(msgid)] + pub unsafe fn msgid(&self) -> u32; + + #[method(setMsgid:)] + pub unsafe fn setMsgid(&self, msgid: u32); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSPortNameServer.rs b/crates/icrate/src/generated/Foundation/NSPortNameServer.rs new file mode 100644 index 000000000..38e643eb8 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSPortNameServer.rs @@ -0,0 +1,148 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPortNameServer; + + unsafe impl ClassType for NSPortNameServer { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPortNameServer { + #[method_id(@__retain_semantics Other systemDefaultPortNameServer)] + pub unsafe fn systemDefaultPortNameServer() -> Id; + + #[method_id(@__retain_semantics Other portForName:)] + pub unsafe fn portForName(&self, name: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other portForName:host:)] + pub unsafe fn portForName_host( + &self, + name: &NSString, + host: Option<&NSString>, + ) -> Option>; + + #[method(registerPort:name:)] + pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool; + + #[method(removePortForName:)] + pub unsafe fn removePortForName(&self, name: &NSString) -> bool; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMachBootstrapServer; + + unsafe impl ClassType for NSMachBootstrapServer { + type Super = NSPortNameServer; + } +); + +extern_methods!( + unsafe impl NSMachBootstrapServer { + #[method_id(@__retain_semantics Other sharedInstance)] + pub unsafe fn sharedInstance() -> Id; + + #[method_id(@__retain_semantics Other portForName:)] + pub unsafe fn portForName(&self, name: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other portForName:host:)] + pub unsafe fn portForName_host( + &self, + name: &NSString, + host: Option<&NSString>, + ) -> Option>; + + #[method(registerPort:name:)] + pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool; + + #[method_id(@__retain_semantics Other servicePortWithName:)] + pub unsafe fn servicePortWithName(&self, name: &NSString) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMessagePortNameServer; + + unsafe impl ClassType for NSMessagePortNameServer { + type Super = NSPortNameServer; + } +); + +extern_methods!( + unsafe impl NSMessagePortNameServer { + #[method_id(@__retain_semantics Other sharedInstance)] + pub unsafe fn sharedInstance() -> Id; + + #[method_id(@__retain_semantics Other portForName:)] + pub unsafe fn portForName(&self, name: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other portForName:host:)] + pub unsafe fn portForName_host( + &self, + name: &NSString, + host: Option<&NSString>, + ) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSSocketPortNameServer; + + unsafe impl ClassType for NSSocketPortNameServer { + type Super = NSPortNameServer; + } +); + +extern_methods!( + unsafe impl NSSocketPortNameServer { + #[method_id(@__retain_semantics Other sharedInstance)] + pub unsafe fn sharedInstance() -> Id; + + #[method_id(@__retain_semantics Other portForName:)] + pub unsafe fn portForName(&self, name: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other portForName:host:)] + pub unsafe fn portForName_host( + &self, + name: &NSString, + host: Option<&NSString>, + ) -> Option>; + + #[method(registerPort:name:)] + pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool; + + #[method(removePortForName:)] + pub unsafe fn removePortForName(&self, name: &NSString) -> bool; + + #[method_id(@__retain_semantics Other portForName:host:nameServerPortNumber:)] + pub unsafe fn portForName_host_nameServerPortNumber( + &self, + name: &NSString, + host: Option<&NSString>, + portNumber: u16, + ) -> Option>; + + #[method(registerPort:name:nameServerPortNumber:)] + pub unsafe fn registerPort_name_nameServerPortNumber( + &self, + port: &NSPort, + name: &NSString, + portNumber: u16, + ) -> bool; + + #[method(defaultNameServerPortNumber)] + pub unsafe fn defaultNameServerPortNumber(&self) -> u16; + + #[method(setDefaultNameServerPortNumber:)] + pub unsafe fn setDefaultNameServerPortNumber(&self, defaultNameServerPortNumber: u16); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSPredicate.rs b/crates/icrate/src/generated/Foundation/NSPredicate.rs new file mode 100644 index 000000000..7e9cccf79 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSPredicate.rs @@ -0,0 +1,115 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSPredicate; + + unsafe impl ClassType for NSPredicate { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPredicate { + #[method_id(@__retain_semantics Other predicateWithFormat:argumentArray:)] + pub unsafe fn predicateWithFormat_argumentArray( + predicateFormat: &NSString, + arguments: Option<&NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Other predicateFromMetadataQueryString:)] + pub unsafe fn predicateFromMetadataQueryString( + queryString: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other predicateWithValue:)] + pub unsafe fn predicateWithValue(value: bool) -> Id; + + #[method_id(@__retain_semantics Other predicateWithBlock:)] + pub unsafe fn predicateWithBlock( + block: &Block<(*mut Object, *mut NSDictionary), Bool>, + ) -> Id; + + #[method_id(@__retain_semantics Other predicateFormat)] + pub unsafe fn predicateFormat(&self) -> Id; + + #[method_id(@__retain_semantics Other predicateWithSubstitutionVariables:)] + pub unsafe fn predicateWithSubstitutionVariables( + &self, + variables: &NSDictionary, + ) -> Id; + + #[method(evaluateWithObject:)] + pub unsafe fn evaluateWithObject(&self, object: Option<&Object>) -> bool; + + #[method(evaluateWithObject:substitutionVariables:)] + pub unsafe fn evaluateWithObject_substitutionVariables( + &self, + object: Option<&Object>, + bindings: Option<&NSDictionary>, + ) -> bool; + + #[method(allowEvaluation)] + pub unsafe fn allowEvaluation(&self); + } +); + +extern_methods!( + /// NSPredicateSupport + unsafe impl NSArray { + #[method_id(@__retain_semantics Other filteredArrayUsingPredicate:)] + pub unsafe fn filteredArrayUsingPredicate( + &self, + predicate: &NSPredicate, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSPredicateSupport + unsafe impl NSMutableArray { + #[method(filterUsingPredicate:)] + pub unsafe fn filterUsingPredicate(&self, predicate: &NSPredicate); + } +); + +extern_methods!( + /// NSPredicateSupport + unsafe impl NSSet { + #[method_id(@__retain_semantics Other filteredSetUsingPredicate:)] + pub unsafe fn filteredSetUsingPredicate( + &self, + predicate: &NSPredicate, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSPredicateSupport + unsafe impl NSMutableSet { + #[method(filterUsingPredicate:)] + pub unsafe fn filterUsingPredicate(&self, predicate: &NSPredicate); + } +); + +extern_methods!( + /// NSPredicateSupport + unsafe impl NSOrderedSet { + #[method_id(@__retain_semantics Other filteredOrderedSetUsingPredicate:)] + pub unsafe fn filteredOrderedSetUsingPredicate( + &self, + p: &NSPredicate, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSPredicateSupport + unsafe impl NSMutableOrderedSet { + #[method(filterUsingPredicate:)] + pub unsafe fn filterUsingPredicate(&self, p: &NSPredicate); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSProcessInfo.rs b/crates/icrate/src/generated/Foundation/NSProcessInfo.rs new file mode 100644 index 000000000..287036b7a --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSProcessInfo.rs @@ -0,0 +1,210 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_enum!( + #[underlying(c_uint)] + pub enum { + NSWindowsNTOperatingSystem = 1, + NSWindows95OperatingSystem = 2, + NSSolarisOperatingSystem = 3, + NSHPUXOperatingSystem = 4, + NSMACHOperatingSystem = 5, + NSSunOSOperatingSystem = 6, + NSOSF1OperatingSystem = 7, + } +); + +extern_struct!( + pub struct NSOperatingSystemVersion { + pub majorVersion: NSInteger, + pub minorVersion: NSInteger, + pub patchVersion: NSInteger, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSProcessInfo; + + unsafe impl ClassType for NSProcessInfo { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSProcessInfo { + #[method_id(@__retain_semantics Other processInfo)] + pub unsafe fn processInfo() -> Id; + + #[method_id(@__retain_semantics Other environment)] + pub unsafe fn environment(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other arguments)] + pub unsafe fn arguments(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other hostName)] + pub unsafe fn hostName(&self) -> Id; + + #[method_id(@__retain_semantics Other processName)] + pub unsafe fn processName(&self) -> Id; + + #[method(setProcessName:)] + pub unsafe fn setProcessName(&self, processName: &NSString); + + #[method(processIdentifier)] + pub unsafe fn processIdentifier(&self) -> c_int; + + #[method_id(@__retain_semantics Other globallyUniqueString)] + pub unsafe fn globallyUniqueString(&self) -> Id; + + #[method(operatingSystem)] + pub unsafe fn operatingSystem(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other operatingSystemName)] + pub unsafe fn operatingSystemName(&self) -> Id; + + #[method_id(@__retain_semantics Other operatingSystemVersionString)] + pub unsafe fn operatingSystemVersionString(&self) -> Id; + + #[method(operatingSystemVersion)] + pub unsafe fn operatingSystemVersion(&self) -> NSOperatingSystemVersion; + + #[method(processorCount)] + pub unsafe fn processorCount(&self) -> NSUInteger; + + #[method(activeProcessorCount)] + pub unsafe fn activeProcessorCount(&self) -> NSUInteger; + + #[method(physicalMemory)] + pub unsafe fn physicalMemory(&self) -> c_ulonglong; + + #[method(isOperatingSystemAtLeastVersion:)] + pub unsafe fn isOperatingSystemAtLeastVersion( + &self, + version: NSOperatingSystemVersion, + ) -> bool; + + #[method(systemUptime)] + pub unsafe fn systemUptime(&self) -> NSTimeInterval; + + #[method(disableSuddenTermination)] + pub unsafe fn disableSuddenTermination(&self); + + #[method(enableSuddenTermination)] + pub unsafe fn enableSuddenTermination(&self); + + #[method(disableAutomaticTermination:)] + pub unsafe fn disableAutomaticTermination(&self, reason: &NSString); + + #[method(enableAutomaticTermination:)] + pub unsafe fn enableAutomaticTermination(&self, reason: &NSString); + + #[method(automaticTerminationSupportEnabled)] + pub unsafe fn automaticTerminationSupportEnabled(&self) -> bool; + + #[method(setAutomaticTerminationSupportEnabled:)] + pub unsafe fn setAutomaticTerminationSupportEnabled( + &self, + automaticTerminationSupportEnabled: bool, + ); + } +); + +ns_options!( + #[underlying(u64)] + pub enum NSActivityOptions { + NSActivityIdleDisplaySleepDisabled = 1 << 40, + NSActivityIdleSystemSleepDisabled = 1 << 20, + NSActivitySuddenTerminationDisabled = 1 << 14, + NSActivityAutomaticTerminationDisabled = 1 << 15, + NSActivityUserInitiated = 0x00FFFFFF | NSActivityIdleSystemSleepDisabled, + NSActivityUserInitiatedAllowingIdleSystemSleep = + NSActivityUserInitiated & !NSActivityIdleSystemSleepDisabled, + NSActivityBackground = 0x000000FF, + NSActivityLatencyCritical = 0xFF00000000, + } +); + +extern_methods!( + /// NSProcessInfoActivity + unsafe impl NSProcessInfo { + #[method_id(@__retain_semantics Other beginActivityWithOptions:reason:)] + pub unsafe fn beginActivityWithOptions_reason( + &self, + options: NSActivityOptions, + reason: &NSString, + ) -> Id; + + #[method(endActivity:)] + pub unsafe fn endActivity(&self, activity: &NSObject); + + #[method(performActivityWithOptions:reason:usingBlock:)] + pub unsafe fn performActivityWithOptions_reason_usingBlock( + &self, + options: NSActivityOptions, + reason: &NSString, + block: &Block<(), ()>, + ); + + #[method(performExpiringActivityWithReason:usingBlock:)] + pub unsafe fn performExpiringActivityWithReason_usingBlock( + &self, + reason: &NSString, + block: &Block<(Bool,), ()>, + ); + } +); + +extern_methods!( + /// NSUserInformation + unsafe impl NSProcessInfo { + #[method_id(@__retain_semantics Other userName)] + pub unsafe fn userName(&self) -> Id; + + #[method_id(@__retain_semantics Other fullUserName)] + pub unsafe fn fullUserName(&self) -> Id; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSProcessInfoThermalState { + NSProcessInfoThermalStateNominal = 0, + NSProcessInfoThermalStateFair = 1, + NSProcessInfoThermalStateSerious = 2, + NSProcessInfoThermalStateCritical = 3, + } +); + +extern_methods!( + /// NSProcessInfoThermalState + unsafe impl NSProcessInfo { + #[method(thermalState)] + pub unsafe fn thermalState(&self) -> NSProcessInfoThermalState; + } +); + +extern_methods!( + /// NSProcessInfoPowerState + unsafe impl NSProcessInfo { + #[method(isLowPowerModeEnabled)] + pub unsafe fn isLowPowerModeEnabled(&self) -> bool; + } +); + +extern_static!(NSProcessInfoThermalStateDidChangeNotification: &'static NSNotificationName); + +extern_static!(NSProcessInfoPowerStateDidChangeNotification: &'static NSNotificationName); + +extern_methods!( + /// NSProcessInfoPlatform + unsafe impl NSProcessInfo { + #[method(isMacCatalystApp)] + pub unsafe fn isMacCatalystApp(&self) -> bool; + + #[method(isiOSAppOnMac)] + pub unsafe fn isiOSAppOnMac(&self) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSProgress.rs b/crates/icrate/src/generated/Foundation/NSProgress.rs new file mode 100644 index 000000000..6fe8835f9 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSProgress.rs @@ -0,0 +1,264 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSProgressKind = NSString; + +pub type NSProgressUserInfoKey = NSString; + +pub type NSProgressFileOperationKind = NSString; + +pub type NSProgressUnpublishingHandler = *mut Block<(), ()>; + +pub type NSProgressPublishingHandler = + *mut Block<(NonNull,), NSProgressUnpublishingHandler>; + +extern_class!( + #[derive(Debug)] + pub struct NSProgress; + + unsafe impl ClassType for NSProgress { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSProgress { + #[method_id(@__retain_semantics Other currentProgress)] + pub unsafe fn currentProgress() -> Option>; + + #[method_id(@__retain_semantics Other progressWithTotalUnitCount:)] + pub unsafe fn progressWithTotalUnitCount(unitCount: i64) -> Id; + + #[method_id(@__retain_semantics Other discreteProgressWithTotalUnitCount:)] + pub unsafe fn discreteProgressWithTotalUnitCount(unitCount: i64) -> Id; + + #[method_id(@__retain_semantics Other progressWithTotalUnitCount:parent:pendingUnitCount:)] + pub unsafe fn progressWithTotalUnitCount_parent_pendingUnitCount( + unitCount: i64, + parent: &NSProgress, + portionOfParentTotalUnitCount: i64, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithParent:userInfo:)] + pub unsafe fn initWithParent_userInfo( + this: Option>, + parentProgressOrNil: Option<&NSProgress>, + userInfoOrNil: Option<&NSDictionary>, + ) -> Id; + + #[method(becomeCurrentWithPendingUnitCount:)] + pub unsafe fn becomeCurrentWithPendingUnitCount(&self, unitCount: i64); + + #[method(performAsCurrentWithPendingUnitCount:usingBlock:)] + pub unsafe fn performAsCurrentWithPendingUnitCount_usingBlock( + &self, + unitCount: i64, + work: &Block<(), ()>, + ); + + #[method(resignCurrent)] + pub unsafe fn resignCurrent(&self); + + #[method(addChild:withPendingUnitCount:)] + pub unsafe fn addChild_withPendingUnitCount(&self, child: &NSProgress, inUnitCount: i64); + + #[method(totalUnitCount)] + pub unsafe fn totalUnitCount(&self) -> i64; + + #[method(setTotalUnitCount:)] + pub unsafe fn setTotalUnitCount(&self, totalUnitCount: i64); + + #[method(completedUnitCount)] + pub unsafe fn completedUnitCount(&self) -> i64; + + #[method(setCompletedUnitCount:)] + pub unsafe fn setCompletedUnitCount(&self, completedUnitCount: i64); + + #[method_id(@__retain_semantics Other localizedDescription)] + pub unsafe fn localizedDescription(&self) -> Id; + + #[method(setLocalizedDescription:)] + pub unsafe fn setLocalizedDescription(&self, localizedDescription: Option<&NSString>); + + #[method_id(@__retain_semantics Other localizedAdditionalDescription)] + pub unsafe fn localizedAdditionalDescription(&self) -> Id; + + #[method(setLocalizedAdditionalDescription:)] + pub unsafe fn setLocalizedAdditionalDescription( + &self, + localizedAdditionalDescription: Option<&NSString>, + ); + + #[method(isCancellable)] + pub unsafe fn isCancellable(&self) -> bool; + + #[method(setCancellable:)] + pub unsafe fn setCancellable(&self, cancellable: bool); + + #[method(isPausable)] + pub unsafe fn isPausable(&self) -> bool; + + #[method(setPausable:)] + pub unsafe fn setPausable(&self, pausable: bool); + + #[method(isCancelled)] + pub unsafe fn isCancelled(&self) -> bool; + + #[method(isPaused)] + pub unsafe fn isPaused(&self) -> bool; + + #[method(cancellationHandler)] + pub unsafe fn cancellationHandler(&self) -> *mut Block<(), ()>; + + #[method(setCancellationHandler:)] + pub unsafe fn setCancellationHandler(&self, cancellationHandler: Option<&Block<(), ()>>); + + #[method(pausingHandler)] + pub unsafe fn pausingHandler(&self) -> *mut Block<(), ()>; + + #[method(setPausingHandler:)] + pub unsafe fn setPausingHandler(&self, pausingHandler: Option<&Block<(), ()>>); + + #[method(resumingHandler)] + pub unsafe fn resumingHandler(&self) -> *mut Block<(), ()>; + + #[method(setResumingHandler:)] + pub unsafe fn setResumingHandler(&self, resumingHandler: Option<&Block<(), ()>>); + + #[method(setUserInfoObject:forKey:)] + pub unsafe fn setUserInfoObject_forKey( + &self, + objectOrNil: Option<&Object>, + key: &NSProgressUserInfoKey, + ); + + #[method(isIndeterminate)] + pub unsafe fn isIndeterminate(&self) -> bool; + + #[method(fractionCompleted)] + pub unsafe fn fractionCompleted(&self) -> c_double; + + #[method(isFinished)] + pub unsafe fn isFinished(&self) -> bool; + + #[method(cancel)] + pub unsafe fn cancel(&self); + + #[method(pause)] + pub unsafe fn pause(&self); + + #[method(resume)] + pub unsafe fn resume(&self); + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other kind)] + pub unsafe fn kind(&self) -> Option>; + + #[method(setKind:)] + pub unsafe fn setKind(&self, kind: Option<&NSProgressKind>); + + #[method_id(@__retain_semantics Other estimatedTimeRemaining)] + pub unsafe fn estimatedTimeRemaining(&self) -> Option>; + + #[method(setEstimatedTimeRemaining:)] + pub unsafe fn setEstimatedTimeRemaining(&self, estimatedTimeRemaining: Option<&NSNumber>); + + #[method_id(@__retain_semantics Other throughput)] + pub unsafe fn throughput(&self) -> Option>; + + #[method(setThroughput:)] + pub unsafe fn setThroughput(&self, throughput: Option<&NSNumber>); + + #[method_id(@__retain_semantics Other fileOperationKind)] + pub unsafe fn fileOperationKind(&self) -> Option>; + + #[method(setFileOperationKind:)] + pub unsafe fn setFileOperationKind( + &self, + fileOperationKind: Option<&NSProgressFileOperationKind>, + ); + + #[method_id(@__retain_semantics Other fileURL)] + pub unsafe fn fileURL(&self) -> Option>; + + #[method(setFileURL:)] + pub unsafe fn setFileURL(&self, fileURL: Option<&NSURL>); + + #[method_id(@__retain_semantics Other fileTotalCount)] + pub unsafe fn fileTotalCount(&self) -> Option>; + + #[method(setFileTotalCount:)] + pub unsafe fn setFileTotalCount(&self, fileTotalCount: Option<&NSNumber>); + + #[method_id(@__retain_semantics Other fileCompletedCount)] + pub unsafe fn fileCompletedCount(&self) -> Option>; + + #[method(setFileCompletedCount:)] + pub unsafe fn setFileCompletedCount(&self, fileCompletedCount: Option<&NSNumber>); + + #[method(publish)] + pub unsafe fn publish(&self); + + #[method(unpublish)] + pub unsafe fn unpublish(&self); + + #[method_id(@__retain_semantics Other addSubscriberForFileURL:withPublishingHandler:)] + pub unsafe fn addSubscriberForFileURL_withPublishingHandler( + url: &NSURL, + publishingHandler: NSProgressPublishingHandler, + ) -> Id; + + #[method(removeSubscriber:)] + pub unsafe fn removeSubscriber(subscriber: &Object); + + #[method(isOld)] + pub unsafe fn isOld(&self) -> bool; + } +); + +extern_protocol!( + pub struct NSProgressReporting; + + unsafe impl NSProgressReporting { + #[method_id(@__retain_semantics Other progress)] + pub unsafe fn progress(&self) -> Id; + } +); + +extern_static!(NSProgressEstimatedTimeRemainingKey: &'static NSProgressUserInfoKey); + +extern_static!(NSProgressThroughputKey: &'static NSProgressUserInfoKey); + +extern_static!(NSProgressKindFile: &'static NSProgressKind); + +extern_static!(NSProgressFileOperationKindKey: &'static NSProgressUserInfoKey); + +extern_static!(NSProgressFileOperationKindDownloading: &'static NSProgressFileOperationKind); + +extern_static!( + NSProgressFileOperationKindDecompressingAfterDownloading: &'static NSProgressFileOperationKind +); + +extern_static!(NSProgressFileOperationKindReceiving: &'static NSProgressFileOperationKind); + +extern_static!(NSProgressFileOperationKindCopying: &'static NSProgressFileOperationKind); + +extern_static!(NSProgressFileOperationKindUploading: &'static NSProgressFileOperationKind); + +extern_static!(NSProgressFileOperationKindDuplicating: &'static NSProgressFileOperationKind); + +extern_static!(NSProgressFileURLKey: &'static NSProgressUserInfoKey); + +extern_static!(NSProgressFileTotalCountKey: &'static NSProgressUserInfoKey); + +extern_static!(NSProgressFileCompletedCountKey: &'static NSProgressUserInfoKey); + +extern_static!(NSProgressFileAnimationImageKey: &'static NSProgressUserInfoKey); + +extern_static!(NSProgressFileAnimationImageOriginalRectKey: &'static NSProgressUserInfoKey); + +extern_static!(NSProgressFileIconKey: &'static NSProgressUserInfoKey); diff --git a/crates/icrate/src/generated/Foundation/NSPropertyList.rs b/crates/icrate/src/generated/Foundation/NSPropertyList.rs new file mode 100644 index 000000000..3970b29c4 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSPropertyList.rs @@ -0,0 +1,66 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSPropertyListMutabilityOptions { + NSPropertyListImmutable = 0, + NSPropertyListMutableContainers = 1, + NSPropertyListMutableContainersAndLeaves = 2, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSPropertyListFormat { + NSPropertyListOpenStepFormat = 1, + NSPropertyListXMLFormat_v1_0 = 100, + NSPropertyListBinaryFormat_v1_0 = 200, + } +); + +pub type NSPropertyListReadOptions = NSPropertyListMutabilityOptions; + +pub type NSPropertyListWriteOptions = NSUInteger; + +extern_class!( + #[derive(Debug)] + pub struct NSPropertyListSerialization; + + unsafe impl ClassType for NSPropertyListSerialization { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPropertyListSerialization { + #[method(propertyList:isValidForFormat:)] + pub unsafe fn propertyList_isValidForFormat( + plist: &Object, + format: NSPropertyListFormat, + ) -> bool; + + #[method_id(@__retain_semantics Other dataWithPropertyList:format:options:error:)] + pub unsafe fn dataWithPropertyList_format_options_error( + plist: &Object, + format: NSPropertyListFormat, + opt: NSPropertyListWriteOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other propertyListWithData:options:format:error:)] + pub unsafe fn propertyListWithData_options_format_error( + data: &NSData, + opt: NSPropertyListReadOptions, + format: *mut NSPropertyListFormat, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other propertyListWithStream:options:format:error:)] + pub unsafe fn propertyListWithStream_options_format_error( + stream: &NSInputStream, + opt: NSPropertyListReadOptions, + format: *mut NSPropertyListFormat, + ) -> Result, Id>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSProtocolChecker.rs b/crates/icrate/src/generated/Foundation/NSProtocolChecker.rs new file mode 100644 index 000000000..f6f8b29eb --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSProtocolChecker.rs @@ -0,0 +1,41 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSProtocolChecker; + + unsafe impl ClassType for NSProtocolChecker { + type Super = NSProxy; + } +); + +extern_methods!( + unsafe impl NSProtocolChecker { + #[method_id(@__retain_semantics Other protocol)] + pub unsafe fn protocol(&self) -> Id; + + #[method_id(@__retain_semantics Other target)] + pub unsafe fn target(&self) -> Option>; + } +); + +extern_methods!( + /// NSProtocolCheckerCreation + unsafe impl NSProtocolChecker { + #[method_id(@__retain_semantics Other protocolCheckerWithTarget:protocol:)] + pub unsafe fn protocolCheckerWithTarget_protocol( + anObject: &NSObject, + aProtocol: &Protocol, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithTarget:protocol:)] + pub unsafe fn initWithTarget_protocol( + this: Option>, + anObject: &NSObject, + aProtocol: &Protocol, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSProxy.rs b/crates/icrate/src/generated/Foundation/NSProxy.rs new file mode 100644 index 000000000..bbc1e79ac --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSProxy.rs @@ -0,0 +1,4 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; diff --git a/crates/icrate/src/generated/Foundation/NSRange.rs b/crates/icrate/src/generated/Foundation/NSRange.rs new file mode 100644 index 000000000..bfc77ba3f --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSRange.rs @@ -0,0 +1,64 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_struct!( + pub struct NSRange { + pub location: NSUInteger, + pub length: NSUInteger, + } +); + +pub type NSRangePointer = *mut NSRange; + +inline_fn!( + pub unsafe fn NSMakeRange(loc: NSUInteger, len: NSUInteger) -> NSRange { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSMaxRange(range: NSRange) -> NSUInteger { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSLocationInRange(loc: NSUInteger, range: NSRange) -> Bool { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSEqualRanges(range1: NSRange, range2: NSRange) -> Bool { + todo!() + } +); + +extern_fn!( + pub unsafe fn NSUnionRange(range1: NSRange, range2: NSRange) -> NSRange; +); + +extern_fn!( + pub unsafe fn NSIntersectionRange(range1: NSRange, range2: NSRange) -> NSRange; +); + +extern_fn!( + pub unsafe fn NSStringFromRange(range: NSRange) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSRangeFromString(aString: &NSString) -> NSRange; +); + +extern_methods!( + /// NSValueRangeExtensions + unsafe impl NSValue { + #[method_id(@__retain_semantics Other valueWithRange:)] + pub unsafe fn valueWithRange(range: NSRange) -> Id; + + #[method(rangeValue)] + pub unsafe fn rangeValue(&self) -> NSRange; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSRegularExpression.rs b/crates/icrate/src/generated/Foundation/NSRegularExpression.rs new file mode 100644 index 000000000..a51085f85 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSRegularExpression.rs @@ -0,0 +1,185 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSRegularExpressionOptions { + NSRegularExpressionCaseInsensitive = 1 << 0, + NSRegularExpressionAllowCommentsAndWhitespace = 1 << 1, + NSRegularExpressionIgnoreMetacharacters = 1 << 2, + NSRegularExpressionDotMatchesLineSeparators = 1 << 3, + NSRegularExpressionAnchorsMatchLines = 1 << 4, + NSRegularExpressionUseUnixLineSeparators = 1 << 5, + NSRegularExpressionUseUnicodeWordBoundaries = 1 << 6, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSRegularExpression; + + unsafe impl ClassType for NSRegularExpression { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSRegularExpression { + #[method_id(@__retain_semantics Other regularExpressionWithPattern:options:error:)] + pub unsafe fn regularExpressionWithPattern_options_error( + pattern: &NSString, + options: NSRegularExpressionOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithPattern:options:error:)] + pub unsafe fn initWithPattern_options_error( + this: Option>, + pattern: &NSString, + options: NSRegularExpressionOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other pattern)] + pub unsafe fn pattern(&self) -> Id; + + #[method(options)] + pub unsafe fn options(&self) -> NSRegularExpressionOptions; + + #[method(numberOfCaptureGroups)] + pub unsafe fn numberOfCaptureGroups(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other escapedPatternForString:)] + pub unsafe fn escapedPatternForString(string: &NSString) -> Id; + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSMatchingOptions { + NSMatchingReportProgress = 1 << 0, + NSMatchingReportCompletion = 1 << 1, + NSMatchingAnchored = 1 << 2, + NSMatchingWithTransparentBounds = 1 << 3, + NSMatchingWithoutAnchoringBounds = 1 << 4, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSMatchingFlags { + NSMatchingProgress = 1 << 0, + NSMatchingCompleted = 1 << 1, + NSMatchingHitEnd = 1 << 2, + NSMatchingRequiredEnd = 1 << 3, + NSMatchingInternalError = 1 << 4, + } +); + +extern_methods!( + /// NSMatching + unsafe impl NSRegularExpression { + #[method(enumerateMatchesInString:options:range:usingBlock:)] + pub unsafe fn enumerateMatchesInString_options_range_usingBlock( + &self, + string: &NSString, + options: NSMatchingOptions, + range: NSRange, + block: &Block<(*mut NSTextCheckingResult, NSMatchingFlags, NonNull), ()>, + ); + + #[method_id(@__retain_semantics Other matchesInString:options:range:)] + pub unsafe fn matchesInString_options_range( + &self, + string: &NSString, + options: NSMatchingOptions, + range: NSRange, + ) -> Id, Shared>; + + #[method(numberOfMatchesInString:options:range:)] + pub unsafe fn numberOfMatchesInString_options_range( + &self, + string: &NSString, + options: NSMatchingOptions, + range: NSRange, + ) -> NSUInteger; + + #[method_id(@__retain_semantics Other firstMatchInString:options:range:)] + pub unsafe fn firstMatchInString_options_range( + &self, + string: &NSString, + options: NSMatchingOptions, + range: NSRange, + ) -> Option>; + + #[method(rangeOfFirstMatchInString:options:range:)] + pub unsafe fn rangeOfFirstMatchInString_options_range( + &self, + string: &NSString, + options: NSMatchingOptions, + range: NSRange, + ) -> NSRange; + } +); + +extern_methods!( + /// NSReplacement + unsafe impl NSRegularExpression { + #[method_id(@__retain_semantics Other stringByReplacingMatchesInString:options:range:withTemplate:)] + pub unsafe fn stringByReplacingMatchesInString_options_range_withTemplate( + &self, + string: &NSString, + options: NSMatchingOptions, + range: NSRange, + templ: &NSString, + ) -> Id; + + #[method(replaceMatchesInString:options:range:withTemplate:)] + pub unsafe fn replaceMatchesInString_options_range_withTemplate( + &self, + string: &NSMutableString, + options: NSMatchingOptions, + range: NSRange, + templ: &NSString, + ) -> NSUInteger; + + #[method_id(@__retain_semantics Other replacementStringForResult:inString:offset:template:)] + pub unsafe fn replacementStringForResult_inString_offset_template( + &self, + result: &NSTextCheckingResult, + string: &NSString, + offset: NSInteger, + templ: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other escapedTemplateForString:)] + pub unsafe fn escapedTemplateForString(string: &NSString) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDataDetector; + + unsafe impl ClassType for NSDataDetector { + type Super = NSRegularExpression; + } +); + +extern_methods!( + unsafe impl NSDataDetector { + #[method_id(@__retain_semantics Other dataDetectorWithTypes:error:)] + pub unsafe fn dataDetectorWithTypes_error( + checkingTypes: NSTextCheckingTypes, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithTypes:error:)] + pub unsafe fn initWithTypes_error( + this: Option>, + checkingTypes: NSTextCheckingTypes, + ) -> Result, Id>; + + #[method(checkingTypes)] + pub unsafe fn checkingTypes(&self) -> NSTextCheckingTypes; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSRelativeDateTimeFormatter.rs b/crates/icrate/src/generated/Foundation/NSRelativeDateTimeFormatter.rs new file mode 100644 index 000000000..eea5cfe05 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSRelativeDateTimeFormatter.rs @@ -0,0 +1,90 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSRelativeDateTimeFormatterStyle { + NSRelativeDateTimeFormatterStyleNumeric = 0, + NSRelativeDateTimeFormatterStyleNamed = 1, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSRelativeDateTimeFormatterUnitsStyle { + NSRelativeDateTimeFormatterUnitsStyleFull = 0, + NSRelativeDateTimeFormatterUnitsStyleSpellOut = 1, + NSRelativeDateTimeFormatterUnitsStyleShort = 2, + NSRelativeDateTimeFormatterUnitsStyleAbbreviated = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSRelativeDateTimeFormatter; + + unsafe impl ClassType for NSRelativeDateTimeFormatter { + type Super = NSFormatter; + } +); + +extern_methods!( + unsafe impl NSRelativeDateTimeFormatter { + #[method(dateTimeStyle)] + pub unsafe fn dateTimeStyle(&self) -> NSRelativeDateTimeFormatterStyle; + + #[method(setDateTimeStyle:)] + pub unsafe fn setDateTimeStyle(&self, dateTimeStyle: NSRelativeDateTimeFormatterStyle); + + #[method(unitsStyle)] + pub unsafe fn unitsStyle(&self) -> NSRelativeDateTimeFormatterUnitsStyle; + + #[method(setUnitsStyle:)] + pub unsafe fn setUnitsStyle(&self, unitsStyle: NSRelativeDateTimeFormatterUnitsStyle); + + #[method(formattingContext)] + pub unsafe fn formattingContext(&self) -> NSFormattingContext; + + #[method(setFormattingContext:)] + pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext); + + #[method_id(@__retain_semantics Other calendar)] + pub unsafe fn calendar(&self) -> Id; + + #[method(setCalendar:)] + pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>); + + #[method_id(@__retain_semantics Other locale)] + pub unsafe fn locale(&self) -> Id; + + #[method(setLocale:)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + + #[method_id(@__retain_semantics Other localizedStringFromDateComponents:)] + pub unsafe fn localizedStringFromDateComponents( + &self, + dateComponents: &NSDateComponents, + ) -> Id; + + #[method_id(@__retain_semantics Other localizedStringFromTimeInterval:)] + pub unsafe fn localizedStringFromTimeInterval( + &self, + timeInterval: NSTimeInterval, + ) -> Id; + + #[method_id(@__retain_semantics Other localizedStringForDate:relativeToDate:)] + pub unsafe fn localizedStringForDate_relativeToDate( + &self, + date: &NSDate, + referenceDate: &NSDate, + ) -> Id; + + #[method_id(@__retain_semantics Other stringForObjectValue:)] + pub unsafe fn stringForObjectValue( + &self, + obj: Option<&Object>, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSRunLoop.rs b/crates/icrate/src/generated/Foundation/NSRunLoop.rs new file mode 100644 index 000000000..4cd07cdd0 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSRunLoop.rs @@ -0,0 +1,134 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSDefaultRunLoopMode: &'static NSRunLoopMode); + +extern_static!(NSRunLoopCommonModes: &'static NSRunLoopMode); + +extern_class!( + #[derive(Debug)] + pub struct NSRunLoop; + + unsafe impl ClassType for NSRunLoop { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSRunLoop { + #[method_id(@__retain_semantics Other currentRunLoop)] + pub unsafe fn currentRunLoop() -> Id; + + #[method_id(@__retain_semantics Other mainRunLoop)] + pub unsafe fn mainRunLoop() -> Id; + + #[method_id(@__retain_semantics Other currentMode)] + pub unsafe fn currentMode(&self) -> Option>; + + #[method(addTimer:forMode:)] + pub unsafe fn addTimer_forMode(&self, timer: &NSTimer, mode: &NSRunLoopMode); + + #[method(addPort:forMode:)] + pub unsafe fn addPort_forMode(&self, aPort: &NSPort, mode: &NSRunLoopMode); + + #[method(removePort:forMode:)] + pub unsafe fn removePort_forMode(&self, aPort: &NSPort, mode: &NSRunLoopMode); + + #[method_id(@__retain_semantics Other limitDateForMode:)] + pub unsafe fn limitDateForMode(&self, mode: &NSRunLoopMode) -> Option>; + + #[method(acceptInputForMode:beforeDate:)] + pub unsafe fn acceptInputForMode_beforeDate( + &self, + mode: &NSRunLoopMode, + limitDate: &NSDate, + ); + } +); + +extern_methods!( + /// NSRunLoopConveniences + unsafe impl NSRunLoop { + #[method(run)] + pub unsafe fn run(&self); + + #[method(runUntilDate:)] + pub unsafe fn runUntilDate(&self, limitDate: &NSDate); + + #[method(runMode:beforeDate:)] + pub unsafe fn runMode_beforeDate(&self, mode: &NSRunLoopMode, limitDate: &NSDate) -> bool; + + #[method(configureAsServer)] + pub unsafe fn configureAsServer(&self); + + #[method(performInModes:block:)] + pub unsafe fn performInModes_block( + &self, + modes: &NSArray, + block: &Block<(), ()>, + ); + + #[method(performBlock:)] + pub unsafe fn performBlock(&self, block: &Block<(), ()>); + } +); + +extern_methods!( + /// NSDelayedPerforming + unsafe impl NSObject { + #[method(performSelector:withObject:afterDelay:inModes:)] + pub unsafe fn performSelector_withObject_afterDelay_inModes( + &self, + aSelector: Sel, + anArgument: Option<&Object>, + delay: NSTimeInterval, + modes: &NSArray, + ); + + #[method(performSelector:withObject:afterDelay:)] + pub unsafe fn performSelector_withObject_afterDelay( + &self, + aSelector: Sel, + anArgument: Option<&Object>, + delay: NSTimeInterval, + ); + + #[method(cancelPreviousPerformRequestsWithTarget:selector:object:)] + pub unsafe fn cancelPreviousPerformRequestsWithTarget_selector_object( + aTarget: &Object, + aSelector: Sel, + anArgument: Option<&Object>, + ); + + #[method(cancelPreviousPerformRequestsWithTarget:)] + pub unsafe fn cancelPreviousPerformRequestsWithTarget(aTarget: &Object); + } +); + +extern_methods!( + /// NSOrderedPerform + unsafe impl NSRunLoop { + #[method(performSelector:target:argument:order:modes:)] + pub unsafe fn performSelector_target_argument_order_modes( + &self, + aSelector: Sel, + target: &Object, + arg: Option<&Object>, + order: NSUInteger, + modes: &NSArray, + ); + + #[method(cancelPerformSelector:target:argument:)] + pub unsafe fn cancelPerformSelector_target_argument( + &self, + aSelector: Sel, + target: &Object, + arg: Option<&Object>, + ); + + #[method(cancelPerformSelectorsWithTarget:)] + pub unsafe fn cancelPerformSelectorsWithTarget(&self, target: &Object); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSScanner.rs b/crates/icrate/src/generated/Foundation/NSScanner.rs new file mode 100644 index 000000000..5e0618d07 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSScanner.rs @@ -0,0 +1,125 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSScanner; + + unsafe impl ClassType for NSScanner { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSScanner { + #[method_id(@__retain_semantics Other string)] + pub unsafe fn string(&self) -> Id; + + #[method(scanLocation)] + pub unsafe fn scanLocation(&self) -> NSUInteger; + + #[method(setScanLocation:)] + pub unsafe fn setScanLocation(&self, scanLocation: NSUInteger); + + #[method_id(@__retain_semantics Other charactersToBeSkipped)] + pub unsafe fn charactersToBeSkipped(&self) -> Option>; + + #[method(setCharactersToBeSkipped:)] + pub unsafe fn setCharactersToBeSkipped( + &self, + charactersToBeSkipped: Option<&NSCharacterSet>, + ); + + #[method(caseSensitive)] + pub unsafe fn caseSensitive(&self) -> bool; + + #[method(setCaseSensitive:)] + pub unsafe fn setCaseSensitive(&self, caseSensitive: bool); + + #[method_id(@__retain_semantics Other locale)] + pub unsafe fn locale(&self) -> Option>; + + #[method(setLocale:)] + pub unsafe fn setLocale(&self, locale: Option<&Object>); + + #[method_id(@__retain_semantics Init initWithString:)] + pub unsafe fn initWithString( + this: Option>, + string: &NSString, + ) -> Id; + } +); + +extern_methods!( + /// NSExtendedScanner + unsafe impl NSScanner { + #[method(scanInt:)] + pub unsafe fn scanInt(&self, result: *mut c_int) -> bool; + + #[method(scanInteger:)] + pub unsafe fn scanInteger(&self, result: *mut NSInteger) -> bool; + + #[method(scanLongLong:)] + pub unsafe fn scanLongLong(&self, result: *mut c_longlong) -> bool; + + #[method(scanUnsignedLongLong:)] + pub unsafe fn scanUnsignedLongLong(&self, result: *mut c_ulonglong) -> bool; + + #[method(scanFloat:)] + pub unsafe fn scanFloat(&self, result: *mut c_float) -> bool; + + #[method(scanDouble:)] + pub unsafe fn scanDouble(&self, result: *mut c_double) -> bool; + + #[method(scanHexInt:)] + pub unsafe fn scanHexInt(&self, result: *mut c_uint) -> bool; + + #[method(scanHexLongLong:)] + pub unsafe fn scanHexLongLong(&self, result: *mut c_ulonglong) -> bool; + + #[method(scanHexFloat:)] + pub unsafe fn scanHexFloat(&self, result: *mut c_float) -> bool; + + #[method(scanHexDouble:)] + pub unsafe fn scanHexDouble(&self, result: *mut c_double) -> bool; + + #[method(scanString:intoString:)] + pub unsafe fn scanString_intoString( + &self, + string: &NSString, + result: *mut *mut NSString, + ) -> bool; + + #[method(scanCharactersFromSet:intoString:)] + pub unsafe fn scanCharactersFromSet_intoString( + &self, + set: &NSCharacterSet, + result: *mut *mut NSString, + ) -> bool; + + #[method(scanUpToString:intoString:)] + pub unsafe fn scanUpToString_intoString( + &self, + string: &NSString, + result: *mut *mut NSString, + ) -> bool; + + #[method(scanUpToCharactersFromSet:intoString:)] + pub unsafe fn scanUpToCharactersFromSet_intoString( + &self, + set: &NSCharacterSet, + result: *mut *mut NSString, + ) -> bool; + + #[method(isAtEnd)] + pub unsafe fn isAtEnd(&self) -> bool; + + #[method_id(@__retain_semantics Other scannerWithString:)] + pub unsafe fn scannerWithString(string: &NSString) -> Id; + + #[method_id(@__retain_semantics Other localizedScannerWithString:)] + pub unsafe fn localizedScannerWithString(string: &NSString) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSScriptClassDescription.rs b/crates/icrate/src/generated/Foundation/NSScriptClassDescription.rs new file mode 100644 index 000000000..a27bbf881 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSScriptClassDescription.rs @@ -0,0 +1,118 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSScriptClassDescription; + + unsafe impl ClassType for NSScriptClassDescription { + type Super = NSClassDescription; + } +); + +extern_methods!( + unsafe impl NSScriptClassDescription { + #[method_id(@__retain_semantics Other classDescriptionForClass:)] + pub unsafe fn classDescriptionForClass( + aClass: &Class, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithSuiteName:className:dictionary:)] + pub unsafe fn initWithSuiteName_className_dictionary( + this: Option>, + suiteName: &NSString, + className: &NSString, + classDeclaration: Option<&NSDictionary>, + ) -> Option>; + + #[method_id(@__retain_semantics Other suiteName)] + pub unsafe fn suiteName(&self) -> Option>; + + #[method_id(@__retain_semantics Other className)] + pub unsafe fn className(&self) -> Option>; + + #[method_id(@__retain_semantics Other implementationClassName)] + pub unsafe fn implementationClassName(&self) -> Option>; + + #[method_id(@__retain_semantics Other superclassDescription)] + pub unsafe fn superclassDescription(&self) -> Option>; + + #[method(appleEventCode)] + pub unsafe fn appleEventCode(&self) -> FourCharCode; + + #[method(matchesAppleEventCode:)] + pub unsafe fn matchesAppleEventCode(&self, appleEventCode: FourCharCode) -> bool; + + #[method(supportsCommand:)] + pub unsafe fn supportsCommand( + &self, + commandDescription: &NSScriptCommandDescription, + ) -> bool; + + #[method(selectorForCommand:)] + pub unsafe fn selectorForCommand( + &self, + commandDescription: &NSScriptCommandDescription, + ) -> OptionSel; + + #[method_id(@__retain_semantics Other typeForKey:)] + pub unsafe fn typeForKey(&self, key: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other classDescriptionForKey:)] + pub unsafe fn classDescriptionForKey( + &self, + key: &NSString, + ) -> Option>; + + #[method(appleEventCodeForKey:)] + pub unsafe fn appleEventCodeForKey(&self, key: &NSString) -> FourCharCode; + + #[method_id(@__retain_semantics Other keyWithAppleEventCode:)] + pub unsafe fn keyWithAppleEventCode( + &self, + appleEventCode: FourCharCode, + ) -> Option>; + + #[method_id(@__retain_semantics Other defaultSubcontainerAttributeKey)] + pub unsafe fn defaultSubcontainerAttributeKey(&self) -> Option>; + + #[method(isLocationRequiredToCreateForKey:)] + pub unsafe fn isLocationRequiredToCreateForKey( + &self, + toManyRelationshipKey: &NSString, + ) -> bool; + + #[method(hasPropertyForKey:)] + pub unsafe fn hasPropertyForKey(&self, key: &NSString) -> bool; + + #[method(hasOrderedToManyRelationshipForKey:)] + pub unsafe fn hasOrderedToManyRelationshipForKey(&self, key: &NSString) -> bool; + + #[method(hasReadablePropertyForKey:)] + pub unsafe fn hasReadablePropertyForKey(&self, key: &NSString) -> bool; + + #[method(hasWritablePropertyForKey:)] + pub unsafe fn hasWritablePropertyForKey(&self, key: &NSString) -> bool; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSScriptClassDescription { + #[method(isReadOnlyKey:)] + pub unsafe fn isReadOnlyKey(&self, key: &NSString) -> bool; + } +); + +extern_methods!( + /// NSScriptClassDescription + unsafe impl NSObject { + #[method(classCode)] + pub unsafe fn classCode(&self) -> FourCharCode; + + #[method_id(@__retain_semantics Other className)] + pub unsafe fn className(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSScriptCoercionHandler.rs b/crates/icrate/src/generated/Foundation/NSScriptCoercionHandler.rs new file mode 100644 index 000000000..179abf505 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSScriptCoercionHandler.rs @@ -0,0 +1,36 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSScriptCoercionHandler; + + unsafe impl ClassType for NSScriptCoercionHandler { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSScriptCoercionHandler { + #[method_id(@__retain_semantics Other sharedCoercionHandler)] + pub unsafe fn sharedCoercionHandler() -> Id; + + #[method_id(@__retain_semantics Other coerceValue:toClass:)] + pub unsafe fn coerceValue_toClass( + &self, + value: &Object, + toClass: &Class, + ) -> Option>; + + #[method(registerCoercer:selector:toConvertFromClass:toClass:)] + pub unsafe fn registerCoercer_selector_toConvertFromClass_toClass( + &self, + coercer: &Object, + selector: Sel, + fromClass: &Class, + toClass: &Class, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSScriptCommand.rs b/crates/icrate/src/generated/Foundation/NSScriptCommand.rs new file mode 100644 index 000000000..412255b84 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSScriptCommand.rs @@ -0,0 +1,133 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum { + NSNoScriptError = 0, + NSReceiverEvaluationScriptError = 1, + NSKeySpecifierEvaluationScriptError = 2, + NSArgumentEvaluationScriptError = 3, + NSReceiversCantHandleCommandScriptError = 4, + NSRequiredArgumentsMissingScriptError = 5, + NSArgumentsWrongScriptError = 6, + NSUnknownKeyScriptError = 7, + NSInternalScriptError = 8, + NSOperationNotSupportedForKeyScriptError = 9, + NSCannotCreateScriptCommandError = 10, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSScriptCommand; + + unsafe impl ClassType for NSScriptCommand { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSScriptCommand { + #[method_id(@__retain_semantics Init initWithCommandDescription:)] + pub unsafe fn initWithCommandDescription( + this: Option>, + commandDef: &NSScriptCommandDescription, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + inCoder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other commandDescription)] + pub unsafe fn commandDescription(&self) -> Id; + + #[method_id(@__retain_semantics Other directParameter)] + pub unsafe fn directParameter(&self) -> Option>; + + #[method(setDirectParameter:)] + pub unsafe fn setDirectParameter(&self, directParameter: Option<&Object>); + + #[method_id(@__retain_semantics Other receiversSpecifier)] + pub unsafe fn receiversSpecifier(&self) -> Option>; + + #[method(setReceiversSpecifier:)] + pub unsafe fn setReceiversSpecifier( + &self, + receiversSpecifier: Option<&NSScriptObjectSpecifier>, + ); + + #[method_id(@__retain_semantics Other evaluatedReceivers)] + pub unsafe fn evaluatedReceivers(&self) -> Option>; + + #[method_id(@__retain_semantics Other arguments)] + pub unsafe fn arguments(&self) -> Option, Shared>>; + + #[method(setArguments:)] + pub unsafe fn setArguments(&self, arguments: Option<&NSDictionary>); + + #[method_id(@__retain_semantics Other evaluatedArguments)] + pub unsafe fn evaluatedArguments( + &self, + ) -> Option, Shared>>; + + #[method(isWellFormed)] + pub unsafe fn isWellFormed(&self) -> bool; + + #[method_id(@__retain_semantics Other performDefaultImplementation)] + pub unsafe fn performDefaultImplementation(&self) -> Option>; + + #[method_id(@__retain_semantics Other executeCommand)] + pub unsafe fn executeCommand(&self) -> Option>; + + #[method(scriptErrorNumber)] + pub unsafe fn scriptErrorNumber(&self) -> NSInteger; + + #[method(setScriptErrorNumber:)] + pub unsafe fn setScriptErrorNumber(&self, scriptErrorNumber: NSInteger); + + #[method_id(@__retain_semantics Other scriptErrorOffendingObjectDescriptor)] + pub unsafe fn scriptErrorOffendingObjectDescriptor( + &self, + ) -> Option>; + + #[method(setScriptErrorOffendingObjectDescriptor:)] + pub unsafe fn setScriptErrorOffendingObjectDescriptor( + &self, + scriptErrorOffendingObjectDescriptor: Option<&NSAppleEventDescriptor>, + ); + + #[method_id(@__retain_semantics Other scriptErrorExpectedTypeDescriptor)] + pub unsafe fn scriptErrorExpectedTypeDescriptor( + &self, + ) -> Option>; + + #[method(setScriptErrorExpectedTypeDescriptor:)] + pub unsafe fn setScriptErrorExpectedTypeDescriptor( + &self, + scriptErrorExpectedTypeDescriptor: Option<&NSAppleEventDescriptor>, + ); + + #[method_id(@__retain_semantics Other scriptErrorString)] + pub unsafe fn scriptErrorString(&self) -> Option>; + + #[method(setScriptErrorString:)] + pub unsafe fn setScriptErrorString(&self, scriptErrorString: Option<&NSString>); + + #[method_id(@__retain_semantics Other currentCommand)] + pub unsafe fn currentCommand() -> Option>; + + #[method_id(@__retain_semantics Other appleEvent)] + pub unsafe fn appleEvent(&self) -> Option>; + + #[method(suspendExecution)] + pub unsafe fn suspendExecution(&self); + + #[method(resumeExecutionWithResult:)] + pub unsafe fn resumeExecutionWithResult(&self, result: Option<&Object>); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSScriptCommandDescription.rs b/crates/icrate/src/generated/Foundation/NSScriptCommandDescription.rs new file mode 100644 index 000000000..e6f21ef3b --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSScriptCommandDescription.rs @@ -0,0 +1,82 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSScriptCommandDescription; + + unsafe impl ClassType for NSScriptCommandDescription { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSScriptCommandDescription { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithSuiteName:commandName:dictionary:)] + pub unsafe fn initWithSuiteName_commandName_dictionary( + this: Option>, + suiteName: &NSString, + commandName: &NSString, + commandDeclaration: Option<&NSDictionary>, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + inCoder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other suiteName)] + pub unsafe fn suiteName(&self) -> Id; + + #[method_id(@__retain_semantics Other commandName)] + pub unsafe fn commandName(&self) -> Id; + + #[method(appleEventClassCode)] + pub unsafe fn appleEventClassCode(&self) -> FourCharCode; + + #[method(appleEventCode)] + pub unsafe fn appleEventCode(&self) -> FourCharCode; + + #[method_id(@__retain_semantics Other commandClassName)] + pub unsafe fn commandClassName(&self) -> Id; + + #[method_id(@__retain_semantics Other returnType)] + pub unsafe fn returnType(&self) -> Option>; + + #[method(appleEventCodeForReturnType)] + pub unsafe fn appleEventCodeForReturnType(&self) -> FourCharCode; + + #[method_id(@__retain_semantics Other argumentNames)] + pub unsafe fn argumentNames(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other typeForArgumentWithName:)] + pub unsafe fn typeForArgumentWithName( + &self, + argumentName: &NSString, + ) -> Option>; + + #[method(appleEventCodeForArgumentWithName:)] + pub unsafe fn appleEventCodeForArgumentWithName( + &self, + argumentName: &NSString, + ) -> FourCharCode; + + #[method(isOptionalArgumentWithName:)] + pub unsafe fn isOptionalArgumentWithName(&self, argumentName: &NSString) -> bool; + + #[method_id(@__retain_semantics Other createCommandInstance)] + pub unsafe fn createCommandInstance(&self) -> Id; + + #[method_id(@__retain_semantics Other createCommandInstanceWithZone:)] + pub unsafe fn createCommandInstanceWithZone( + &self, + zone: *mut NSZone, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSScriptExecutionContext.rs b/crates/icrate/src/generated/Foundation/NSScriptExecutionContext.rs new file mode 100644 index 000000000..07d055c8d --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSScriptExecutionContext.rs @@ -0,0 +1,38 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSScriptExecutionContext; + + unsafe impl ClassType for NSScriptExecutionContext { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSScriptExecutionContext { + #[method_id(@__retain_semantics Other sharedScriptExecutionContext)] + pub unsafe fn sharedScriptExecutionContext() -> Id; + + #[method_id(@__retain_semantics Other topLevelObject)] + pub unsafe fn topLevelObject(&self) -> Option>; + + #[method(setTopLevelObject:)] + pub unsafe fn setTopLevelObject(&self, topLevelObject: Option<&Object>); + + #[method_id(@__retain_semantics Other objectBeingTested)] + pub unsafe fn objectBeingTested(&self) -> Option>; + + #[method(setObjectBeingTested:)] + pub unsafe fn setObjectBeingTested(&self, objectBeingTested: Option<&Object>); + + #[method_id(@__retain_semantics Other rangeContainerObject)] + pub unsafe fn rangeContainerObject(&self) -> Option>; + + #[method(setRangeContainerObject:)] + pub unsafe fn setRangeContainerObject(&self, rangeContainerObject: Option<&Object>); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSScriptKeyValueCoding.rs b/crates/icrate/src/generated/Foundation/NSScriptKeyValueCoding.rs new file mode 100644 index 000000000..53e850964 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSScriptKeyValueCoding.rs @@ -0,0 +1,65 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSOperationNotSupportedForKeyException: &'static NSString); + +extern_methods!( + /// NSScriptKeyValueCoding + unsafe impl NSObject { + #[method_id(@__retain_semantics Other valueAtIndex:inPropertyWithKey:)] + pub unsafe fn valueAtIndex_inPropertyWithKey( + &self, + index: NSUInteger, + key: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other valueWithName:inPropertyWithKey:)] + pub unsafe fn valueWithName_inPropertyWithKey( + &self, + name: &NSString, + key: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other valueWithUniqueID:inPropertyWithKey:)] + pub unsafe fn valueWithUniqueID_inPropertyWithKey( + &self, + uniqueID: &Object, + key: &NSString, + ) -> Option>; + + #[method(insertValue:atIndex:inPropertyWithKey:)] + pub unsafe fn insertValue_atIndex_inPropertyWithKey( + &self, + value: &Object, + index: NSUInteger, + key: &NSString, + ); + + #[method(removeValueAtIndex:fromPropertyWithKey:)] + pub unsafe fn removeValueAtIndex_fromPropertyWithKey( + &self, + index: NSUInteger, + key: &NSString, + ); + + #[method(replaceValueAtIndex:inPropertyWithKey:withValue:)] + pub unsafe fn replaceValueAtIndex_inPropertyWithKey_withValue( + &self, + index: NSUInteger, + key: &NSString, + value: &Object, + ); + + #[method(insertValue:inPropertyWithKey:)] + pub unsafe fn insertValue_inPropertyWithKey(&self, value: &Object, key: &NSString); + + #[method_id(@__retain_semantics Other coerceValue:forKey:)] + pub unsafe fn coerceValue_forKey( + &self, + value: Option<&Object>, + key: &NSString, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSScriptObjectSpecifiers.rs b/crates/icrate/src/generated/Foundation/NSScriptObjectSpecifiers.rs new file mode 100644 index 000000000..4f938dcee --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSScriptObjectSpecifiers.rs @@ -0,0 +1,508 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum { + NSNoSpecifierError = 0, + NSNoTopLevelContainersSpecifierError = 1, + NSContainerSpecifierError = 2, + NSUnknownKeySpecifierError = 3, + NSInvalidIndexSpecifierError = 4, + NSInternalSpecifierError = 5, + NSOperationNotSupportedForKeySpecifierError = 6, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSInsertionPosition { + NSPositionAfter = 0, + NSPositionBefore = 1, + NSPositionBeginning = 2, + NSPositionEnd = 3, + NSPositionReplace = 4, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSRelativePosition { + NSRelativeAfter = 0, + NSRelativeBefore = 1, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSWhoseSubelementIdentifier { + NSIndexSubelement = 0, + NSEverySubelement = 1, + NSMiddleSubelement = 2, + NSRandomSubelement = 3, + NSNoSubelement = 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSScriptObjectSpecifier; + + unsafe impl ClassType for NSScriptObjectSpecifier { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSScriptObjectSpecifier { + #[method_id(@__retain_semantics Other objectSpecifierWithDescriptor:)] + pub unsafe fn objectSpecifierWithDescriptor( + descriptor: &NSAppleEventDescriptor, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContainerSpecifier:key:)] + pub unsafe fn initWithContainerSpecifier_key( + this: Option>, + container: &NSScriptObjectSpecifier, + property: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithContainerClassDescription:containerSpecifier:key:)] + pub unsafe fn initWithContainerClassDescription_containerSpecifier_key( + this: Option>, + classDesc: &NSScriptClassDescription, + container: Option<&NSScriptObjectSpecifier>, + property: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + inCoder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other childSpecifier)] + pub unsafe fn childSpecifier(&self) -> Option>; + + #[method(setChildSpecifier:)] + pub unsafe fn setChildSpecifier(&self, childSpecifier: Option<&NSScriptObjectSpecifier>); + + #[method_id(@__retain_semantics Other containerSpecifier)] + pub unsafe fn containerSpecifier(&self) -> Option>; + + #[method(setContainerSpecifier:)] + pub unsafe fn setContainerSpecifier( + &self, + containerSpecifier: Option<&NSScriptObjectSpecifier>, + ); + + #[method(containerIsObjectBeingTested)] + pub unsafe fn containerIsObjectBeingTested(&self) -> bool; + + #[method(setContainerIsObjectBeingTested:)] + pub unsafe fn setContainerIsObjectBeingTested(&self, containerIsObjectBeingTested: bool); + + #[method(containerIsRangeContainerObject)] + pub unsafe fn containerIsRangeContainerObject(&self) -> bool; + + #[method(setContainerIsRangeContainerObject:)] + pub unsafe fn setContainerIsRangeContainerObject( + &self, + containerIsRangeContainerObject: bool, + ); + + #[method_id(@__retain_semantics Other key)] + pub unsafe fn key(&self) -> Id; + + #[method(setKey:)] + pub unsafe fn setKey(&self, key: &NSString); + + #[method_id(@__retain_semantics Other containerClassDescription)] + pub unsafe fn containerClassDescription( + &self, + ) -> Option>; + + #[method(setContainerClassDescription:)] + pub unsafe fn setContainerClassDescription( + &self, + containerClassDescription: Option<&NSScriptClassDescription>, + ); + + #[method_id(@__retain_semantics Other keyClassDescription)] + pub unsafe fn keyClassDescription(&self) -> Option>; + + #[method(indicesOfObjectsByEvaluatingWithContainer:count:)] + pub unsafe fn indicesOfObjectsByEvaluatingWithContainer_count( + &self, + container: &Object, + count: NonNull, + ) -> *mut NSInteger; + + #[method_id(@__retain_semantics Other objectsByEvaluatingWithContainers:)] + pub unsafe fn objectsByEvaluatingWithContainers( + &self, + containers: &Object, + ) -> Option>; + + #[method_id(@__retain_semantics Other objectsByEvaluatingSpecifier)] + pub unsafe fn objectsByEvaluatingSpecifier(&self) -> Option>; + + #[method(evaluationErrorNumber)] + pub unsafe fn evaluationErrorNumber(&self) -> NSInteger; + + #[method(setEvaluationErrorNumber:)] + pub unsafe fn setEvaluationErrorNumber(&self, evaluationErrorNumber: NSInteger); + + #[method_id(@__retain_semantics Other evaluationErrorSpecifier)] + pub unsafe fn evaluationErrorSpecifier( + &self, + ) -> Option>; + + #[method_id(@__retain_semantics Other descriptor)] + pub unsafe fn descriptor(&self) -> Option>; + } +); + +extern_methods!( + /// NSScriptObjectSpecifiers + unsafe impl NSObject { + #[method_id(@__retain_semantics Other objectSpecifier)] + pub unsafe fn objectSpecifier(&self) -> Option>; + + #[method_id(@__retain_semantics Other indicesOfObjectsByEvaluatingObjectSpecifier:)] + pub unsafe fn indicesOfObjectsByEvaluatingObjectSpecifier( + &self, + specifier: &NSScriptObjectSpecifier, + ) -> Option, Shared>>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSIndexSpecifier; + + unsafe impl ClassType for NSIndexSpecifier { + type Super = NSScriptObjectSpecifier; + } +); + +extern_methods!( + unsafe impl NSIndexSpecifier { + #[method_id(@__retain_semantics Init initWithContainerClassDescription:containerSpecifier:key:index:)] + pub unsafe fn initWithContainerClassDescription_containerSpecifier_key_index( + this: Option>, + classDesc: &NSScriptClassDescription, + container: Option<&NSScriptObjectSpecifier>, + property: &NSString, + index: NSInteger, + ) -> Id; + + #[method(index)] + pub unsafe fn index(&self) -> NSInteger; + + #[method(setIndex:)] + pub unsafe fn setIndex(&self, index: NSInteger); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMiddleSpecifier; + + unsafe impl ClassType for NSMiddleSpecifier { + type Super = NSScriptObjectSpecifier; + } +); + +extern_methods!( + unsafe impl NSMiddleSpecifier {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSNameSpecifier; + + unsafe impl ClassType for NSNameSpecifier { + type Super = NSScriptObjectSpecifier; + } +); + +extern_methods!( + unsafe impl NSNameSpecifier { + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + inCoder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContainerClassDescription:containerSpecifier:key:name:)] + pub unsafe fn initWithContainerClassDescription_containerSpecifier_key_name( + this: Option>, + classDesc: &NSScriptClassDescription, + container: Option<&NSScriptObjectSpecifier>, + property: &NSString, + name: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method(setName:)] + pub unsafe fn setName(&self, name: &NSString); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPositionalSpecifier; + + unsafe impl ClassType for NSPositionalSpecifier { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSPositionalSpecifier { + #[method_id(@__retain_semantics Init initWithPosition:objectSpecifier:)] + pub unsafe fn initWithPosition_objectSpecifier( + this: Option>, + position: NSInsertionPosition, + specifier: &NSScriptObjectSpecifier, + ) -> Id; + + #[method(position)] + pub unsafe fn position(&self) -> NSInsertionPosition; + + #[method_id(@__retain_semantics Other objectSpecifier)] + pub unsafe fn objectSpecifier(&self) -> Id; + + #[method(setInsertionClassDescription:)] + pub unsafe fn setInsertionClassDescription( + &self, + classDescription: &NSScriptClassDescription, + ); + + #[method(evaluate)] + pub unsafe fn evaluate(&self); + + #[method_id(@__retain_semantics Other insertionContainer)] + pub unsafe fn insertionContainer(&self) -> Option>; + + #[method_id(@__retain_semantics Other insertionKey)] + pub unsafe fn insertionKey(&self) -> Option>; + + #[method(insertionIndex)] + pub unsafe fn insertionIndex(&self) -> NSInteger; + + #[method(insertionReplaces)] + pub unsafe fn insertionReplaces(&self) -> bool; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSPropertySpecifier; + + unsafe impl ClassType for NSPropertySpecifier { + type Super = NSScriptObjectSpecifier; + } +); + +extern_methods!( + unsafe impl NSPropertySpecifier {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSRandomSpecifier; + + unsafe impl ClassType for NSRandomSpecifier { + type Super = NSScriptObjectSpecifier; + } +); + +extern_methods!( + unsafe impl NSRandomSpecifier {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSRangeSpecifier; + + unsafe impl ClassType for NSRangeSpecifier { + type Super = NSScriptObjectSpecifier; + } +); + +extern_methods!( + unsafe impl NSRangeSpecifier { + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + inCoder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContainerClassDescription:containerSpecifier:key:startSpecifier:endSpecifier:)] + pub unsafe fn initWithContainerClassDescription_containerSpecifier_key_startSpecifier_endSpecifier( + this: Option>, + classDesc: &NSScriptClassDescription, + container: Option<&NSScriptObjectSpecifier>, + property: &NSString, + startSpec: Option<&NSScriptObjectSpecifier>, + endSpec: Option<&NSScriptObjectSpecifier>, + ) -> Id; + + #[method_id(@__retain_semantics Other startSpecifier)] + pub unsafe fn startSpecifier(&self) -> Option>; + + #[method(setStartSpecifier:)] + pub unsafe fn setStartSpecifier(&self, startSpecifier: Option<&NSScriptObjectSpecifier>); + + #[method_id(@__retain_semantics Other endSpecifier)] + pub unsafe fn endSpecifier(&self) -> Option>; + + #[method(setEndSpecifier:)] + pub unsafe fn setEndSpecifier(&self, endSpecifier: Option<&NSScriptObjectSpecifier>); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSRelativeSpecifier; + + unsafe impl ClassType for NSRelativeSpecifier { + type Super = NSScriptObjectSpecifier; + } +); + +extern_methods!( + unsafe impl NSRelativeSpecifier { + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + inCoder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContainerClassDescription:containerSpecifier:key:relativePosition:baseSpecifier:)] + pub unsafe fn initWithContainerClassDescription_containerSpecifier_key_relativePosition_baseSpecifier( + this: Option>, + classDesc: &NSScriptClassDescription, + container: Option<&NSScriptObjectSpecifier>, + property: &NSString, + relPos: NSRelativePosition, + baseSpecifier: Option<&NSScriptObjectSpecifier>, + ) -> Id; + + #[method(relativePosition)] + pub unsafe fn relativePosition(&self) -> NSRelativePosition; + + #[method(setRelativePosition:)] + pub unsafe fn setRelativePosition(&self, relativePosition: NSRelativePosition); + + #[method_id(@__retain_semantics Other baseSpecifier)] + pub unsafe fn baseSpecifier(&self) -> Option>; + + #[method(setBaseSpecifier:)] + pub unsafe fn setBaseSpecifier(&self, baseSpecifier: Option<&NSScriptObjectSpecifier>); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUniqueIDSpecifier; + + unsafe impl ClassType for NSUniqueIDSpecifier { + type Super = NSScriptObjectSpecifier; + } +); + +extern_methods!( + unsafe impl NSUniqueIDSpecifier { + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + inCoder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContainerClassDescription:containerSpecifier:key:uniqueID:)] + pub unsafe fn initWithContainerClassDescription_containerSpecifier_key_uniqueID( + this: Option>, + classDesc: &NSScriptClassDescription, + container: Option<&NSScriptObjectSpecifier>, + property: &NSString, + uniqueID: &Object, + ) -> Id; + + #[method_id(@__retain_semantics Other uniqueID)] + pub unsafe fn uniqueID(&self) -> Id; + + #[method(setUniqueID:)] + pub unsafe fn setUniqueID(&self, uniqueID: &Object); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSWhoseSpecifier; + + unsafe impl ClassType for NSWhoseSpecifier { + type Super = NSScriptObjectSpecifier; + } +); + +extern_methods!( + unsafe impl NSWhoseSpecifier { + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + inCoder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContainerClassDescription:containerSpecifier:key:test:)] + pub unsafe fn initWithContainerClassDescription_containerSpecifier_key_test( + this: Option>, + classDesc: &NSScriptClassDescription, + container: Option<&NSScriptObjectSpecifier>, + property: &NSString, + test: &NSScriptWhoseTest, + ) -> Id; + + #[method_id(@__retain_semantics Other test)] + pub unsafe fn test(&self) -> Id; + + #[method(setTest:)] + pub unsafe fn setTest(&self, test: &NSScriptWhoseTest); + + #[method(startSubelementIdentifier)] + pub unsafe fn startSubelementIdentifier(&self) -> NSWhoseSubelementIdentifier; + + #[method(setStartSubelementIdentifier:)] + pub unsafe fn setStartSubelementIdentifier( + &self, + startSubelementIdentifier: NSWhoseSubelementIdentifier, + ); + + #[method(startSubelementIndex)] + pub unsafe fn startSubelementIndex(&self) -> NSInteger; + + #[method(setStartSubelementIndex:)] + pub unsafe fn setStartSubelementIndex(&self, startSubelementIndex: NSInteger); + + #[method(endSubelementIdentifier)] + pub unsafe fn endSubelementIdentifier(&self) -> NSWhoseSubelementIdentifier; + + #[method(setEndSubelementIdentifier:)] + pub unsafe fn setEndSubelementIdentifier( + &self, + endSubelementIdentifier: NSWhoseSubelementIdentifier, + ); + + #[method(endSubelementIndex)] + pub unsafe fn endSubelementIndex(&self) -> NSInteger; + + #[method(setEndSubelementIndex:)] + pub unsafe fn setEndSubelementIndex(&self, endSubelementIndex: NSInteger); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSScriptStandardSuiteCommands.rs b/crates/icrate/src/generated/Foundation/NSScriptStandardSuiteCommands.rs new file mode 100644 index 000000000..fba08a56f --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSScriptStandardSuiteCommands.rs @@ -0,0 +1,179 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSSaveOptions { + NSSaveOptionsYes = 0, + NSSaveOptionsNo = 1, + NSSaveOptionsAsk = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCloneCommand; + + unsafe impl ClassType for NSCloneCommand { + type Super = NSScriptCommand; + } +); + +extern_methods!( + unsafe impl NSCloneCommand { + #[method(setReceiversSpecifier:)] + pub unsafe fn setReceiversSpecifier(&self, receiversRef: Option<&NSScriptObjectSpecifier>); + + #[method_id(@__retain_semantics Other keySpecifier)] + pub unsafe fn keySpecifier(&self) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCloseCommand; + + unsafe impl ClassType for NSCloseCommand { + type Super = NSScriptCommand; + } +); + +extern_methods!( + unsafe impl NSCloseCommand { + #[method(saveOptions)] + pub unsafe fn saveOptions(&self) -> NSSaveOptions; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCountCommand; + + unsafe impl ClassType for NSCountCommand { + type Super = NSScriptCommand; + } +); + +extern_methods!( + unsafe impl NSCountCommand {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSCreateCommand; + + unsafe impl ClassType for NSCreateCommand { + type Super = NSScriptCommand; + } +); + +extern_methods!( + unsafe impl NSCreateCommand { + #[method_id(@__retain_semantics Other createClassDescription)] + pub unsafe fn createClassDescription(&self) -> Id; + + #[method_id(@__retain_semantics Other resolvedKeyDictionary)] + pub unsafe fn resolvedKeyDictionary(&self) -> Id, Shared>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDeleteCommand; + + unsafe impl ClassType for NSDeleteCommand { + type Super = NSScriptCommand; + } +); + +extern_methods!( + unsafe impl NSDeleteCommand { + #[method(setReceiversSpecifier:)] + pub unsafe fn setReceiversSpecifier(&self, receiversRef: Option<&NSScriptObjectSpecifier>); + + #[method_id(@__retain_semantics Other keySpecifier)] + pub unsafe fn keySpecifier(&self) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSExistsCommand; + + unsafe impl ClassType for NSExistsCommand { + type Super = NSScriptCommand; + } +); + +extern_methods!( + unsafe impl NSExistsCommand {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSGetCommand; + + unsafe impl ClassType for NSGetCommand { + type Super = NSScriptCommand; + } +); + +extern_methods!( + unsafe impl NSGetCommand {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSMoveCommand; + + unsafe impl ClassType for NSMoveCommand { + type Super = NSScriptCommand; + } +); + +extern_methods!( + unsafe impl NSMoveCommand { + #[method(setReceiversSpecifier:)] + pub unsafe fn setReceiversSpecifier(&self, receiversRef: Option<&NSScriptObjectSpecifier>); + + #[method_id(@__retain_semantics Other keySpecifier)] + pub unsafe fn keySpecifier(&self) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSQuitCommand; + + unsafe impl ClassType for NSQuitCommand { + type Super = NSScriptCommand; + } +); + +extern_methods!( + unsafe impl NSQuitCommand { + #[method(saveOptions)] + pub unsafe fn saveOptions(&self) -> NSSaveOptions; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSSetCommand; + + unsafe impl ClassType for NSSetCommand { + type Super = NSScriptCommand; + } +); + +extern_methods!( + unsafe impl NSSetCommand { + #[method(setReceiversSpecifier:)] + pub unsafe fn setReceiversSpecifier(&self, receiversRef: Option<&NSScriptObjectSpecifier>); + + #[method_id(@__retain_semantics Other keySpecifier)] + pub unsafe fn keySpecifier(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSScriptSuiteRegistry.rs b/crates/icrate/src/generated/Foundation/NSScriptSuiteRegistry.rs new file mode 100644 index 000000000..0b5012a5d --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSScriptSuiteRegistry.rs @@ -0,0 +1,85 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSScriptSuiteRegistry; + + unsafe impl ClassType for NSScriptSuiteRegistry { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSScriptSuiteRegistry { + #[method_id(@__retain_semantics Other sharedScriptSuiteRegistry)] + pub unsafe fn sharedScriptSuiteRegistry() -> Id; + + #[method(setSharedScriptSuiteRegistry:)] + pub unsafe fn setSharedScriptSuiteRegistry(registry: &NSScriptSuiteRegistry); + + #[method(loadSuitesFromBundle:)] + pub unsafe fn loadSuitesFromBundle(&self, bundle: &NSBundle); + + #[method(loadSuiteWithDictionary:fromBundle:)] + pub unsafe fn loadSuiteWithDictionary_fromBundle( + &self, + suiteDeclaration: &NSDictionary, + bundle: &NSBundle, + ); + + #[method(registerClassDescription:)] + pub unsafe fn registerClassDescription(&self, classDescription: &NSScriptClassDescription); + + #[method(registerCommandDescription:)] + pub unsafe fn registerCommandDescription( + &self, + commandDescription: &NSScriptCommandDescription, + ); + + #[method_id(@__retain_semantics Other suiteNames)] + pub unsafe fn suiteNames(&self) -> Id, Shared>; + + #[method(appleEventCodeForSuite:)] + pub unsafe fn appleEventCodeForSuite(&self, suiteName: &NSString) -> FourCharCode; + + #[method_id(@__retain_semantics Other bundleForSuite:)] + pub unsafe fn bundleForSuite(&self, suiteName: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other classDescriptionsInSuite:)] + pub unsafe fn classDescriptionsInSuite( + &self, + suiteName: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other commandDescriptionsInSuite:)] + pub unsafe fn commandDescriptionsInSuite( + &self, + suiteName: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other suiteForAppleEventCode:)] + pub unsafe fn suiteForAppleEventCode( + &self, + appleEventCode: FourCharCode, + ) -> Option>; + + #[method_id(@__retain_semantics Other classDescriptionWithAppleEventCode:)] + pub unsafe fn classDescriptionWithAppleEventCode( + &self, + appleEventCode: FourCharCode, + ) -> Option>; + + #[method_id(@__retain_semantics Other commandDescriptionWithAppleEventClass:andAppleEventCode:)] + pub unsafe fn commandDescriptionWithAppleEventClass_andAppleEventCode( + &self, + appleEventClassCode: FourCharCode, + appleEventIDCode: FourCharCode, + ) -> Option>; + + #[method_id(@__retain_semantics Other aeteResource:)] + pub unsafe fn aeteResource(&self, languageName: &NSString) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSScriptWhoseTests.rs b/crates/icrate/src/generated/Foundation/NSScriptWhoseTests.rs new file mode 100644 index 000000000..310fa731c --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSScriptWhoseTests.rs @@ -0,0 +1,165 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSTestComparisonOperation { + NSEqualToComparison = 0, + NSLessThanOrEqualToComparison = 1, + NSLessThanComparison = 2, + NSGreaterThanOrEqualToComparison = 3, + NSGreaterThanComparison = 4, + NSBeginsWithComparison = 5, + NSEndsWithComparison = 6, + NSContainsComparison = 7, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSScriptWhoseTest; + + unsafe impl ClassType for NSScriptWhoseTest { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSScriptWhoseTest { + #[method(isTrue)] + pub unsafe fn isTrue(&self) -> bool; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + inCoder: &NSCoder, + ) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSLogicalTest; + + unsafe impl ClassType for NSLogicalTest { + type Super = NSScriptWhoseTest; + } +); + +extern_methods!( + unsafe impl NSLogicalTest { + #[method_id(@__retain_semantics Init initAndTestWithTests:)] + pub unsafe fn initAndTestWithTests( + this: Option>, + subTests: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Init initOrTestWithTests:)] + pub unsafe fn initOrTestWithTests( + this: Option>, + subTests: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Init initNotTestWithTest:)] + pub unsafe fn initNotTestWithTest( + this: Option>, + subTest: &NSScriptWhoseTest, + ) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSSpecifierTest; + + unsafe impl ClassType for NSSpecifierTest { + type Super = NSScriptWhoseTest; + } +); + +extern_methods!( + unsafe impl NSSpecifierTest { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + inCoder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithObjectSpecifier:comparisonOperator:testObject:)] + pub unsafe fn initWithObjectSpecifier_comparisonOperator_testObject( + this: Option>, + obj1: Option<&NSScriptObjectSpecifier>, + compOp: NSTestComparisonOperation, + obj2: Option<&Object>, + ) -> Id; + } +); + +extern_methods!( + /// NSComparisonMethods + unsafe impl NSObject { + #[method(isEqualTo:)] + pub unsafe fn isEqualTo(&self, object: Option<&Object>) -> bool; + + #[method(isLessThanOrEqualTo:)] + pub unsafe fn isLessThanOrEqualTo(&self, object: Option<&Object>) -> bool; + + #[method(isLessThan:)] + pub unsafe fn isLessThan(&self, object: Option<&Object>) -> bool; + + #[method(isGreaterThanOrEqualTo:)] + pub unsafe fn isGreaterThanOrEqualTo(&self, object: Option<&Object>) -> bool; + + #[method(isGreaterThan:)] + pub unsafe fn isGreaterThan(&self, object: Option<&Object>) -> bool; + + #[method(isNotEqualTo:)] + pub unsafe fn isNotEqualTo(&self, object: Option<&Object>) -> bool; + + #[method(doesContain:)] + pub unsafe fn doesContain(&self, object: &Object) -> bool; + + #[method(isLike:)] + pub unsafe fn isLike(&self, object: &NSString) -> bool; + + #[method(isCaseInsensitiveLike:)] + pub unsafe fn isCaseInsensitiveLike(&self, object: &NSString) -> bool; + } +); + +extern_methods!( + /// NSScriptingComparisonMethods + unsafe impl NSObject { + #[method(scriptingIsEqualTo:)] + pub unsafe fn scriptingIsEqualTo(&self, object: &Object) -> bool; + + #[method(scriptingIsLessThanOrEqualTo:)] + pub unsafe fn scriptingIsLessThanOrEqualTo(&self, object: &Object) -> bool; + + #[method(scriptingIsLessThan:)] + pub unsafe fn scriptingIsLessThan(&self, object: &Object) -> bool; + + #[method(scriptingIsGreaterThanOrEqualTo:)] + pub unsafe fn scriptingIsGreaterThanOrEqualTo(&self, object: &Object) -> bool; + + #[method(scriptingIsGreaterThan:)] + pub unsafe fn scriptingIsGreaterThan(&self, object: &Object) -> bool; + + #[method(scriptingBeginsWith:)] + pub unsafe fn scriptingBeginsWith(&self, object: &Object) -> bool; + + #[method(scriptingEndsWith:)] + pub unsafe fn scriptingEndsWith(&self, object: &Object) -> bool; + + #[method(scriptingContains:)] + pub unsafe fn scriptingContains(&self, object: &Object) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSSet.rs b/crates/icrate/src/generated/Foundation/NSSet.rs new file mode 100644 index 000000000..a97fb9074 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSSet.rs @@ -0,0 +1,282 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSSet { + _inner0: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSSet { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSSet { + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other member:)] + pub unsafe fn member(&self, object: &ObjectType) -> Option>; + + #[method_id(@__retain_semantics Other objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithObjects:count:)] + pub unsafe fn initWithObjects_count( + this: Option>, + objects: *mut NonNull, + cnt: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_methods!( + /// NSExtendedSet + unsafe impl NSSet { + #[method_id(@__retain_semantics Other allObjects)] + pub unsafe fn allObjects(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other anyObject)] + pub unsafe fn anyObject(&self) -> Option>; + + #[method(containsObject:)] + pub unsafe fn containsObject(&self, anObject: &ObjectType) -> bool; + + #[method_id(@__retain_semantics Other description)] + pub unsafe fn description(&self) -> Id; + + #[method_id(@__retain_semantics Other descriptionWithLocale:)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + + #[method(intersectsSet:)] + pub unsafe fn intersectsSet(&self, otherSet: &NSSet) -> bool; + + #[method(isEqualToSet:)] + pub unsafe fn isEqualToSet(&self, otherSet: &NSSet) -> bool; + + #[method(isSubsetOfSet:)] + pub unsafe fn isSubsetOfSet(&self, otherSet: &NSSet) -> bool; + + #[method(makeObjectsPerformSelector:)] + pub unsafe fn makeObjectsPerformSelector(&self, aSelector: Sel); + + #[method(makeObjectsPerformSelector:withObject:)] + pub unsafe fn makeObjectsPerformSelector_withObject( + &self, + aSelector: Sel, + argument: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other setByAddingObject:)] + pub unsafe fn setByAddingObject( + &self, + anObject: &ObjectType, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other setByAddingObjectsFromSet:)] + pub unsafe fn setByAddingObjectsFromSet( + &self, + other: &NSSet, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other setByAddingObjectsFromArray:)] + pub unsafe fn setByAddingObjectsFromArray( + &self, + other: &NSArray, + ) -> Id, Shared>; + + #[method(enumerateObjectsUsingBlock:)] + pub unsafe fn enumerateObjectsUsingBlock( + &self, + block: &Block<(NonNull, NonNull), ()>, + ); + + #[method(enumerateObjectsWithOptions:usingBlock:)] + pub unsafe fn enumerateObjectsWithOptions_usingBlock( + &self, + opts: NSEnumerationOptions, + block: &Block<(NonNull, NonNull), ()>, + ); + + #[method_id(@__retain_semantics Other objectsPassingTest:)] + pub unsafe fn objectsPassingTest( + &self, + predicate: &Block<(NonNull, NonNull), Bool>, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other objectsWithOptions:passingTest:)] + pub unsafe fn objectsWithOptions_passingTest( + &self, + opts: NSEnumerationOptions, + predicate: &Block<(NonNull, NonNull), Bool>, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSSetCreation + unsafe impl NSSet { + #[method_id(@__retain_semantics Other set)] + pub unsafe fn set() -> Id; + + #[method_id(@__retain_semantics Other setWithObject:)] + pub unsafe fn setWithObject(object: &ObjectType) -> Id; + + #[method_id(@__retain_semantics Other setWithObjects:count:)] + pub unsafe fn setWithObjects_count( + objects: NonNull>, + cnt: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other setWithSet:)] + pub unsafe fn setWithSet(set: &NSSet) -> Id; + + #[method_id(@__retain_semantics Other setWithArray:)] + pub unsafe fn setWithArray(array: &NSArray) -> Id; + + #[method_id(@__retain_semantics Init initWithSet:)] + pub unsafe fn initWithSet( + this: Option>, + set: &NSSet, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithSet:copyItems:)] + pub unsafe fn initWithSet_copyItems( + this: Option>, + set: &NSSet, + flag: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithArray:)] + pub unsafe fn initWithArray( + this: Option>, + array: &NSArray, + ) -> Id; + } +); + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSMutableSet { + _inner0: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSMutableSet { + type Super = NSSet; + } +); + +extern_methods!( + unsafe impl NSMutableSet { + #[method(addObject:)] + pub unsafe fn addObject(&self, object: &ObjectType); + + #[method(removeObject:)] + pub unsafe fn removeObject(&self, object: &ObjectType); + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCapacity:)] + pub unsafe fn initWithCapacity( + this: Option>, + numItems: NSUInteger, + ) -> Id; + } +); + +extern_methods!( + /// NSExtendedMutableSet + unsafe impl NSMutableSet { + #[method(addObjectsFromArray:)] + pub unsafe fn addObjectsFromArray(&self, array: &NSArray); + + #[method(intersectSet:)] + pub unsafe fn intersectSet(&self, otherSet: &NSSet); + + #[method(minusSet:)] + pub unsafe fn minusSet(&self, otherSet: &NSSet); + + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + + #[method(unionSet:)] + pub unsafe fn unionSet(&self, otherSet: &NSSet); + + #[method(setSet:)] + pub unsafe fn setSet(&self, otherSet: &NSSet); + } +); + +extern_methods!( + /// NSMutableSetCreation + unsafe impl NSMutableSet { + #[method_id(@__retain_semantics Other setWithCapacity:)] + pub unsafe fn setWithCapacity(numItems: NSUInteger) -> Id; + } +); + +__inner_extern_class!( + #[derive(Debug)] + pub struct NSCountedSet { + _inner0: PhantomData<*mut ObjectType>, + } + + unsafe impl ClassType for NSCountedSet { + type Super = NSMutableSet; + } +); + +extern_methods!( + unsafe impl NSCountedSet { + #[method_id(@__retain_semantics Init initWithCapacity:)] + pub unsafe fn initWithCapacity( + this: Option>, + numItems: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithArray:)] + pub unsafe fn initWithArray( + this: Option>, + array: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithSet:)] + pub unsafe fn initWithSet( + this: Option>, + set: &NSSet, + ) -> Id; + + #[method(countForObject:)] + pub unsafe fn countForObject(&self, object: &ObjectType) -> NSUInteger; + + #[method_id(@__retain_semantics Other objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Id, Shared>; + + #[method(addObject:)] + pub unsafe fn addObject(&self, object: &ObjectType); + + #[method(removeObject:)] + pub unsafe fn removeObject(&self, object: &ObjectType); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSSortDescriptor.rs b/crates/icrate/src/generated/Foundation/NSSortDescriptor.rs new file mode 100644 index 000000000..a44a3c471 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSSortDescriptor.rs @@ -0,0 +1,140 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSSortDescriptor; + + unsafe impl ClassType for NSSortDescriptor { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSSortDescriptor { + #[method_id(@__retain_semantics Other sortDescriptorWithKey:ascending:)] + pub unsafe fn sortDescriptorWithKey_ascending( + key: Option<&NSString>, + ascending: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other sortDescriptorWithKey:ascending:selector:)] + pub unsafe fn sortDescriptorWithKey_ascending_selector( + key: Option<&NSString>, + ascending: bool, + selector: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithKey:ascending:)] + pub unsafe fn initWithKey_ascending( + this: Option>, + key: Option<&NSString>, + ascending: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithKey:ascending:selector:)] + pub unsafe fn initWithKey_ascending_selector( + this: Option>, + key: Option<&NSString>, + ascending: bool, + selector: OptionSel, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Other key)] + pub unsafe fn key(&self) -> Option>; + + #[method(ascending)] + pub unsafe fn ascending(&self) -> bool; + + #[method(selector)] + pub unsafe fn selector(&self) -> OptionSel; + + #[method(allowEvaluation)] + pub unsafe fn allowEvaluation(&self); + + #[method_id(@__retain_semantics Other sortDescriptorWithKey:ascending:comparator:)] + pub unsafe fn sortDescriptorWithKey_ascending_comparator( + key: Option<&NSString>, + ascending: bool, + cmptr: NSComparator, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithKey:ascending:comparator:)] + pub unsafe fn initWithKey_ascending_comparator( + this: Option>, + key: Option<&NSString>, + ascending: bool, + cmptr: NSComparator, + ) -> Id; + + #[method(comparator)] + pub unsafe fn comparator(&self) -> NSComparator; + + #[method(compareObject:toObject:)] + pub unsafe fn compareObject_toObject( + &self, + object1: &Object, + object2: &Object, + ) -> NSComparisonResult; + + #[method_id(@__retain_semantics Other reversedSortDescriptor)] + pub unsafe fn reversedSortDescriptor(&self) -> Id; + } +); + +extern_methods!( + /// NSSortDescriptorSorting + unsafe impl NSSet { + #[method_id(@__retain_semantics Other sortedArrayUsingDescriptors:)] + pub unsafe fn sortedArrayUsingDescriptors( + &self, + sortDescriptors: &NSArray, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSSortDescriptorSorting + unsafe impl NSArray { + #[method_id(@__retain_semantics Other sortedArrayUsingDescriptors:)] + pub unsafe fn sortedArrayUsingDescriptors( + &self, + sortDescriptors: &NSArray, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSSortDescriptorSorting + unsafe impl NSMutableArray { + #[method(sortUsingDescriptors:)] + pub unsafe fn sortUsingDescriptors(&self, sortDescriptors: &NSArray); + } +); + +extern_methods!( + /// NSKeyValueSorting + unsafe impl NSOrderedSet { + #[method_id(@__retain_semantics Other sortedArrayUsingDescriptors:)] + pub unsafe fn sortedArrayUsingDescriptors( + &self, + sortDescriptors: &NSArray, + ) -> Id, Shared>; + } +); + +extern_methods!( + /// NSKeyValueSorting + unsafe impl NSMutableOrderedSet { + #[method(sortUsingDescriptors:)] + pub unsafe fn sortUsingDescriptors(&self, sortDescriptors: &NSArray); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSSpellServer.rs b/crates/icrate/src/generated/Foundation/NSSpellServer.rs new file mode 100644 index 000000000..66e78dd96 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSSpellServer.rs @@ -0,0 +1,134 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSSpellServer; + + unsafe impl ClassType for NSSpellServer { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSSpellServer { + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSSpellServerDelegate>); + + #[method(registerLanguage:byVendor:)] + pub unsafe fn registerLanguage_byVendor( + &self, + language: Option<&NSString>, + vendor: Option<&NSString>, + ) -> bool; + + #[method(isWordInUserDictionaries:caseSensitive:)] + pub unsafe fn isWordInUserDictionaries_caseSensitive( + &self, + word: &NSString, + flag: bool, + ) -> bool; + + #[method(run)] + pub unsafe fn run(&self); + } +); + +extern_static!(NSGrammarRange: &'static NSString); + +extern_static!(NSGrammarUserDescription: &'static NSString); + +extern_static!(NSGrammarCorrections: &'static NSString); + +extern_protocol!( + pub struct NSSpellServerDelegate; + + unsafe impl NSSpellServerDelegate { + #[optional] + #[method(spellServer:findMisspelledWordInString:language:wordCount:countOnly:)] + pub unsafe fn spellServer_findMisspelledWordInString_language_wordCount_countOnly( + &self, + sender: &NSSpellServer, + stringToCheck: &NSString, + language: &NSString, + wordCount: NonNull, + countOnly: bool, + ) -> NSRange; + + #[optional] + #[method_id(@__retain_semantics Other spellServer:suggestGuessesForWord:inLanguage:)] + pub unsafe fn spellServer_suggestGuessesForWord_inLanguage( + &self, + sender: &NSSpellServer, + word: &NSString, + language: &NSString, + ) -> Option, Shared>>; + + #[optional] + #[method(spellServer:didLearnWord:inLanguage:)] + pub unsafe fn spellServer_didLearnWord_inLanguage( + &self, + sender: &NSSpellServer, + word: &NSString, + language: &NSString, + ); + + #[optional] + #[method(spellServer:didForgetWord:inLanguage:)] + pub unsafe fn spellServer_didForgetWord_inLanguage( + &self, + sender: &NSSpellServer, + word: &NSString, + language: &NSString, + ); + + #[optional] + #[method_id(@__retain_semantics Other spellServer:suggestCompletionsForPartialWordRange:inString:language:)] + pub unsafe fn spellServer_suggestCompletionsForPartialWordRange_inString_language( + &self, + sender: &NSSpellServer, + range: NSRange, + string: &NSString, + language: &NSString, + ) -> Option, Shared>>; + + #[optional] + #[method(spellServer:checkGrammarInString:language:details:)] + pub unsafe fn spellServer_checkGrammarInString_language_details( + &self, + sender: &NSSpellServer, + stringToCheck: &NSString, + language: Option<&NSString>, + details: *mut *mut NSArray>, + ) -> NSRange; + + #[optional] + #[method_id(@__retain_semantics Other spellServer:checkString:offset:types:options:orthography:wordCount:)] + pub unsafe fn spellServer_checkString_offset_types_options_orthography_wordCount( + &self, + sender: &NSSpellServer, + stringToCheck: &NSString, + offset: NSUInteger, + checkingTypes: NSTextCheckingTypes, + options: Option<&NSDictionary>, + orthography: Option<&NSOrthography>, + wordCount: NonNull, + ) -> Option, Shared>>; + + #[optional] + #[method(spellServer:recordResponse:toCorrection:forWord:language:)] + pub unsafe fn spellServer_recordResponse_toCorrection_forWord_language( + &self, + sender: &NSSpellServer, + response: NSUInteger, + correction: &NSString, + word: &NSString, + language: &NSString, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSStream.rs b/crates/icrate/src/generated/Foundation/NSStream.rs new file mode 100644 index 000000000..0e1b45bd6 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSStream.rs @@ -0,0 +1,308 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSStreamPropertyKey = NSString; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSStreamStatus { + NSStreamStatusNotOpen = 0, + NSStreamStatusOpening = 1, + NSStreamStatusOpen = 2, + NSStreamStatusReading = 3, + NSStreamStatusWriting = 4, + NSStreamStatusAtEnd = 5, + NSStreamStatusClosed = 6, + NSStreamStatusError = 7, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSStreamEvent { + NSStreamEventNone = 0, + NSStreamEventOpenCompleted = 1 << 0, + NSStreamEventHasBytesAvailable = 1 << 1, + NSStreamEventHasSpaceAvailable = 1 << 2, + NSStreamEventErrorOccurred = 1 << 3, + NSStreamEventEndEncountered = 1 << 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSStream; + + unsafe impl ClassType for NSStream { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSStream { + #[method(open)] + pub unsafe fn open(&self); + + #[method(close)] + pub unsafe fn close(&self); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSStreamDelegate>); + + #[method_id(@__retain_semantics Other propertyForKey:)] + pub unsafe fn propertyForKey( + &self, + key: &NSStreamPropertyKey, + ) -> Option>; + + #[method(setProperty:forKey:)] + pub unsafe fn setProperty_forKey( + &self, + property: Option<&Object>, + key: &NSStreamPropertyKey, + ) -> bool; + + #[method(scheduleInRunLoop:forMode:)] + pub unsafe fn scheduleInRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + + #[method(removeFromRunLoop:forMode:)] + pub unsafe fn removeFromRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + + #[method(streamStatus)] + pub unsafe fn streamStatus(&self) -> NSStreamStatus; + + #[method_id(@__retain_semantics Other streamError)] + pub unsafe fn streamError(&self) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSInputStream; + + unsafe impl ClassType for NSInputStream { + type Super = NSStream; + } +); + +extern_methods!( + unsafe impl NSInputStream { + #[method(read:maxLength:)] + pub unsafe fn read_maxLength(&self, buffer: NonNull, len: NSUInteger) -> NSInteger; + + #[method(getBuffer:length:)] + pub unsafe fn getBuffer_length( + &self, + buffer: NonNull<*mut u8>, + len: NonNull, + ) -> bool; + + #[method(hasBytesAvailable)] + pub unsafe fn hasBytesAvailable(&self) -> bool; + + #[method_id(@__retain_semantics Init initWithData:)] + pub unsafe fn initWithData( + this: Option>, + data: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithURL:)] + pub unsafe fn initWithURL( + this: Option>, + url: &NSURL, + ) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSOutputStream; + + unsafe impl ClassType for NSOutputStream { + type Super = NSStream; + } +); + +extern_methods!( + unsafe impl NSOutputStream { + #[method(write:maxLength:)] + pub unsafe fn write_maxLength(&self, buffer: NonNull, len: NSUInteger) -> NSInteger; + + #[method(hasSpaceAvailable)] + pub unsafe fn hasSpaceAvailable(&self) -> bool; + + #[method_id(@__retain_semantics Init initToMemory)] + pub unsafe fn initToMemory(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initToBuffer:capacity:)] + pub unsafe fn initToBuffer_capacity( + this: Option>, + buffer: NonNull, + capacity: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithURL:append:)] + pub unsafe fn initWithURL_append( + this: Option>, + url: &NSURL, + shouldAppend: bool, + ) -> Option>; + } +); + +extern_methods!( + /// NSSocketStreamCreationExtensions + unsafe impl NSStream { + #[method(getStreamsToHostWithName:port:inputStream:outputStream:)] + pub unsafe fn getStreamsToHostWithName_port_inputStream_outputStream( + hostname: &NSString, + port: NSInteger, + inputStream: *mut *mut NSInputStream, + outputStream: *mut *mut NSOutputStream, + ); + + #[method(getStreamsToHost:port:inputStream:outputStream:)] + pub unsafe fn getStreamsToHost_port_inputStream_outputStream( + host: &NSHost, + port: NSInteger, + inputStream: *mut *mut NSInputStream, + outputStream: *mut *mut NSOutputStream, + ); + } +); + +extern_methods!( + /// NSStreamBoundPairCreationExtensions + unsafe impl NSStream { + #[method(getBoundStreamsWithBufferSize:inputStream:outputStream:)] + pub unsafe fn getBoundStreamsWithBufferSize_inputStream_outputStream( + bufferSize: NSUInteger, + inputStream: *mut *mut NSInputStream, + outputStream: *mut *mut NSOutputStream, + ); + } +); + +extern_methods!( + /// NSInputStreamExtensions + unsafe impl NSInputStream { + #[method_id(@__retain_semantics Init initWithFileAtPath:)] + pub unsafe fn initWithFileAtPath( + this: Option>, + path: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other inputStreamWithData:)] + pub unsafe fn inputStreamWithData(data: &NSData) -> Option>; + + #[method_id(@__retain_semantics Other inputStreamWithFileAtPath:)] + pub unsafe fn inputStreamWithFileAtPath(path: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other inputStreamWithURL:)] + pub unsafe fn inputStreamWithURL(url: &NSURL) -> Option>; + } +); + +extern_methods!( + /// NSOutputStreamExtensions + unsafe impl NSOutputStream { + #[method_id(@__retain_semantics Init initToFileAtPath:append:)] + pub unsafe fn initToFileAtPath_append( + this: Option>, + path: &NSString, + shouldAppend: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other outputStreamToMemory)] + pub unsafe fn outputStreamToMemory() -> Id; + + #[method_id(@__retain_semantics Other outputStreamToBuffer:capacity:)] + pub unsafe fn outputStreamToBuffer_capacity( + buffer: NonNull, + capacity: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other outputStreamToFileAtPath:append:)] + pub unsafe fn outputStreamToFileAtPath_append( + path: &NSString, + shouldAppend: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other outputStreamWithURL:append:)] + pub unsafe fn outputStreamWithURL_append( + url: &NSURL, + shouldAppend: bool, + ) -> Option>; + } +); + +extern_protocol!( + pub struct NSStreamDelegate; + + unsafe impl NSStreamDelegate { + #[optional] + #[method(stream:handleEvent:)] + pub unsafe fn stream_handleEvent(&self, aStream: &NSStream, eventCode: NSStreamEvent); + } +); + +extern_static!(NSStreamSocketSecurityLevelKey: &'static NSStreamPropertyKey); + +pub type NSStreamSocketSecurityLevel = NSString; + +extern_static!(NSStreamSocketSecurityLevelNone: &'static NSStreamSocketSecurityLevel); + +extern_static!(NSStreamSocketSecurityLevelSSLv2: &'static NSStreamSocketSecurityLevel); + +extern_static!(NSStreamSocketSecurityLevelSSLv3: &'static NSStreamSocketSecurityLevel); + +extern_static!(NSStreamSocketSecurityLevelTLSv1: &'static NSStreamSocketSecurityLevel); + +extern_static!(NSStreamSocketSecurityLevelNegotiatedSSL: &'static NSStreamSocketSecurityLevel); + +extern_static!(NSStreamSOCKSProxyConfigurationKey: &'static NSStreamPropertyKey); + +pub type NSStreamSOCKSProxyConfiguration = NSString; + +extern_static!(NSStreamSOCKSProxyHostKey: &'static NSStreamSOCKSProxyConfiguration); + +extern_static!(NSStreamSOCKSProxyPortKey: &'static NSStreamSOCKSProxyConfiguration); + +extern_static!(NSStreamSOCKSProxyVersionKey: &'static NSStreamSOCKSProxyConfiguration); + +extern_static!(NSStreamSOCKSProxyUserKey: &'static NSStreamSOCKSProxyConfiguration); + +extern_static!(NSStreamSOCKSProxyPasswordKey: &'static NSStreamSOCKSProxyConfiguration); + +pub type NSStreamSOCKSProxyVersion = NSString; + +extern_static!(NSStreamSOCKSProxyVersion4: &'static NSStreamSOCKSProxyVersion); + +extern_static!(NSStreamSOCKSProxyVersion5: &'static NSStreamSOCKSProxyVersion); + +extern_static!(NSStreamDataWrittenToMemoryStreamKey: &'static NSStreamPropertyKey); + +extern_static!(NSStreamFileCurrentOffsetKey: &'static NSStreamPropertyKey); + +extern_static!(NSStreamSocketSSLErrorDomain: &'static NSErrorDomain); + +extern_static!(NSStreamSOCKSErrorDomain: &'static NSErrorDomain); + +extern_static!(NSStreamNetworkServiceType: &'static NSStreamPropertyKey); + +pub type NSStreamNetworkServiceTypeValue = NSString; + +extern_static!(NSStreamNetworkServiceTypeVoIP: &'static NSStreamNetworkServiceTypeValue); + +extern_static!(NSStreamNetworkServiceTypeVideo: &'static NSStreamNetworkServiceTypeValue); + +extern_static!(NSStreamNetworkServiceTypeBackground: &'static NSStreamNetworkServiceTypeValue); + +extern_static!(NSStreamNetworkServiceTypeVoice: &'static NSStreamNetworkServiceTypeValue); + +extern_static!(NSStreamNetworkServiceTypeCallSignaling: &'static NSStreamNetworkServiceTypeValue); diff --git a/crates/icrate/src/generated/Foundation/NSString.rs b/crates/icrate/src/generated/Foundation/NSString.rs new file mode 100644 index 000000000..a9c5a3492 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSString.rs @@ -0,0 +1,935 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type unichar = c_ushort; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSStringCompareOptions { + NSCaseInsensitiveSearch = 1, + NSLiteralSearch = 2, + NSBackwardsSearch = 4, + NSAnchoredSearch = 8, + NSNumericSearch = 64, + NSDiacriticInsensitiveSearch = 128, + NSWidthInsensitiveSearch = 256, + NSForcedOrderingSearch = 512, + NSRegularExpressionSearch = 1024, + } +); + +pub type NSStringEncoding = NSUInteger; + +ns_enum!( + #[underlying(NSStringEncoding)] + pub enum { + NSASCIIStringEncoding = 1, + NSNEXTSTEPStringEncoding = 2, + NSJapaneseEUCStringEncoding = 3, + NSUTF8StringEncoding = 4, + NSISOLatin1StringEncoding = 5, + NSSymbolStringEncoding = 6, + NSNonLossyASCIIStringEncoding = 7, + NSShiftJISStringEncoding = 8, + NSISOLatin2StringEncoding = 9, + NSUnicodeStringEncoding = 10, + NSWindowsCP1251StringEncoding = 11, + NSWindowsCP1252StringEncoding = 12, + NSWindowsCP1253StringEncoding = 13, + NSWindowsCP1254StringEncoding = 14, + NSWindowsCP1250StringEncoding = 15, + NSISO2022JPStringEncoding = 21, + NSMacOSRomanStringEncoding = 30, + NSUTF16StringEncoding = NSUnicodeStringEncoding, + NSUTF16BigEndianStringEncoding = 0x90000100, + NSUTF16LittleEndianStringEncoding = 0x94000100, + NSUTF32StringEncoding = 0x8c000100, + NSUTF32BigEndianStringEncoding = 0x98000100, + NSUTF32LittleEndianStringEncoding = 0x9c000100, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSStringEncodingConversionOptions { + NSStringEncodingConversionAllowLossy = 1, + NSStringEncodingConversionExternalRepresentation = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSString; + + unsafe impl ClassType for NSString { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSString { + #[method(length)] + pub fn length(&self) -> NSUInteger; + + #[method(characterAtIndex:)] + pub unsafe fn characterAtIndex(&self, index: NSUInteger) -> unichar; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSStringEnumerationOptions { + NSStringEnumerationByLines = 0, + NSStringEnumerationByParagraphs = 1, + NSStringEnumerationByComposedCharacterSequences = 2, + NSStringEnumerationByWords = 3, + NSStringEnumerationBySentences = 4, + NSStringEnumerationByCaretPositions = 5, + NSStringEnumerationByDeletionClusters = 6, + NSStringEnumerationReverse = 1 << 8, + NSStringEnumerationSubstringNotRequired = 1 << 9, + NSStringEnumerationLocalized = 1 << 10, + } +); + +pub type NSStringTransform = NSString; + +extern_static!(NSStringTransformLatinToKatakana: &'static NSStringTransform); + +extern_static!(NSStringTransformLatinToHiragana: &'static NSStringTransform); + +extern_static!(NSStringTransformLatinToHangul: &'static NSStringTransform); + +extern_static!(NSStringTransformLatinToArabic: &'static NSStringTransform); + +extern_static!(NSStringTransformLatinToHebrew: &'static NSStringTransform); + +extern_static!(NSStringTransformLatinToThai: &'static NSStringTransform); + +extern_static!(NSStringTransformLatinToCyrillic: &'static NSStringTransform); + +extern_static!(NSStringTransformLatinToGreek: &'static NSStringTransform); + +extern_static!(NSStringTransformToLatin: &'static NSStringTransform); + +extern_static!(NSStringTransformMandarinToLatin: &'static NSStringTransform); + +extern_static!(NSStringTransformHiraganaToKatakana: &'static NSStringTransform); + +extern_static!(NSStringTransformFullwidthToHalfwidth: &'static NSStringTransform); + +extern_static!(NSStringTransformToXMLHex: &'static NSStringTransform); + +extern_static!(NSStringTransformToUnicodeName: &'static NSStringTransform); + +extern_static!(NSStringTransformStripCombiningMarks: &'static NSStringTransform); + +extern_static!(NSStringTransformStripDiacritics: &'static NSStringTransform); + +extern_methods!( + /// NSStringExtensionMethods + unsafe impl NSString { + #[method_id(@__retain_semantics Other substringFromIndex:)] + pub unsafe fn substringFromIndex(&self, from: NSUInteger) -> Id; + + #[method_id(@__retain_semantics Other substringToIndex:)] + pub unsafe fn substringToIndex(&self, to: NSUInteger) -> Id; + + #[method_id(@__retain_semantics Other substringWithRange:)] + pub unsafe fn substringWithRange(&self, range: NSRange) -> Id; + + #[method(getCharacters:range:)] + pub unsafe fn getCharacters_range(&self, buffer: NonNull, range: NSRange); + + #[method(compare:)] + pub unsafe fn compare(&self, string: &NSString) -> NSComparisonResult; + + #[method(compare:options:)] + pub unsafe fn compare_options( + &self, + string: &NSString, + mask: NSStringCompareOptions, + ) -> NSComparisonResult; + + #[method(compare:options:range:)] + pub unsafe fn compare_options_range( + &self, + string: &NSString, + mask: NSStringCompareOptions, + rangeOfReceiverToCompare: NSRange, + ) -> NSComparisonResult; + + #[method(compare:options:range:locale:)] + pub unsafe fn compare_options_range_locale( + &self, + string: &NSString, + mask: NSStringCompareOptions, + rangeOfReceiverToCompare: NSRange, + locale: Option<&Object>, + ) -> NSComparisonResult; + + #[method(caseInsensitiveCompare:)] + pub unsafe fn caseInsensitiveCompare(&self, string: &NSString) -> NSComparisonResult; + + #[method(localizedCompare:)] + pub unsafe fn localizedCompare(&self, string: &NSString) -> NSComparisonResult; + + #[method(localizedCaseInsensitiveCompare:)] + pub unsafe fn localizedCaseInsensitiveCompare( + &self, + string: &NSString, + ) -> NSComparisonResult; + + #[method(localizedStandardCompare:)] + pub unsafe fn localizedStandardCompare(&self, string: &NSString) -> NSComparisonResult; + + #[method(isEqualToString:)] + pub unsafe fn isEqualToString(&self, aString: &NSString) -> bool; + + #[method(hasPrefix:)] + pub unsafe fn hasPrefix(&self, str: &NSString) -> bool; + + #[method(hasSuffix:)] + pub unsafe fn hasSuffix(&self, str: &NSString) -> bool; + + #[method_id(@__retain_semantics Other commonPrefixWithString:options:)] + pub unsafe fn commonPrefixWithString_options( + &self, + str: &NSString, + mask: NSStringCompareOptions, + ) -> Id; + + #[method(containsString:)] + pub unsafe fn containsString(&self, str: &NSString) -> bool; + + #[method(localizedCaseInsensitiveContainsString:)] + pub unsafe fn localizedCaseInsensitiveContainsString(&self, str: &NSString) -> bool; + + #[method(localizedStandardContainsString:)] + pub unsafe fn localizedStandardContainsString(&self, str: &NSString) -> bool; + + #[method(localizedStandardRangeOfString:)] + pub unsafe fn localizedStandardRangeOfString(&self, str: &NSString) -> NSRange; + + #[method(rangeOfString:)] + pub unsafe fn rangeOfString(&self, searchString: &NSString) -> NSRange; + + #[method(rangeOfString:options:)] + pub unsafe fn rangeOfString_options( + &self, + searchString: &NSString, + mask: NSStringCompareOptions, + ) -> NSRange; + + #[method(rangeOfString:options:range:)] + pub unsafe fn rangeOfString_options_range( + &self, + searchString: &NSString, + mask: NSStringCompareOptions, + rangeOfReceiverToSearch: NSRange, + ) -> NSRange; + + #[method(rangeOfString:options:range:locale:)] + pub unsafe fn rangeOfString_options_range_locale( + &self, + searchString: &NSString, + mask: NSStringCompareOptions, + rangeOfReceiverToSearch: NSRange, + locale: Option<&NSLocale>, + ) -> NSRange; + + #[method(rangeOfCharacterFromSet:)] + pub unsafe fn rangeOfCharacterFromSet(&self, searchSet: &NSCharacterSet) -> NSRange; + + #[method(rangeOfCharacterFromSet:options:)] + pub unsafe fn rangeOfCharacterFromSet_options( + &self, + searchSet: &NSCharacterSet, + mask: NSStringCompareOptions, + ) -> NSRange; + + #[method(rangeOfCharacterFromSet:options:range:)] + pub unsafe fn rangeOfCharacterFromSet_options_range( + &self, + searchSet: &NSCharacterSet, + mask: NSStringCompareOptions, + rangeOfReceiverToSearch: NSRange, + ) -> NSRange; + + #[method(rangeOfComposedCharacterSequenceAtIndex:)] + pub unsafe fn rangeOfComposedCharacterSequenceAtIndex(&self, index: NSUInteger) -> NSRange; + + #[method(rangeOfComposedCharacterSequencesForRange:)] + pub unsafe fn rangeOfComposedCharacterSequencesForRange(&self, range: NSRange) -> NSRange; + + #[method_id(@__retain_semantics Other stringByAppendingString:)] + pub fn stringByAppendingString(&self, aString: &NSString) -> Id; + + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + + #[method(floatValue)] + pub unsafe fn floatValue(&self) -> c_float; + + #[method(intValue)] + pub unsafe fn intValue(&self) -> c_int; + + #[method(integerValue)] + pub unsafe fn integerValue(&self) -> NSInteger; + + #[method(longLongValue)] + pub unsafe fn longLongValue(&self) -> c_longlong; + + #[method(boolValue)] + pub unsafe fn boolValue(&self) -> bool; + + #[method_id(@__retain_semantics Other uppercaseString)] + pub unsafe fn uppercaseString(&self) -> Id; + + #[method_id(@__retain_semantics Other lowercaseString)] + pub unsafe fn lowercaseString(&self) -> Id; + + #[method_id(@__retain_semantics Other capitalizedString)] + pub unsafe fn capitalizedString(&self) -> Id; + + #[method_id(@__retain_semantics Other localizedUppercaseString)] + pub unsafe fn localizedUppercaseString(&self) -> Id; + + #[method_id(@__retain_semantics Other localizedLowercaseString)] + pub unsafe fn localizedLowercaseString(&self) -> Id; + + #[method_id(@__retain_semantics Other localizedCapitalizedString)] + pub unsafe fn localizedCapitalizedString(&self) -> Id; + + #[method_id(@__retain_semantics Other uppercaseStringWithLocale:)] + pub unsafe fn uppercaseStringWithLocale( + &self, + locale: Option<&NSLocale>, + ) -> Id; + + #[method_id(@__retain_semantics Other lowercaseStringWithLocale:)] + pub unsafe fn lowercaseStringWithLocale( + &self, + locale: Option<&NSLocale>, + ) -> Id; + + #[method_id(@__retain_semantics Other capitalizedStringWithLocale:)] + pub unsafe fn capitalizedStringWithLocale( + &self, + locale: Option<&NSLocale>, + ) -> Id; + + #[method(getLineStart:end:contentsEnd:forRange:)] + pub unsafe fn getLineStart_end_contentsEnd_forRange( + &self, + startPtr: *mut NSUInteger, + lineEndPtr: *mut NSUInteger, + contentsEndPtr: *mut NSUInteger, + range: NSRange, + ); + + #[method(lineRangeForRange:)] + pub unsafe fn lineRangeForRange(&self, range: NSRange) -> NSRange; + + #[method(getParagraphStart:end:contentsEnd:forRange:)] + pub unsafe fn getParagraphStart_end_contentsEnd_forRange( + &self, + startPtr: *mut NSUInteger, + parEndPtr: *mut NSUInteger, + contentsEndPtr: *mut NSUInteger, + range: NSRange, + ); + + #[method(paragraphRangeForRange:)] + pub unsafe fn paragraphRangeForRange(&self, range: NSRange) -> NSRange; + + #[method(enumerateSubstringsInRange:options:usingBlock:)] + pub unsafe fn enumerateSubstringsInRange_options_usingBlock( + &self, + range: NSRange, + opts: NSStringEnumerationOptions, + block: &Block<(*mut NSString, NSRange, NSRange, NonNull), ()>, + ); + + #[method(enumerateLinesUsingBlock:)] + pub unsafe fn enumerateLinesUsingBlock( + &self, + block: &Block<(NonNull, NonNull), ()>, + ); + + #[method(UTF8String)] + pub fn UTF8String(&self) -> *mut c_char; + + #[method(fastestEncoding)] + pub unsafe fn fastestEncoding(&self) -> NSStringEncoding; + + #[method(smallestEncoding)] + pub unsafe fn smallestEncoding(&self) -> NSStringEncoding; + + #[method_id(@__retain_semantics Other dataUsingEncoding:allowLossyConversion:)] + pub unsafe fn dataUsingEncoding_allowLossyConversion( + &self, + encoding: NSStringEncoding, + lossy: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other dataUsingEncoding:)] + pub unsafe fn dataUsingEncoding( + &self, + encoding: NSStringEncoding, + ) -> Option>; + + #[method(canBeConvertedToEncoding:)] + pub unsafe fn canBeConvertedToEncoding(&self, encoding: NSStringEncoding) -> bool; + + #[method(cStringUsingEncoding:)] + pub unsafe fn cStringUsingEncoding(&self, encoding: NSStringEncoding) -> *mut c_char; + + #[method(getCString:maxLength:encoding:)] + pub unsafe fn getCString_maxLength_encoding( + &self, + buffer: NonNull, + maxBufferCount: NSUInteger, + encoding: NSStringEncoding, + ) -> bool; + + #[method(getBytes:maxLength:usedLength:encoding:options:range:remainingRange:)] + pub unsafe fn getBytes_maxLength_usedLength_encoding_options_range_remainingRange( + &self, + buffer: *mut c_void, + maxBufferCount: NSUInteger, + usedBufferCount: *mut NSUInteger, + encoding: NSStringEncoding, + options: NSStringEncodingConversionOptions, + range: NSRange, + leftover: NSRangePointer, + ) -> bool; + + #[method(maximumLengthOfBytesUsingEncoding:)] + pub unsafe fn maximumLengthOfBytesUsingEncoding(&self, enc: NSStringEncoding) + -> NSUInteger; + + #[method(lengthOfBytesUsingEncoding:)] + pub fn lengthOfBytesUsingEncoding(&self, enc: NSStringEncoding) -> NSUInteger; + + #[method(availableStringEncodings)] + pub unsafe fn availableStringEncodings() -> NonNull; + + #[method_id(@__retain_semantics Other localizedNameOfStringEncoding:)] + pub unsafe fn localizedNameOfStringEncoding( + encoding: NSStringEncoding, + ) -> Id; + + #[method(defaultCStringEncoding)] + pub unsafe fn defaultCStringEncoding() -> NSStringEncoding; + + #[method_id(@__retain_semantics Other decomposedStringWithCanonicalMapping)] + pub unsafe fn decomposedStringWithCanonicalMapping(&self) -> Id; + + #[method_id(@__retain_semantics Other precomposedStringWithCanonicalMapping)] + pub unsafe fn precomposedStringWithCanonicalMapping(&self) -> Id; + + #[method_id(@__retain_semantics Other decomposedStringWithCompatibilityMapping)] + pub unsafe fn decomposedStringWithCompatibilityMapping(&self) -> Id; + + #[method_id(@__retain_semantics Other precomposedStringWithCompatibilityMapping)] + pub unsafe fn precomposedStringWithCompatibilityMapping(&self) -> Id; + + #[method_id(@__retain_semantics Other componentsSeparatedByString:)] + pub unsafe fn componentsSeparatedByString( + &self, + separator: &NSString, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other componentsSeparatedByCharactersInSet:)] + pub unsafe fn componentsSeparatedByCharactersInSet( + &self, + separator: &NSCharacterSet, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other stringByTrimmingCharactersInSet:)] + pub unsafe fn stringByTrimmingCharactersInSet( + &self, + set: &NSCharacterSet, + ) -> Id; + + #[method_id(@__retain_semantics Other stringByPaddingToLength:withString:startingAtIndex:)] + pub unsafe fn stringByPaddingToLength_withString_startingAtIndex( + &self, + newLength: NSUInteger, + padString: &NSString, + padIndex: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other stringByFoldingWithOptions:locale:)] + pub unsafe fn stringByFoldingWithOptions_locale( + &self, + options: NSStringCompareOptions, + locale: Option<&NSLocale>, + ) -> Id; + + #[method_id(@__retain_semantics Other stringByReplacingOccurrencesOfString:withString:options:range:)] + pub unsafe fn stringByReplacingOccurrencesOfString_withString_options_range( + &self, + target: &NSString, + replacement: &NSString, + options: NSStringCompareOptions, + searchRange: NSRange, + ) -> Id; + + #[method_id(@__retain_semantics Other stringByReplacingOccurrencesOfString:withString:)] + pub unsafe fn stringByReplacingOccurrencesOfString_withString( + &self, + target: &NSString, + replacement: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other stringByReplacingCharactersInRange:withString:)] + pub unsafe fn stringByReplacingCharactersInRange_withString( + &self, + range: NSRange, + replacement: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other stringByApplyingTransform:reverse:)] + pub unsafe fn stringByApplyingTransform_reverse( + &self, + transform: &NSStringTransform, + reverse: bool, + ) -> Option>; + + #[method(writeToURL:atomically:encoding:error:)] + pub unsafe fn writeToURL_atomically_encoding_error( + &self, + url: &NSURL, + useAuxiliaryFile: bool, + enc: NSStringEncoding, + ) -> Result<(), Id>; + + #[method(writeToFile:atomically:encoding:error:)] + pub unsafe fn writeToFile_atomically_encoding_error( + &self, + path: &NSString, + useAuxiliaryFile: bool, + enc: NSStringEncoding, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other description)] + pub unsafe fn description(&self) -> Id; + + #[method(hash)] + pub unsafe fn hash(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Init initWithCharactersNoCopy:length:freeWhenDone:)] + pub unsafe fn initWithCharactersNoCopy_length_freeWhenDone( + this: Option>, + characters: NonNull, + length: NSUInteger, + freeBuffer: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCharactersNoCopy:length:deallocator:)] + pub unsafe fn initWithCharactersNoCopy_length_deallocator( + this: Option>, + chars: NonNull, + len: NSUInteger, + deallocator: Option<&Block<(NonNull, NSUInteger), ()>>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCharacters:length:)] + pub unsafe fn initWithCharacters_length( + this: Option>, + characters: NonNull, + length: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithUTF8String:)] + pub unsafe fn initWithUTF8String( + this: Option>, + nullTerminatedCString: NonNull, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithString:)] + pub unsafe fn initWithString( + this: Option>, + aString: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithData:encoding:)] + pub unsafe fn initWithData_encoding( + this: Option>, + data: &NSData, + encoding: NSStringEncoding, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithBytes:length:encoding:)] + pub unsafe fn initWithBytes_length_encoding( + this: Option>, + bytes: NonNull, + len: NSUInteger, + encoding: NSStringEncoding, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithBytesNoCopy:length:encoding:freeWhenDone:)] + pub unsafe fn initWithBytesNoCopy_length_encoding_freeWhenDone( + this: Option>, + bytes: NonNull, + len: NSUInteger, + encoding: NSStringEncoding, + freeBuffer: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithBytesNoCopy:length:encoding:deallocator:)] + pub unsafe fn initWithBytesNoCopy_length_encoding_deallocator( + this: Option>, + bytes: NonNull, + len: NSUInteger, + encoding: NSStringEncoding, + deallocator: Option<&Block<(NonNull, NSUInteger), ()>>, + ) -> Option>; + + #[method_id(@__retain_semantics Other string)] + pub unsafe fn string() -> Id; + + #[method_id(@__retain_semantics Other stringWithString:)] + pub unsafe fn stringWithString(string: &NSString) -> Id; + + #[method_id(@__retain_semantics Other stringWithCharacters:length:)] + pub unsafe fn stringWithCharacters_length( + characters: NonNull, + length: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other stringWithUTF8String:)] + pub unsafe fn stringWithUTF8String( + nullTerminatedCString: NonNull, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithCString:encoding:)] + pub unsafe fn initWithCString_encoding( + this: Option>, + nullTerminatedCString: NonNull, + encoding: NSStringEncoding, + ) -> Option>; + + #[method_id(@__retain_semantics Other stringWithCString:encoding:)] + pub unsafe fn stringWithCString_encoding( + cString: NonNull, + enc: NSStringEncoding, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:encoding:error:)] + pub unsafe fn initWithContentsOfURL_encoding_error( + this: Option>, + url: &NSURL, + enc: NSStringEncoding, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithContentsOfFile:encoding:error:)] + pub unsafe fn initWithContentsOfFile_encoding_error( + this: Option>, + path: &NSString, + enc: NSStringEncoding, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other stringWithContentsOfURL:encoding:error:)] + pub unsafe fn stringWithContentsOfURL_encoding_error( + url: &NSURL, + enc: NSStringEncoding, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other stringWithContentsOfFile:encoding:error:)] + pub unsafe fn stringWithContentsOfFile_encoding_error( + path: &NSString, + enc: NSStringEncoding, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:usedEncoding:error:)] + pub unsafe fn initWithContentsOfURL_usedEncoding_error( + this: Option>, + url: &NSURL, + enc: *mut NSStringEncoding, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithContentsOfFile:usedEncoding:error:)] + pub unsafe fn initWithContentsOfFile_usedEncoding_error( + this: Option>, + path: &NSString, + enc: *mut NSStringEncoding, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other stringWithContentsOfURL:usedEncoding:error:)] + pub unsafe fn stringWithContentsOfURL_usedEncoding_error( + url: &NSURL, + enc: *mut NSStringEncoding, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other stringWithContentsOfFile:usedEncoding:error:)] + pub unsafe fn stringWithContentsOfFile_usedEncoding_error( + path: &NSString, + enc: *mut NSStringEncoding, + ) -> Result, Id>; + } +); + +pub type NSStringEncodingDetectionOptionsKey = NSString; + +extern_static!( + NSStringEncodingDetectionSuggestedEncodingsKey: &'static NSStringEncodingDetectionOptionsKey +); + +extern_static!( + NSStringEncodingDetectionDisallowedEncodingsKey: &'static NSStringEncodingDetectionOptionsKey +); + +extern_static!( + NSStringEncodingDetectionUseOnlySuggestedEncodingsKey: + &'static NSStringEncodingDetectionOptionsKey +); + +extern_static!( + NSStringEncodingDetectionAllowLossyKey: &'static NSStringEncodingDetectionOptionsKey +); + +extern_static!( + NSStringEncodingDetectionFromWindowsKey: &'static NSStringEncodingDetectionOptionsKey +); + +extern_static!( + NSStringEncodingDetectionLossySubstitutionKey: &'static NSStringEncodingDetectionOptionsKey +); + +extern_static!( + NSStringEncodingDetectionLikelyLanguageKey: &'static NSStringEncodingDetectionOptionsKey +); + +extern_methods!( + /// NSStringEncodingDetection + unsafe impl NSString { + #[method(stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:)] + pub unsafe fn stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + data: &NSData, + opts: Option<&NSDictionary>, + string: *mut *mut NSString, + usedLossyConversion: *mut Bool, + ) -> NSStringEncoding; + } +); + +extern_methods!( + /// NSItemProvider + unsafe impl NSString {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSMutableString; + + unsafe impl ClassType for NSMutableString { + type Super = NSString; + } +); + +extern_methods!( + unsafe impl NSMutableString { + #[method(replaceCharactersInRange:withString:)] + pub unsafe fn replaceCharactersInRange_withString( + &self, + range: NSRange, + aString: &NSString, + ); + } +); + +extern_methods!( + /// NSMutableStringExtensionMethods + unsafe impl NSMutableString { + #[method(insertString:atIndex:)] + pub unsafe fn insertString_atIndex(&self, aString: &NSString, loc: NSUInteger); + + #[method(deleteCharactersInRange:)] + pub unsafe fn deleteCharactersInRange(&self, range: NSRange); + + #[method(appendString:)] + pub unsafe fn appendString(&self, aString: &NSString); + + #[method(setString:)] + pub unsafe fn setString(&self, aString: &NSString); + + #[method(replaceOccurrencesOfString:withString:options:range:)] + pub unsafe fn replaceOccurrencesOfString_withString_options_range( + &self, + target: &NSString, + replacement: &NSString, + options: NSStringCompareOptions, + searchRange: NSRange, + ) -> NSUInteger; + + #[method(applyTransform:reverse:range:updatedRange:)] + pub unsafe fn applyTransform_reverse_range_updatedRange( + &self, + transform: &NSStringTransform, + reverse: bool, + range: NSRange, + resultingRange: NSRangePointer, + ) -> bool; + + #[method_id(@__retain_semantics Init initWithCapacity:)] + pub unsafe fn initWithCapacity( + this: Option>, + capacity: NSUInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other stringWithCapacity:)] + pub unsafe fn stringWithCapacity(capacity: NSUInteger) -> Id; + } +); + +extern_static!(NSCharacterConversionException: &'static NSExceptionName); + +extern_static!(NSParseErrorException: &'static NSExceptionName); + +extern_methods!( + /// NSExtendedStringPropertyListParsing + unsafe impl NSString { + #[method_id(@__retain_semantics Other propertyList)] + pub unsafe fn propertyList(&self) -> Id; + + #[method_id(@__retain_semantics Other propertyListFromStringsFileFormat)] + pub unsafe fn propertyListFromStringsFileFormat(&self) -> Option>; + } +); + +extern_methods!( + /// NSStringDeprecated + unsafe impl NSString { + #[method(cString)] + pub unsafe fn cString(&self) -> *mut c_char; + + #[method(lossyCString)] + pub unsafe fn lossyCString(&self) -> *mut c_char; + + #[method(cStringLength)] + pub unsafe fn cStringLength(&self) -> NSUInteger; + + #[method(getCString:)] + pub unsafe fn getCString(&self, bytes: NonNull); + + #[method(getCString:maxLength:)] + pub unsafe fn getCString_maxLength(&self, bytes: NonNull, maxLength: NSUInteger); + + #[method(getCString:maxLength:range:remainingRange:)] + pub unsafe fn getCString_maxLength_range_remainingRange( + &self, + bytes: NonNull, + maxLength: NSUInteger, + aRange: NSRange, + leftoverRange: NSRangePointer, + ); + + #[method(writeToFile:atomically:)] + pub unsafe fn writeToFile_atomically( + &self, + path: &NSString, + useAuxiliaryFile: bool, + ) -> bool; + + #[method(writeToURL:atomically:)] + pub unsafe fn writeToURL_atomically(&self, url: &NSURL, atomically: bool) -> bool; + + #[method_id(@__retain_semantics Init initWithContentsOfFile:)] + pub unsafe fn initWithContentsOfFile( + this: Option>, + path: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:)] + pub unsafe fn initWithContentsOfURL( + this: Option>, + url: &NSURL, + ) -> Option>; + + #[method_id(@__retain_semantics Other stringWithContentsOfFile:)] + pub unsafe fn stringWithContentsOfFile(path: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other stringWithContentsOfURL:)] + pub unsafe fn stringWithContentsOfURL(url: &NSURL) -> Option>; + + #[method_id(@__retain_semantics Init initWithCStringNoCopy:length:freeWhenDone:)] + pub unsafe fn initWithCStringNoCopy_length_freeWhenDone( + this: Option>, + bytes: NonNull, + length: NSUInteger, + freeBuffer: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithCString:length:)] + pub unsafe fn initWithCString_length( + this: Option>, + bytes: NonNull, + length: NSUInteger, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithCString:)] + pub unsafe fn initWithCString( + this: Option>, + bytes: NonNull, + ) -> Option>; + + #[method_id(@__retain_semantics Other stringWithCString:length:)] + pub unsafe fn stringWithCString_length( + bytes: NonNull, + length: NSUInteger, + ) -> Option>; + + #[method_id(@__retain_semantics Other stringWithCString:)] + pub unsafe fn stringWithCString(bytes: NonNull) -> Option>; + + #[method(getCharacters:)] + pub unsafe fn getCharacters(&self, buffer: NonNull); + } +); + +ns_enum!( + #[underlying(NSStringEncoding)] + pub enum { + NSProprietaryStringEncoding = 65536, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSSimpleCString; + + unsafe impl ClassType for NSSimpleCString { + type Super = NSString; + } +); + +extern_methods!( + unsafe impl NSSimpleCString {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSConstantString; + + unsafe impl ClassType for NSConstantString { + type Super = NSSimpleCString; + } +); + +extern_methods!( + unsafe impl NSConstantString {} +); diff --git a/crates/icrate/src/generated/Foundation/NSTask.rs b/crates/icrate/src/generated/Foundation/NSTask.rs new file mode 100644 index 000000000..e7e95c755 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSTask.rs @@ -0,0 +1,156 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTaskTerminationReason { + NSTaskTerminationReasonExit = 1, + NSTaskTerminationReasonUncaughtSignal = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSTask; + + unsafe impl ClassType for NSTask { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTask { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other executableURL)] + pub unsafe fn executableURL(&self) -> Option>; + + #[method(setExecutableURL:)] + pub unsafe fn setExecutableURL(&self, executableURL: Option<&NSURL>); + + #[method_id(@__retain_semantics Other arguments)] + pub unsafe fn arguments(&self) -> Option, Shared>>; + + #[method(setArguments:)] + pub unsafe fn setArguments(&self, arguments: Option<&NSArray>); + + #[method_id(@__retain_semantics Other environment)] + pub unsafe fn environment(&self) -> Option, Shared>>; + + #[method(setEnvironment:)] + pub unsafe fn setEnvironment(&self, environment: Option<&NSDictionary>); + + #[method_id(@__retain_semantics Other currentDirectoryURL)] + pub unsafe fn currentDirectoryURL(&self) -> Option>; + + #[method(setCurrentDirectoryURL:)] + pub unsafe fn setCurrentDirectoryURL(&self, currentDirectoryURL: Option<&NSURL>); + + #[method_id(@__retain_semantics Other standardInput)] + pub unsafe fn standardInput(&self) -> Option>; + + #[method(setStandardInput:)] + pub unsafe fn setStandardInput(&self, standardInput: Option<&Object>); + + #[method_id(@__retain_semantics Other standardOutput)] + pub unsafe fn standardOutput(&self) -> Option>; + + #[method(setStandardOutput:)] + pub unsafe fn setStandardOutput(&self, standardOutput: Option<&Object>); + + #[method_id(@__retain_semantics Other standardError)] + pub unsafe fn standardError(&self) -> Option>; + + #[method(setStandardError:)] + pub unsafe fn setStandardError(&self, standardError: Option<&Object>); + + #[method(launchAndReturnError:)] + pub unsafe fn launchAndReturnError(&self) -> Result<(), Id>; + + #[method(interrupt)] + pub unsafe fn interrupt(&self); + + #[method(terminate)] + pub unsafe fn terminate(&self); + + #[method(suspend)] + pub unsafe fn suspend(&self) -> bool; + + #[method(resume)] + pub unsafe fn resume(&self) -> bool; + + #[method(processIdentifier)] + pub unsafe fn processIdentifier(&self) -> c_int; + + #[method(isRunning)] + pub unsafe fn isRunning(&self) -> bool; + + #[method(terminationStatus)] + pub unsafe fn terminationStatus(&self) -> c_int; + + #[method(terminationReason)] + pub unsafe fn terminationReason(&self) -> NSTaskTerminationReason; + + #[method(terminationHandler)] + pub unsafe fn terminationHandler(&self) -> *mut Block<(NonNull,), ()>; + + #[method(setTerminationHandler:)] + pub unsafe fn setTerminationHandler( + &self, + terminationHandler: Option<&Block<(NonNull,), ()>>, + ); + + #[method(qualityOfService)] + pub unsafe fn qualityOfService(&self) -> NSQualityOfService; + + #[method(setQualityOfService:)] + pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService); + } +); + +extern_methods!( + /// NSTaskConveniences + unsafe impl NSTask { + #[method_id(@__retain_semantics Other launchedTaskWithExecutableURL:arguments:error:terminationHandler:)] + pub unsafe fn launchedTaskWithExecutableURL_arguments_error_terminationHandler( + url: &NSURL, + arguments: &NSArray, + error: *mut *mut NSError, + terminationHandler: Option<&Block<(NonNull,), ()>>, + ) -> Option>; + + #[method(waitUntilExit)] + pub unsafe fn waitUntilExit(&self); + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSTask { + #[method_id(@__retain_semantics Other launchPath)] + pub unsafe fn launchPath(&self) -> Option>; + + #[method(setLaunchPath:)] + pub unsafe fn setLaunchPath(&self, launchPath: Option<&NSString>); + + #[method_id(@__retain_semantics Other currentDirectoryPath)] + pub unsafe fn currentDirectoryPath(&self) -> Id; + + #[method(setCurrentDirectoryPath:)] + pub unsafe fn setCurrentDirectoryPath(&self, currentDirectoryPath: &NSString); + + #[method(launch)] + pub unsafe fn launch(&self); + + #[method_id(@__retain_semantics Other launchedTaskWithLaunchPath:arguments:)] + pub unsafe fn launchedTaskWithLaunchPath_arguments( + path: &NSString, + arguments: &NSArray, + ) -> Id; + } +); + +extern_static!(NSTaskDidTerminateNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/Foundation/NSTextCheckingResult.rs b/crates/icrate/src/generated/Foundation/NSTextCheckingResult.rs new file mode 100644 index 000000000..8e522a214 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSTextCheckingResult.rs @@ -0,0 +1,237 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(u64)] + pub enum NSTextCheckingType { + NSTextCheckingTypeOrthography = 1 << 0, + NSTextCheckingTypeSpelling = 1 << 1, + NSTextCheckingTypeGrammar = 1 << 2, + NSTextCheckingTypeDate = 1 << 3, + NSTextCheckingTypeAddress = 1 << 4, + NSTextCheckingTypeLink = 1 << 5, + NSTextCheckingTypeQuote = 1 << 6, + NSTextCheckingTypeDash = 1 << 7, + NSTextCheckingTypeReplacement = 1 << 8, + NSTextCheckingTypeCorrection = 1 << 9, + NSTextCheckingTypeRegularExpression = 1 << 10, + NSTextCheckingTypePhoneNumber = 1 << 11, + NSTextCheckingTypeTransitInformation = 1 << 12, + } +); + +pub type NSTextCheckingTypes = u64; + +ns_enum!( + #[underlying(NSTextCheckingTypes)] + pub enum { + NSTextCheckingAllSystemTypes = 0xffffffff, + NSTextCheckingAllCustomTypes = 0xffffffff<<32, + NSTextCheckingAllTypes = NSTextCheckingAllSystemTypes|NSTextCheckingAllCustomTypes, + } +); + +pub type NSTextCheckingKey = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSTextCheckingResult; + + unsafe impl ClassType for NSTextCheckingResult { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTextCheckingResult { + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSTextCheckingType; + + #[method(range)] + pub unsafe fn range(&self) -> NSRange; + } +); + +extern_methods!( + /// NSTextCheckingResultOptional + unsafe impl NSTextCheckingResult { + #[method_id(@__retain_semantics Other orthography)] + pub unsafe fn orthography(&self) -> Option>; + + #[method_id(@__retain_semantics Other grammarDetails)] + pub unsafe fn grammarDetails( + &self, + ) -> Option>, Shared>>; + + #[method_id(@__retain_semantics Other date)] + pub unsafe fn date(&self) -> Option>; + + #[method_id(@__retain_semantics Other timeZone)] + pub unsafe fn timeZone(&self) -> Option>; + + #[method(duration)] + pub unsafe fn duration(&self) -> NSTimeInterval; + + #[method_id(@__retain_semantics Other components)] + pub unsafe fn components( + &self, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + + #[method_id(@__retain_semantics Other replacementString)] + pub unsafe fn replacementString(&self) -> Option>; + + #[method_id(@__retain_semantics Other alternativeStrings)] + pub unsafe fn alternativeStrings(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other regularExpression)] + pub unsafe fn regularExpression(&self) -> Option>; + + #[method_id(@__retain_semantics Other phoneNumber)] + pub unsafe fn phoneNumber(&self) -> Option>; + + #[method(numberOfRanges)] + pub unsafe fn numberOfRanges(&self) -> NSUInteger; + + #[method(rangeAtIndex:)] + pub unsafe fn rangeAtIndex(&self, idx: NSUInteger) -> NSRange; + + #[method(rangeWithName:)] + pub unsafe fn rangeWithName(&self, name: &NSString) -> NSRange; + + #[method_id(@__retain_semantics Other resultByAdjustingRangesWithOffset:)] + pub unsafe fn resultByAdjustingRangesWithOffset( + &self, + offset: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other addressComponents)] + pub unsafe fn addressComponents( + &self, + ) -> Option, Shared>>; + } +); + +extern_static!(NSTextCheckingNameKey: &'static NSTextCheckingKey); + +extern_static!(NSTextCheckingJobTitleKey: &'static NSTextCheckingKey); + +extern_static!(NSTextCheckingOrganizationKey: &'static NSTextCheckingKey); + +extern_static!(NSTextCheckingStreetKey: &'static NSTextCheckingKey); + +extern_static!(NSTextCheckingCityKey: &'static NSTextCheckingKey); + +extern_static!(NSTextCheckingStateKey: &'static NSTextCheckingKey); + +extern_static!(NSTextCheckingZIPKey: &'static NSTextCheckingKey); + +extern_static!(NSTextCheckingCountryKey: &'static NSTextCheckingKey); + +extern_static!(NSTextCheckingPhoneKey: &'static NSTextCheckingKey); + +extern_static!(NSTextCheckingAirlineKey: &'static NSTextCheckingKey); + +extern_static!(NSTextCheckingFlightKey: &'static NSTextCheckingKey); + +extern_methods!( + /// NSTextCheckingResultCreation + unsafe impl NSTextCheckingResult { + #[method_id(@__retain_semantics Other orthographyCheckingResultWithRange:orthography:)] + pub unsafe fn orthographyCheckingResultWithRange_orthography( + range: NSRange, + orthography: &NSOrthography, + ) -> Id; + + #[method_id(@__retain_semantics Other spellCheckingResultWithRange:)] + pub unsafe fn spellCheckingResultWithRange( + range: NSRange, + ) -> Id; + + #[method_id(@__retain_semantics Other grammarCheckingResultWithRange:details:)] + pub unsafe fn grammarCheckingResultWithRange_details( + range: NSRange, + details: &NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Other dateCheckingResultWithRange:date:)] + pub unsafe fn dateCheckingResultWithRange_date( + range: NSRange, + date: &NSDate, + ) -> Id; + + #[method_id(@__retain_semantics Other dateCheckingResultWithRange:date:timeZone:duration:)] + pub unsafe fn dateCheckingResultWithRange_date_timeZone_duration( + range: NSRange, + date: &NSDate, + timeZone: &NSTimeZone, + duration: NSTimeInterval, + ) -> Id; + + #[method_id(@__retain_semantics Other addressCheckingResultWithRange:components:)] + pub unsafe fn addressCheckingResultWithRange_components( + range: NSRange, + components: &NSDictionary, + ) -> Id; + + #[method_id(@__retain_semantics Other linkCheckingResultWithRange:URL:)] + pub unsafe fn linkCheckingResultWithRange_URL( + range: NSRange, + url: &NSURL, + ) -> Id; + + #[method_id(@__retain_semantics Other quoteCheckingResultWithRange:replacementString:)] + pub unsafe fn quoteCheckingResultWithRange_replacementString( + range: NSRange, + replacementString: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other dashCheckingResultWithRange:replacementString:)] + pub unsafe fn dashCheckingResultWithRange_replacementString( + range: NSRange, + replacementString: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other replacementCheckingResultWithRange:replacementString:)] + pub unsafe fn replacementCheckingResultWithRange_replacementString( + range: NSRange, + replacementString: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other correctionCheckingResultWithRange:replacementString:)] + pub unsafe fn correctionCheckingResultWithRange_replacementString( + range: NSRange, + replacementString: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other correctionCheckingResultWithRange:replacementString:alternativeStrings:)] + pub unsafe fn correctionCheckingResultWithRange_replacementString_alternativeStrings( + range: NSRange, + replacementString: &NSString, + alternativeStrings: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other regularExpressionCheckingResultWithRanges:count:regularExpression:)] + pub unsafe fn regularExpressionCheckingResultWithRanges_count_regularExpression( + ranges: NSRangePointer, + count: NSUInteger, + regularExpression: &NSRegularExpression, + ) -> Id; + + #[method_id(@__retain_semantics Other phoneNumberCheckingResultWithRange:phoneNumber:)] + pub unsafe fn phoneNumberCheckingResultWithRange_phoneNumber( + range: NSRange, + phoneNumber: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other transitInformationCheckingResultWithRange:components:)] + pub unsafe fn transitInformationCheckingResultWithRange_components( + range: NSRange, + components: &NSDictionary, + ) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSThread.rs b/crates/icrate/src/generated/Foundation/NSThread.rs new file mode 100644 index 000000000..e0ae7da79 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSThread.rs @@ -0,0 +1,167 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSThread; + + unsafe impl ClassType for NSThread { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSThread { + #[method_id(@__retain_semantics Other currentThread)] + pub unsafe fn currentThread() -> Id; + + #[method(detachNewThreadWithBlock:)] + pub unsafe fn detachNewThreadWithBlock(block: &Block<(), ()>); + + #[method(detachNewThreadSelector:toTarget:withObject:)] + pub unsafe fn detachNewThreadSelector_toTarget_withObject( + selector: Sel, + target: &Object, + argument: Option<&Object>, + ); + + #[method(isMultiThreaded)] + pub unsafe fn isMultiThreaded() -> bool; + + #[method_id(@__retain_semantics Other threadDictionary)] + pub unsafe fn threadDictionary(&self) -> Id; + + #[method(sleepUntilDate:)] + pub unsafe fn sleepUntilDate(date: &NSDate); + + #[method(sleepForTimeInterval:)] + pub unsafe fn sleepForTimeInterval(ti: NSTimeInterval); + + #[method(exit)] + pub unsafe fn exit(); + + #[method(threadPriority)] + pub unsafe fn threadPriority() -> c_double; + + #[method(setThreadPriority:)] + pub unsafe fn setThreadPriority(p: c_double) -> bool; + + #[method(qualityOfService)] + pub unsafe fn qualityOfService(&self) -> NSQualityOfService; + + #[method(setQualityOfService:)] + pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService); + + #[method_id(@__retain_semantics Other callStackReturnAddresses)] + pub unsafe fn callStackReturnAddresses() -> Id, Shared>; + + #[method_id(@__retain_semantics Other callStackSymbols)] + pub unsafe fn callStackSymbols() -> Id, Shared>; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + + #[method(stackSize)] + pub unsafe fn stackSize(&self) -> NSUInteger; + + #[method(setStackSize:)] + pub unsafe fn setStackSize(&self, stackSize: NSUInteger); + + #[method_id(@__retain_semantics Other mainThread)] + pub unsafe fn mainThread() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithTarget:selector:object:)] + pub unsafe fn initWithTarget_selector_object( + this: Option>, + target: &Object, + selector: Sel, + argument: Option<&Object>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithBlock:)] + pub unsafe fn initWithBlock( + this: Option>, + block: &Block<(), ()>, + ) -> Id; + + #[method(isExecuting)] + pub unsafe fn isExecuting(&self) -> bool; + + #[method(isFinished)] + pub unsafe fn isFinished(&self) -> bool; + + #[method(isCancelled)] + pub unsafe fn isCancelled(&self) -> bool; + + #[method(cancel)] + pub unsafe fn cancel(&self); + + #[method(start)] + pub unsafe fn start(&self); + + #[method(main)] + pub unsafe fn main(&self); + } +); + +extern_static!(NSWillBecomeMultiThreadedNotification: &'static NSNotificationName); + +extern_static!(NSDidBecomeSingleThreadedNotification: &'static NSNotificationName); + +extern_static!(NSThreadWillExitNotification: &'static NSNotificationName); + +extern_methods!( + /// NSThreadPerformAdditions + unsafe impl NSObject { + #[method(performSelectorOnMainThread:withObject:waitUntilDone:modes:)] + pub unsafe fn performSelectorOnMainThread_withObject_waitUntilDone_modes( + &self, + aSelector: Sel, + arg: Option<&Object>, + wait: bool, + array: Option<&NSArray>, + ); + + #[method(performSelectorOnMainThread:withObject:waitUntilDone:)] + pub unsafe fn performSelectorOnMainThread_withObject_waitUntilDone( + &self, + aSelector: Sel, + arg: Option<&Object>, + wait: bool, + ); + + #[method(performSelector:onThread:withObject:waitUntilDone:modes:)] + pub unsafe fn performSelector_onThread_withObject_waitUntilDone_modes( + &self, + aSelector: Sel, + thr: &NSThread, + arg: Option<&Object>, + wait: bool, + array: Option<&NSArray>, + ); + + #[method(performSelector:onThread:withObject:waitUntilDone:)] + pub unsafe fn performSelector_onThread_withObject_waitUntilDone( + &self, + aSelector: Sel, + thr: &NSThread, + arg: Option<&Object>, + wait: bool, + ); + + #[method(performSelectorInBackground:withObject:)] + pub unsafe fn performSelectorInBackground_withObject( + &self, + aSelector: Sel, + arg: Option<&Object>, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSTimeZone.rs b/crates/icrate/src/generated/Foundation/NSTimeZone.rs new file mode 100644 index 000000000..29500b1db --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSTimeZone.rs @@ -0,0 +1,151 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTimeZone; + + unsafe impl ClassType for NSTimeZone { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTimeZone { + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other data)] + pub unsafe fn data(&self) -> Id; + + #[method(secondsFromGMTForDate:)] + pub unsafe fn secondsFromGMTForDate(&self, aDate: &NSDate) -> NSInteger; + + #[method_id(@__retain_semantics Other abbreviationForDate:)] + pub unsafe fn abbreviationForDate(&self, aDate: &NSDate) -> Option>; + + #[method(isDaylightSavingTimeForDate:)] + pub unsafe fn isDaylightSavingTimeForDate(&self, aDate: &NSDate) -> bool; + + #[method(daylightSavingTimeOffsetForDate:)] + pub unsafe fn daylightSavingTimeOffsetForDate(&self, aDate: &NSDate) -> NSTimeInterval; + + #[method_id(@__retain_semantics Other nextDaylightSavingTimeTransitionAfterDate:)] + pub unsafe fn nextDaylightSavingTimeTransitionAfterDate( + &self, + aDate: &NSDate, + ) -> Option>; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSTimeZoneNameStyle { + NSTimeZoneNameStyleStandard = 0, + NSTimeZoneNameStyleShortStandard = 1, + NSTimeZoneNameStyleDaylightSaving = 2, + NSTimeZoneNameStyleShortDaylightSaving = 3, + NSTimeZoneNameStyleGeneric = 4, + NSTimeZoneNameStyleShortGeneric = 5, + } +); + +extern_methods!( + /// NSExtendedTimeZone + unsafe impl NSTimeZone { + #[method_id(@__retain_semantics Other systemTimeZone)] + pub unsafe fn systemTimeZone() -> Id; + + #[method(resetSystemTimeZone)] + pub unsafe fn resetSystemTimeZone(); + + #[method_id(@__retain_semantics Other defaultTimeZone)] + pub unsafe fn defaultTimeZone() -> Id; + + #[method(setDefaultTimeZone:)] + pub unsafe fn setDefaultTimeZone(defaultTimeZone: &NSTimeZone); + + #[method_id(@__retain_semantics Other localTimeZone)] + pub unsafe fn localTimeZone() -> Id; + + #[method_id(@__retain_semantics Other knownTimeZoneNames)] + pub unsafe fn knownTimeZoneNames() -> Id, Shared>; + + #[method_id(@__retain_semantics Other abbreviationDictionary)] + pub unsafe fn abbreviationDictionary() -> Id, Shared>; + + #[method(setAbbreviationDictionary:)] + pub unsafe fn setAbbreviationDictionary( + abbreviationDictionary: &NSDictionary, + ); + + #[method_id(@__retain_semantics Other timeZoneDataVersion)] + pub unsafe fn timeZoneDataVersion() -> Id; + + #[method(secondsFromGMT)] + pub unsafe fn secondsFromGMT(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other abbreviation)] + pub unsafe fn abbreviation(&self) -> Option>; + + #[method(isDaylightSavingTime)] + pub unsafe fn isDaylightSavingTime(&self) -> bool; + + #[method(daylightSavingTimeOffset)] + pub unsafe fn daylightSavingTimeOffset(&self) -> NSTimeInterval; + + #[method_id(@__retain_semantics Other nextDaylightSavingTimeTransition)] + pub unsafe fn nextDaylightSavingTimeTransition(&self) -> Option>; + + #[method_id(@__retain_semantics Other description)] + pub unsafe fn description(&self) -> Id; + + #[method(isEqualToTimeZone:)] + pub unsafe fn isEqualToTimeZone(&self, aTimeZone: &NSTimeZone) -> bool; + + #[method_id(@__retain_semantics Other localizedName:locale:)] + pub unsafe fn localizedName_locale( + &self, + style: NSTimeZoneNameStyle, + locale: Option<&NSLocale>, + ) -> Option>; + } +); + +extern_methods!( + /// NSTimeZoneCreation + unsafe impl NSTimeZone { + #[method_id(@__retain_semantics Other timeZoneWithName:)] + pub unsafe fn timeZoneWithName(tzName: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other timeZoneWithName:data:)] + pub unsafe fn timeZoneWithName_data( + tzName: &NSString, + aData: Option<&NSData>, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithName:)] + pub unsafe fn initWithName( + this: Option>, + tzName: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithName:data:)] + pub unsafe fn initWithName_data( + this: Option>, + tzName: &NSString, + aData: Option<&NSData>, + ) -> Option>; + + #[method_id(@__retain_semantics Other timeZoneForSecondsFromGMT:)] + pub unsafe fn timeZoneForSecondsFromGMT(seconds: NSInteger) -> Id; + + #[method_id(@__retain_semantics Other timeZoneWithAbbreviation:)] + pub unsafe fn timeZoneWithAbbreviation(abbreviation: &NSString) + -> Option>; + } +); + +extern_static!(NSSystemTimeZoneDidChangeNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/Foundation/NSTimer.rs b/crates/icrate/src/generated/Foundation/NSTimer.rs new file mode 100644 index 000000000..cbd071fd6 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSTimer.rs @@ -0,0 +1,110 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSTimer; + + unsafe impl ClassType for NSTimer { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSTimer { + #[method_id(@__retain_semantics Other timerWithTimeInterval:invocation:repeats:)] + pub unsafe fn timerWithTimeInterval_invocation_repeats( + ti: NSTimeInterval, + invocation: &NSInvocation, + yesOrNo: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other scheduledTimerWithTimeInterval:invocation:repeats:)] + pub unsafe fn scheduledTimerWithTimeInterval_invocation_repeats( + ti: NSTimeInterval, + invocation: &NSInvocation, + yesOrNo: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other timerWithTimeInterval:target:selector:userInfo:repeats:)] + pub unsafe fn timerWithTimeInterval_target_selector_userInfo_repeats( + ti: NSTimeInterval, + aTarget: &Object, + aSelector: Sel, + userInfo: Option<&Object>, + yesOrNo: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:)] + pub unsafe fn scheduledTimerWithTimeInterval_target_selector_userInfo_repeats( + ti: NSTimeInterval, + aTarget: &Object, + aSelector: Sel, + userInfo: Option<&Object>, + yesOrNo: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other timerWithTimeInterval:repeats:block:)] + pub unsafe fn timerWithTimeInterval_repeats_block( + interval: NSTimeInterval, + repeats: bool, + block: &Block<(NonNull,), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Other scheduledTimerWithTimeInterval:repeats:block:)] + pub unsafe fn scheduledTimerWithTimeInterval_repeats_block( + interval: NSTimeInterval, + repeats: bool, + block: &Block<(NonNull,), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithFireDate:interval:repeats:block:)] + pub unsafe fn initWithFireDate_interval_repeats_block( + this: Option>, + date: &NSDate, + interval: NSTimeInterval, + repeats: bool, + block: &Block<(NonNull,), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithFireDate:interval:target:selector:userInfo:repeats:)] + pub unsafe fn initWithFireDate_interval_target_selector_userInfo_repeats( + this: Option>, + date: &NSDate, + ti: NSTimeInterval, + t: &Object, + s: Sel, + ui: Option<&Object>, + rep: bool, + ) -> Id; + + #[method(fire)] + pub unsafe fn fire(&self); + + #[method_id(@__retain_semantics Other fireDate)] + pub unsafe fn fireDate(&self) -> Id; + + #[method(setFireDate:)] + pub unsafe fn setFireDate(&self, fireDate: &NSDate); + + #[method(timeInterval)] + pub unsafe fn timeInterval(&self) -> NSTimeInterval; + + #[method(tolerance)] + pub unsafe fn tolerance(&self) -> NSTimeInterval; + + #[method(setTolerance:)] + pub unsafe fn setTolerance(&self, tolerance: NSTimeInterval); + + #[method(invalidate)] + pub unsafe fn invalidate(&self); + + #[method(isValid)] + pub unsafe fn isValid(&self) -> bool; + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSURL.rs b/crates/icrate/src/generated/Foundation/NSURL.rs new file mode 100644 index 000000000..601a3b851 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURL.rs @@ -0,0 +1,1053 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSURLResourceKey = NSString; + +extern_static!(NSURLFileScheme: &'static NSString); + +extern_static!(NSURLKeysOfUnsetValuesKey: &'static NSURLResourceKey); + +extern_static!(NSURLNameKey: &'static NSURLResourceKey); + +extern_static!(NSURLLocalizedNameKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsRegularFileKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsDirectoryKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsSymbolicLinkKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsVolumeKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsPackageKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsApplicationKey: &'static NSURLResourceKey); + +extern_static!(NSURLApplicationIsScriptableKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsSystemImmutableKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsUserImmutableKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsHiddenKey: &'static NSURLResourceKey); + +extern_static!(NSURLHasHiddenExtensionKey: &'static NSURLResourceKey); + +extern_static!(NSURLCreationDateKey: &'static NSURLResourceKey); + +extern_static!(NSURLContentAccessDateKey: &'static NSURLResourceKey); + +extern_static!(NSURLContentModificationDateKey: &'static NSURLResourceKey); + +extern_static!(NSURLAttributeModificationDateKey: &'static NSURLResourceKey); + +extern_static!(NSURLLinkCountKey: &'static NSURLResourceKey); + +extern_static!(NSURLParentDirectoryURLKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeURLKey: &'static NSURLResourceKey); + +extern_static!(NSURLTypeIdentifierKey: &'static NSURLResourceKey); + +extern_static!(NSURLContentTypeKey: &'static NSURLResourceKey); + +extern_static!(NSURLLocalizedTypeDescriptionKey: &'static NSURLResourceKey); + +extern_static!(NSURLLabelNumberKey: &'static NSURLResourceKey); + +extern_static!(NSURLLabelColorKey: &'static NSURLResourceKey); + +extern_static!(NSURLLocalizedLabelKey: &'static NSURLResourceKey); + +extern_static!(NSURLEffectiveIconKey: &'static NSURLResourceKey); + +extern_static!(NSURLCustomIconKey: &'static NSURLResourceKey); + +extern_static!(NSURLFileResourceIdentifierKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeIdentifierKey: &'static NSURLResourceKey); + +extern_static!(NSURLPreferredIOBlockSizeKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsReadableKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsWritableKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsExecutableKey: &'static NSURLResourceKey); + +extern_static!(NSURLFileSecurityKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsExcludedFromBackupKey: &'static NSURLResourceKey); + +extern_static!(NSURLTagNamesKey: &'static NSURLResourceKey); + +extern_static!(NSURLPathKey: &'static NSURLResourceKey); + +extern_static!(NSURLCanonicalPathKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsMountTriggerKey: &'static NSURLResourceKey); + +extern_static!(NSURLGenerationIdentifierKey: &'static NSURLResourceKey); + +extern_static!(NSURLDocumentIdentifierKey: &'static NSURLResourceKey); + +extern_static!(NSURLAddedToDirectoryDateKey: &'static NSURLResourceKey); + +extern_static!(NSURLQuarantinePropertiesKey: &'static NSURLResourceKey); + +extern_static!(NSURLFileResourceTypeKey: &'static NSURLResourceKey); + +extern_static!(NSURLFileContentIdentifierKey: &'static NSURLResourceKey); + +extern_static!(NSURLMayShareFileContentKey: &'static NSURLResourceKey); + +extern_static!(NSURLMayHaveExtendedAttributesKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsPurgeableKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsSparseKey: &'static NSURLResourceKey); + +pub type NSURLFileResourceType = NSString; + +extern_static!(NSURLFileResourceTypeNamedPipe: &'static NSURLFileResourceType); + +extern_static!(NSURLFileResourceTypeCharacterSpecial: &'static NSURLFileResourceType); + +extern_static!(NSURLFileResourceTypeDirectory: &'static NSURLFileResourceType); + +extern_static!(NSURLFileResourceTypeBlockSpecial: &'static NSURLFileResourceType); + +extern_static!(NSURLFileResourceTypeRegular: &'static NSURLFileResourceType); + +extern_static!(NSURLFileResourceTypeSymbolicLink: &'static NSURLFileResourceType); + +extern_static!(NSURLFileResourceTypeSocket: &'static NSURLFileResourceType); + +extern_static!(NSURLFileResourceTypeUnknown: &'static NSURLFileResourceType); + +extern_static!(NSURLThumbnailDictionaryKey: &'static NSURLResourceKey); + +extern_static!(NSURLThumbnailKey: &'static NSURLResourceKey); + +pub type NSURLThumbnailDictionaryItem = NSString; + +extern_static!(NSThumbnail1024x1024SizeKey: &'static NSURLThumbnailDictionaryItem); + +extern_static!(NSURLFileSizeKey: &'static NSURLResourceKey); + +extern_static!(NSURLFileAllocatedSizeKey: &'static NSURLResourceKey); + +extern_static!(NSURLTotalFileSizeKey: &'static NSURLResourceKey); + +extern_static!(NSURLTotalFileAllocatedSizeKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsAliasFileKey: &'static NSURLResourceKey); + +extern_static!(NSURLFileProtectionKey: &'static NSURLResourceKey); + +pub type NSURLFileProtectionType = NSString; + +extern_static!(NSURLFileProtectionNone: &'static NSURLFileProtectionType); + +extern_static!(NSURLFileProtectionComplete: &'static NSURLFileProtectionType); + +extern_static!(NSURLFileProtectionCompleteUnlessOpen: &'static NSURLFileProtectionType); + +extern_static!( + NSURLFileProtectionCompleteUntilFirstUserAuthentication: &'static NSURLFileProtectionType +); + +extern_static!(NSURLVolumeLocalizedFormatDescriptionKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeTotalCapacityKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeAvailableCapacityKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeResourceCountKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsPersistentIDsKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsSymbolicLinksKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsHardLinksKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsJournalingKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeIsJournalingKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsSparseFilesKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsZeroRunsKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsCaseSensitiveNamesKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsCasePreservedNamesKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsRootDirectoryDatesKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsVolumeSizesKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsRenamingKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsAdvisoryFileLockingKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsExtendedSecurityKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeIsBrowsableKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeMaximumFileSizeKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeIsEjectableKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeIsRemovableKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeIsInternalKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeIsAutomountedKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeIsLocalKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeIsReadOnlyKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeCreationDateKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeURLForRemountingKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeUUIDStringKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeNameKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeLocalizedNameKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeIsEncryptedKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeIsRootFileSystemKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsCompressionKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsFileCloningKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsSwapRenamingKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsExclusiveRenamingKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsImmutableFilesKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsAccessPermissionsKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeSupportsFileProtectionKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeAvailableCapacityForImportantUsageKey: &'static NSURLResourceKey); + +extern_static!(NSURLVolumeAvailableCapacityForOpportunisticUsageKey: &'static NSURLResourceKey); + +extern_static!(NSURLIsUbiquitousItemKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemHasUnresolvedConflictsKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemIsDownloadedKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemIsDownloadingKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemIsUploadedKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemIsUploadingKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemPercentDownloadedKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemPercentUploadedKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemDownloadingStatusKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemDownloadingErrorKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemUploadingErrorKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemDownloadRequestedKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemContainerDisplayNameKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemIsExcludedFromSyncKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousItemIsSharedKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousSharedItemCurrentUserRoleKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousSharedItemCurrentUserPermissionsKey: &'static NSURLResourceKey); + +extern_static!(NSURLUbiquitousSharedItemOwnerNameComponentsKey: &'static NSURLResourceKey); + +extern_static!( + NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey: &'static NSURLResourceKey +); + +pub type NSURLUbiquitousItemDownloadingStatus = NSString; + +extern_static!( + NSURLUbiquitousItemDownloadingStatusNotDownloaded: + &'static NSURLUbiquitousItemDownloadingStatus +); + +extern_static!( + NSURLUbiquitousItemDownloadingStatusDownloaded: &'static NSURLUbiquitousItemDownloadingStatus +); + +extern_static!( + NSURLUbiquitousItemDownloadingStatusCurrent: &'static NSURLUbiquitousItemDownloadingStatus +); + +pub type NSURLUbiquitousSharedItemRole = NSString; + +extern_static!(NSURLUbiquitousSharedItemRoleOwner: &'static NSURLUbiquitousSharedItemRole); + +extern_static!(NSURLUbiquitousSharedItemRoleParticipant: &'static NSURLUbiquitousSharedItemRole); + +pub type NSURLUbiquitousSharedItemPermissions = NSString; + +extern_static!( + NSURLUbiquitousSharedItemPermissionsReadOnly: &'static NSURLUbiquitousSharedItemPermissions +); + +extern_static!( + NSURLUbiquitousSharedItemPermissionsReadWrite: &'static NSURLUbiquitousSharedItemPermissions +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSURLBookmarkCreationOptions { + NSURLBookmarkCreationPreferFileIDResolution = 1 << 8, + NSURLBookmarkCreationMinimalBookmark = 1 << 9, + NSURLBookmarkCreationSuitableForBookmarkFile = 1 << 10, + NSURLBookmarkCreationWithSecurityScope = 1 << 11, + NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess = 1 << 12, + NSURLBookmarkCreationWithoutImplicitSecurityScope = 1 << 29, + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSURLBookmarkResolutionOptions { + NSURLBookmarkResolutionWithoutUI = 1 << 8, + NSURLBookmarkResolutionWithoutMounting = 1 << 9, + NSURLBookmarkResolutionWithSecurityScope = 1 << 10, + NSURLBookmarkResolutionWithoutImplicitStartAccessing = 1 << 15, + } +); + +pub type NSURLBookmarkFileCreationOptions = NSUInteger; + +extern_class!( + #[derive(Debug)] + pub struct NSURL; + + unsafe impl ClassType for NSURL { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURL { + #[method_id(@__retain_semantics Init initWithScheme:host:path:)] + pub unsafe fn initWithScheme_host_path( + this: Option>, + scheme: &NSString, + host: Option<&NSString>, + path: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initFileURLWithPath:isDirectory:relativeToURL:)] + pub unsafe fn initFileURLWithPath_isDirectory_relativeToURL( + this: Option>, + path: &NSString, + isDir: bool, + baseURL: Option<&NSURL>, + ) -> Id; + + #[method_id(@__retain_semantics Init initFileURLWithPath:relativeToURL:)] + pub unsafe fn initFileURLWithPath_relativeToURL( + this: Option>, + path: &NSString, + baseURL: Option<&NSURL>, + ) -> Id; + + #[method_id(@__retain_semantics Init initFileURLWithPath:isDirectory:)] + pub unsafe fn initFileURLWithPath_isDirectory( + this: Option>, + path: &NSString, + isDir: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initFileURLWithPath:)] + pub unsafe fn initFileURLWithPath( + this: Option>, + path: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other fileURLWithPath:isDirectory:relativeToURL:)] + pub unsafe fn fileURLWithPath_isDirectory_relativeToURL( + path: &NSString, + isDir: bool, + baseURL: Option<&NSURL>, + ) -> Id; + + #[method_id(@__retain_semantics Other fileURLWithPath:relativeToURL:)] + pub unsafe fn fileURLWithPath_relativeToURL( + path: &NSString, + baseURL: Option<&NSURL>, + ) -> Id; + + #[method_id(@__retain_semantics Other fileURLWithPath:isDirectory:)] + pub unsafe fn fileURLWithPath_isDirectory( + path: &NSString, + isDir: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other fileURLWithPath:)] + pub unsafe fn fileURLWithPath(path: &NSString) -> Id; + + #[method_id(@__retain_semantics Init initFileURLWithFileSystemRepresentation:isDirectory:relativeToURL:)] + pub unsafe fn initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL( + this: Option>, + path: NonNull, + isDir: bool, + baseURL: Option<&NSURL>, + ) -> Id; + + #[method_id(@__retain_semantics Other fileURLWithFileSystemRepresentation:isDirectory:relativeToURL:)] + pub unsafe fn fileURLWithFileSystemRepresentation_isDirectory_relativeToURL( + path: NonNull, + isDir: bool, + baseURL: Option<&NSURL>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithString:)] + pub unsafe fn initWithString( + this: Option>, + URLString: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithString:relativeToURL:)] + pub unsafe fn initWithString_relativeToURL( + this: Option>, + URLString: &NSString, + baseURL: Option<&NSURL>, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLWithString:)] + pub unsafe fn URLWithString(URLString: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other URLWithString:relativeToURL:)] + pub unsafe fn URLWithString_relativeToURL( + URLString: &NSString, + baseURL: Option<&NSURL>, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithDataRepresentation:relativeToURL:)] + pub unsafe fn initWithDataRepresentation_relativeToURL( + this: Option>, + data: &NSData, + baseURL: Option<&NSURL>, + ) -> Id; + + #[method_id(@__retain_semantics Other URLWithDataRepresentation:relativeToURL:)] + pub unsafe fn URLWithDataRepresentation_relativeToURL( + data: &NSData, + baseURL: Option<&NSURL>, + ) -> Id; + + #[method_id(@__retain_semantics Init initAbsoluteURLWithDataRepresentation:relativeToURL:)] + pub unsafe fn initAbsoluteURLWithDataRepresentation_relativeToURL( + this: Option>, + data: &NSData, + baseURL: Option<&NSURL>, + ) -> Id; + + #[method_id(@__retain_semantics Other absoluteURLWithDataRepresentation:relativeToURL:)] + pub unsafe fn absoluteURLWithDataRepresentation_relativeToURL( + data: &NSData, + baseURL: Option<&NSURL>, + ) -> Id; + + #[method_id(@__retain_semantics Other dataRepresentation)] + pub unsafe fn dataRepresentation(&self) -> Id; + + #[method_id(@__retain_semantics Other absoluteString)] + pub unsafe fn absoluteString(&self) -> Option>; + + #[method_id(@__retain_semantics Other relativeString)] + pub unsafe fn relativeString(&self) -> Id; + + #[method_id(@__retain_semantics Other baseURL)] + pub unsafe fn baseURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other absoluteURL)] + pub unsafe fn absoluteURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other scheme)] + pub unsafe fn scheme(&self) -> Option>; + + #[method_id(@__retain_semantics Other resourceSpecifier)] + pub unsafe fn resourceSpecifier(&self) -> Option>; + + #[method_id(@__retain_semantics Other host)] + pub unsafe fn host(&self) -> Option>; + + #[method_id(@__retain_semantics Other port)] + pub unsafe fn port(&self) -> Option>; + + #[method_id(@__retain_semantics Other user)] + pub unsafe fn user(&self) -> Option>; + + #[method_id(@__retain_semantics Other password)] + pub unsafe fn password(&self) -> Option>; + + #[method_id(@__retain_semantics Other path)] + pub unsafe fn path(&self) -> Option>; + + #[method_id(@__retain_semantics Other fragment)] + pub unsafe fn fragment(&self) -> Option>; + + #[method_id(@__retain_semantics Other parameterString)] + pub unsafe fn parameterString(&self) -> Option>; + + #[method_id(@__retain_semantics Other query)] + pub unsafe fn query(&self) -> Option>; + + #[method_id(@__retain_semantics Other relativePath)] + pub unsafe fn relativePath(&self) -> Option>; + + #[method(hasDirectoryPath)] + pub unsafe fn hasDirectoryPath(&self) -> bool; + + #[method(getFileSystemRepresentation:maxLength:)] + pub unsafe fn getFileSystemRepresentation_maxLength( + &self, + buffer: NonNull, + maxBufferLength: NSUInteger, + ) -> bool; + + #[method(fileSystemRepresentation)] + pub unsafe fn fileSystemRepresentation(&self) -> NonNull; + + #[method(isFileURL)] + pub unsafe fn isFileURL(&self) -> bool; + + #[method_id(@__retain_semantics Other standardizedURL)] + pub unsafe fn standardizedURL(&self) -> Option>; + + #[method(checkResourceIsReachableAndReturnError:)] + pub unsafe fn checkResourceIsReachableAndReturnError( + &self, + ) -> Result<(), Id>; + + #[method(isFileReferenceURL)] + pub unsafe fn isFileReferenceURL(&self) -> bool; + + #[method_id(@__retain_semantics Other fileReferenceURL)] + pub unsafe fn fileReferenceURL(&self) -> Option>; + + #[method_id(@__retain_semantics Other filePathURL)] + pub unsafe fn filePathURL(&self) -> Option>; + + #[method(getResourceValue:forKey:error:)] + pub unsafe fn getResourceValue_forKey_error( + &self, + value: NonNull<*mut Object>, + key: &NSURLResourceKey, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other resourceValuesForKeys:error:)] + pub unsafe fn resourceValuesForKeys_error( + &self, + keys: &NSArray, + ) -> Result, Shared>, Id>; + + #[method(setResourceValue:forKey:error:)] + pub unsafe fn setResourceValue_forKey_error( + &self, + value: Option<&Object>, + key: &NSURLResourceKey, + ) -> Result<(), Id>; + + #[method(setResourceValues:error:)] + pub unsafe fn setResourceValues_error( + &self, + keyedValues: &NSDictionary, + ) -> Result<(), Id>; + + #[method(removeCachedResourceValueForKey:)] + pub unsafe fn removeCachedResourceValueForKey(&self, key: &NSURLResourceKey); + + #[method(removeAllCachedResourceValues)] + pub unsafe fn removeAllCachedResourceValues(&self); + + #[method(setTemporaryResourceValue:forKey:)] + pub unsafe fn setTemporaryResourceValue_forKey( + &self, + value: Option<&Object>, + key: &NSURLResourceKey, + ); + + #[method_id(@__retain_semantics Other bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:)] + pub unsafe fn bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error( + &self, + options: NSURLBookmarkCreationOptions, + keys: Option<&NSArray>, + relativeURL: Option<&NSURL>, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:)] + pub unsafe fn initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error( + this: Option>, + bookmarkData: &NSData, + options: NSURLBookmarkResolutionOptions, + relativeURL: Option<&NSURL>, + isStale: *mut Bool, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other URLByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:)] + pub unsafe fn URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error( + bookmarkData: &NSData, + options: NSURLBookmarkResolutionOptions, + relativeURL: Option<&NSURL>, + isStale: *mut Bool, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other resourceValuesForKeys:fromBookmarkData:)] + pub unsafe fn resourceValuesForKeys_fromBookmarkData( + keys: &NSArray, + bookmarkData: &NSData, + ) -> Option, Shared>>; + + #[method(writeBookmarkData:toURL:options:error:)] + pub unsafe fn writeBookmarkData_toURL_options_error( + bookmarkData: &NSData, + bookmarkFileURL: &NSURL, + options: NSURLBookmarkFileCreationOptions, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other bookmarkDataWithContentsOfURL:error:)] + pub unsafe fn bookmarkDataWithContentsOfURL_error( + bookmarkFileURL: &NSURL, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other URLByResolvingAliasFileAtURL:options:error:)] + pub unsafe fn URLByResolvingAliasFileAtURL_options_error( + url: &NSURL, + options: NSURLBookmarkResolutionOptions, + ) -> Result, Id>; + + #[method(startAccessingSecurityScopedResource)] + pub unsafe fn startAccessingSecurityScopedResource(&self) -> bool; + + #[method(stopAccessingSecurityScopedResource)] + pub unsafe fn stopAccessingSecurityScopedResource(&self); + } +); + +extern_methods!( + /// NSPromisedItems + unsafe impl NSURL { + #[method(getPromisedItemResourceValue:forKey:error:)] + pub unsafe fn getPromisedItemResourceValue_forKey_error( + &self, + value: NonNull<*mut Object>, + key: &NSURLResourceKey, + ) -> Result<(), Id>; + + #[method_id(@__retain_semantics Other promisedItemResourceValuesForKeys:error:)] + pub unsafe fn promisedItemResourceValuesForKeys_error( + &self, + keys: &NSArray, + ) -> Result, Shared>, Id>; + + #[method(checkPromisedItemIsReachableAndReturnError:)] + pub unsafe fn checkPromisedItemIsReachableAndReturnError( + &self, + ) -> Result<(), Id>; + } +); + +extern_methods!( + /// NSItemProvider + unsafe impl NSURL {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLQueryItem; + + unsafe impl ClassType for NSURLQueryItem { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLQueryItem { + #[method_id(@__retain_semantics Init initWithName:value:)] + pub unsafe fn initWithName_value( + this: Option>, + name: &NSString, + value: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Other queryItemWithName:value:)] + pub unsafe fn queryItemWithName_value( + name: &NSString, + value: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Id; + + #[method_id(@__retain_semantics Other value)] + pub unsafe fn value(&self) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLComponents; + + unsafe impl ClassType for NSURLComponents { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLComponents { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithURL:resolvingAgainstBaseURL:)] + pub unsafe fn initWithURL_resolvingAgainstBaseURL( + this: Option>, + url: &NSURL, + resolve: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other componentsWithURL:resolvingAgainstBaseURL:)] + pub unsafe fn componentsWithURL_resolvingAgainstBaseURL( + url: &NSURL, + resolve: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithString:)] + pub unsafe fn initWithString( + this: Option>, + URLString: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other componentsWithString:)] + pub unsafe fn componentsWithString(URLString: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + + #[method_id(@__retain_semantics Other URLRelativeToURL:)] + pub unsafe fn URLRelativeToURL(&self, baseURL: Option<&NSURL>) + -> Option>; + + #[method_id(@__retain_semantics Other string)] + pub unsafe fn string(&self) -> Option>; + + #[method_id(@__retain_semantics Other scheme)] + pub unsafe fn scheme(&self) -> Option>; + + #[method(setScheme:)] + pub unsafe fn setScheme(&self, scheme: Option<&NSString>); + + #[method_id(@__retain_semantics Other user)] + pub unsafe fn user(&self) -> Option>; + + #[method(setUser:)] + pub unsafe fn setUser(&self, user: Option<&NSString>); + + #[method_id(@__retain_semantics Other password)] + pub unsafe fn password(&self) -> Option>; + + #[method(setPassword:)] + pub unsafe fn setPassword(&self, password: Option<&NSString>); + + #[method_id(@__retain_semantics Other host)] + pub unsafe fn host(&self) -> Option>; + + #[method(setHost:)] + pub unsafe fn setHost(&self, host: Option<&NSString>); + + #[method_id(@__retain_semantics Other port)] + pub unsafe fn port(&self) -> Option>; + + #[method(setPort:)] + pub unsafe fn setPort(&self, port: Option<&NSNumber>); + + #[method_id(@__retain_semantics Other path)] + pub unsafe fn path(&self) -> Option>; + + #[method(setPath:)] + pub unsafe fn setPath(&self, path: Option<&NSString>); + + #[method_id(@__retain_semantics Other query)] + pub unsafe fn query(&self) -> Option>; + + #[method(setQuery:)] + pub unsafe fn setQuery(&self, query: Option<&NSString>); + + #[method_id(@__retain_semantics Other fragment)] + pub unsafe fn fragment(&self) -> Option>; + + #[method(setFragment:)] + pub unsafe fn setFragment(&self, fragment: Option<&NSString>); + + #[method_id(@__retain_semantics Other percentEncodedUser)] + pub unsafe fn percentEncodedUser(&self) -> Option>; + + #[method(setPercentEncodedUser:)] + pub unsafe fn setPercentEncodedUser(&self, percentEncodedUser: Option<&NSString>); + + #[method_id(@__retain_semantics Other percentEncodedPassword)] + pub unsafe fn percentEncodedPassword(&self) -> Option>; + + #[method(setPercentEncodedPassword:)] + pub unsafe fn setPercentEncodedPassword(&self, percentEncodedPassword: Option<&NSString>); + + #[method_id(@__retain_semantics Other percentEncodedHost)] + pub unsafe fn percentEncodedHost(&self) -> Option>; + + #[method(setPercentEncodedHost:)] + pub unsafe fn setPercentEncodedHost(&self, percentEncodedHost: Option<&NSString>); + + #[method_id(@__retain_semantics Other percentEncodedPath)] + pub unsafe fn percentEncodedPath(&self) -> Option>; + + #[method(setPercentEncodedPath:)] + pub unsafe fn setPercentEncodedPath(&self, percentEncodedPath: Option<&NSString>); + + #[method_id(@__retain_semantics Other percentEncodedQuery)] + pub unsafe fn percentEncodedQuery(&self) -> Option>; + + #[method(setPercentEncodedQuery:)] + pub unsafe fn setPercentEncodedQuery(&self, percentEncodedQuery: Option<&NSString>); + + #[method_id(@__retain_semantics Other percentEncodedFragment)] + pub unsafe fn percentEncodedFragment(&self) -> Option>; + + #[method(setPercentEncodedFragment:)] + pub unsafe fn setPercentEncodedFragment(&self, percentEncodedFragment: Option<&NSString>); + + #[method(rangeOfScheme)] + pub unsafe fn rangeOfScheme(&self) -> NSRange; + + #[method(rangeOfUser)] + pub unsafe fn rangeOfUser(&self) -> NSRange; + + #[method(rangeOfPassword)] + pub unsafe fn rangeOfPassword(&self) -> NSRange; + + #[method(rangeOfHost)] + pub unsafe fn rangeOfHost(&self) -> NSRange; + + #[method(rangeOfPort)] + pub unsafe fn rangeOfPort(&self) -> NSRange; + + #[method(rangeOfPath)] + pub unsafe fn rangeOfPath(&self) -> NSRange; + + #[method(rangeOfQuery)] + pub unsafe fn rangeOfQuery(&self) -> NSRange; + + #[method(rangeOfFragment)] + pub unsafe fn rangeOfFragment(&self) -> NSRange; + + #[method_id(@__retain_semantics Other queryItems)] + pub unsafe fn queryItems(&self) -> Option, Shared>>; + + #[method(setQueryItems:)] + pub unsafe fn setQueryItems(&self, queryItems: Option<&NSArray>); + + #[method_id(@__retain_semantics Other percentEncodedQueryItems)] + pub unsafe fn percentEncodedQueryItems( + &self, + ) -> Option, Shared>>; + + #[method(setPercentEncodedQueryItems:)] + pub unsafe fn setPercentEncodedQueryItems( + &self, + percentEncodedQueryItems: Option<&NSArray>, + ); + } +); + +extern_methods!( + /// NSURLUtilities + unsafe impl NSCharacterSet { + #[method_id(@__retain_semantics Other URLUserAllowedCharacterSet)] + pub unsafe fn URLUserAllowedCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other URLPasswordAllowedCharacterSet)] + pub unsafe fn URLPasswordAllowedCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other URLHostAllowedCharacterSet)] + pub unsafe fn URLHostAllowedCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other URLPathAllowedCharacterSet)] + pub unsafe fn URLPathAllowedCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other URLQueryAllowedCharacterSet)] + pub unsafe fn URLQueryAllowedCharacterSet() -> Id; + + #[method_id(@__retain_semantics Other URLFragmentAllowedCharacterSet)] + pub unsafe fn URLFragmentAllowedCharacterSet() -> Id; + } +); + +extern_methods!( + /// NSURLUtilities + unsafe impl NSString { + #[method_id(@__retain_semantics Other stringByAddingPercentEncodingWithAllowedCharacters:)] + pub unsafe fn stringByAddingPercentEncodingWithAllowedCharacters( + &self, + allowedCharacters: &NSCharacterSet, + ) -> Option>; + + #[method_id(@__retain_semantics Other stringByRemovingPercentEncoding)] + pub unsafe fn stringByRemovingPercentEncoding(&self) -> Option>; + + #[method_id(@__retain_semantics Other stringByAddingPercentEscapesUsingEncoding:)] + pub unsafe fn stringByAddingPercentEscapesUsingEncoding( + &self, + enc: NSStringEncoding, + ) -> Option>; + + #[method_id(@__retain_semantics Other stringByReplacingPercentEscapesUsingEncoding:)] + pub unsafe fn stringByReplacingPercentEscapesUsingEncoding( + &self, + enc: NSStringEncoding, + ) -> Option>; + } +); + +extern_methods!( + /// NSURLPathUtilities + unsafe impl NSURL { + #[method_id(@__retain_semantics Other fileURLWithPathComponents:)] + pub unsafe fn fileURLWithPathComponents( + components: &NSArray, + ) -> Option>; + + #[method_id(@__retain_semantics Other pathComponents)] + pub unsafe fn pathComponents(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other lastPathComponent)] + pub unsafe fn lastPathComponent(&self) -> Option>; + + #[method_id(@__retain_semantics Other pathExtension)] + pub unsafe fn pathExtension(&self) -> Option>; + + #[method_id(@__retain_semantics Other URLByAppendingPathComponent:)] + pub unsafe fn URLByAppendingPathComponent( + &self, + pathComponent: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLByAppendingPathComponent:isDirectory:)] + pub unsafe fn URLByAppendingPathComponent_isDirectory( + &self, + pathComponent: &NSString, + isDirectory: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLByDeletingLastPathComponent)] + pub unsafe fn URLByDeletingLastPathComponent(&self) -> Option>; + + #[method_id(@__retain_semantics Other URLByAppendingPathExtension:)] + pub unsafe fn URLByAppendingPathExtension( + &self, + pathExtension: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other URLByDeletingPathExtension)] + pub unsafe fn URLByDeletingPathExtension(&self) -> Option>; + + #[method_id(@__retain_semantics Other URLByStandardizingPath)] + pub unsafe fn URLByStandardizingPath(&self) -> Option>; + + #[method_id(@__retain_semantics Other URLByResolvingSymlinksInPath)] + pub unsafe fn URLByResolvingSymlinksInPath(&self) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSFileSecurity; + + unsafe impl ClassType for NSFileSecurity { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSFileSecurity { + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_methods!( + /// NSURLClient + unsafe impl NSObject { + #[method(URL:resourceDataDidBecomeAvailable:)] + pub unsafe fn URL_resourceDataDidBecomeAvailable(&self, sender: &NSURL, newBytes: &NSData); + + #[method(URLResourceDidFinishLoading:)] + pub unsafe fn URLResourceDidFinishLoading(&self, sender: &NSURL); + + #[method(URLResourceDidCancelLoading:)] + pub unsafe fn URLResourceDidCancelLoading(&self, sender: &NSURL); + + #[method(URL:resourceDidFailLoadingWithReason:)] + pub unsafe fn URL_resourceDidFailLoadingWithReason( + &self, + sender: &NSURL, + reason: &NSString, + ); + } +); + +extern_methods!( + /// NSURLLoading + unsafe impl NSURL { + #[method_id(@__retain_semantics Other resourceDataUsingCache:)] + pub unsafe fn resourceDataUsingCache( + &self, + shouldUseCache: bool, + ) -> Option>; + + #[method(loadResourceDataNotifyingClient:usingCache:)] + pub unsafe fn loadResourceDataNotifyingClient_usingCache( + &self, + client: &Object, + shouldUseCache: bool, + ); + + #[method_id(@__retain_semantics Other propertyForKey:)] + pub unsafe fn propertyForKey(&self, propertyKey: &NSString) -> Option>; + + #[method(setResourceData:)] + pub unsafe fn setResourceData(&self, data: &NSData) -> bool; + + #[method(setProperty:forKey:)] + pub unsafe fn setProperty_forKey(&self, property: &Object, propertyKey: &NSString) -> bool; + + #[method_id(@__retain_semantics Other URLHandleUsingCache:)] + pub unsafe fn URLHandleUsingCache( + &self, + shouldUseCache: bool, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSURLAuthenticationChallenge.rs b/crates/icrate/src/generated/Foundation/NSURLAuthenticationChallenge.rs new file mode 100644 index 000000000..898d61a9e --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLAuthenticationChallenge.rs @@ -0,0 +1,92 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSURLAuthenticationChallengeSender; + + unsafe impl NSURLAuthenticationChallengeSender { + #[method(useCredential:forAuthenticationChallenge:)] + pub unsafe fn useCredential_forAuthenticationChallenge( + &self, + credential: &NSURLCredential, + challenge: &NSURLAuthenticationChallenge, + ); + + #[method(continueWithoutCredentialForAuthenticationChallenge:)] + pub unsafe fn continueWithoutCredentialForAuthenticationChallenge( + &self, + challenge: &NSURLAuthenticationChallenge, + ); + + #[method(cancelAuthenticationChallenge:)] + pub unsafe fn cancelAuthenticationChallenge( + &self, + challenge: &NSURLAuthenticationChallenge, + ); + + #[optional] + #[method(performDefaultHandlingForAuthenticationChallenge:)] + pub unsafe fn performDefaultHandlingForAuthenticationChallenge( + &self, + challenge: &NSURLAuthenticationChallenge, + ); + + #[optional] + #[method(rejectProtectionSpaceAndContinueWithChallenge:)] + pub unsafe fn rejectProtectionSpaceAndContinueWithChallenge( + &self, + challenge: &NSURLAuthenticationChallenge, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLAuthenticationChallenge; + + unsafe impl ClassType for NSURLAuthenticationChallenge { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLAuthenticationChallenge { + #[method_id(@__retain_semantics Init initWithProtectionSpace:proposedCredential:previousFailureCount:failureResponse:error:sender:)] + pub unsafe fn initWithProtectionSpace_proposedCredential_previousFailureCount_failureResponse_error_sender( + this: Option>, + space: &NSURLProtectionSpace, + credential: Option<&NSURLCredential>, + previousFailureCount: NSInteger, + response: Option<&NSURLResponse>, + error: Option<&NSError>, + sender: &NSURLAuthenticationChallengeSender, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithAuthenticationChallenge:sender:)] + pub unsafe fn initWithAuthenticationChallenge_sender( + this: Option>, + challenge: &NSURLAuthenticationChallenge, + sender: &NSURLAuthenticationChallengeSender, + ) -> Id; + + #[method_id(@__retain_semantics Other protectionSpace)] + pub unsafe fn protectionSpace(&self) -> Id; + + #[method_id(@__retain_semantics Other proposedCredential)] + pub unsafe fn proposedCredential(&self) -> Option>; + + #[method(previousFailureCount)] + pub unsafe fn previousFailureCount(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other failureResponse)] + pub unsafe fn failureResponse(&self) -> Option>; + + #[method_id(@__retain_semantics Other error)] + pub unsafe fn error(&self) -> Option>; + + #[method_id(@__retain_semantics Other sender)] + pub unsafe fn sender(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSURLCache.rs b/crates/icrate/src/generated/Foundation/NSURLCache.rs new file mode 100644 index 000000000..9a7e2986f --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLCache.rs @@ -0,0 +1,151 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSURLCacheStoragePolicy { + NSURLCacheStorageAllowed = 0, + NSURLCacheStorageAllowedInMemoryOnly = 1, + NSURLCacheStorageNotAllowed = 2, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSCachedURLResponse; + + unsafe impl ClassType for NSCachedURLResponse { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSCachedURLResponse { + #[method_id(@__retain_semantics Init initWithResponse:data:)] + pub unsafe fn initWithResponse_data( + this: Option>, + response: &NSURLResponse, + data: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithResponse:data:userInfo:storagePolicy:)] + pub unsafe fn initWithResponse_data_userInfo_storagePolicy( + this: Option>, + response: &NSURLResponse, + data: &NSData, + userInfo: Option<&NSDictionary>, + storagePolicy: NSURLCacheStoragePolicy, + ) -> Id; + + #[method_id(@__retain_semantics Other response)] + pub unsafe fn response(&self) -> Id; + + #[method_id(@__retain_semantics Other data)] + pub unsafe fn data(&self) -> Id; + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + + #[method(storagePolicy)] + pub unsafe fn storagePolicy(&self) -> NSURLCacheStoragePolicy; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLCache; + + unsafe impl ClassType for NSURLCache { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLCache { + #[method_id(@__retain_semantics Other sharedURLCache)] + pub unsafe fn sharedURLCache() -> Id; + + #[method(setSharedURLCache:)] + pub unsafe fn setSharedURLCache(sharedURLCache: &NSURLCache); + + #[method_id(@__retain_semantics Init initWithMemoryCapacity:diskCapacity:diskPath:)] + pub unsafe fn initWithMemoryCapacity_diskCapacity_diskPath( + this: Option>, + memoryCapacity: NSUInteger, + diskCapacity: NSUInteger, + path: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithMemoryCapacity:diskCapacity:directoryURL:)] + pub unsafe fn initWithMemoryCapacity_diskCapacity_directoryURL( + this: Option>, + memoryCapacity: NSUInteger, + diskCapacity: NSUInteger, + directoryURL: Option<&NSURL>, + ) -> Id; + + #[method_id(@__retain_semantics Other cachedResponseForRequest:)] + pub unsafe fn cachedResponseForRequest( + &self, + request: &NSURLRequest, + ) -> Option>; + + #[method(storeCachedResponse:forRequest:)] + pub unsafe fn storeCachedResponse_forRequest( + &self, + cachedResponse: &NSCachedURLResponse, + request: &NSURLRequest, + ); + + #[method(removeCachedResponseForRequest:)] + pub unsafe fn removeCachedResponseForRequest(&self, request: &NSURLRequest); + + #[method(removeAllCachedResponses)] + pub unsafe fn removeAllCachedResponses(&self); + + #[method(removeCachedResponsesSinceDate:)] + pub unsafe fn removeCachedResponsesSinceDate(&self, date: &NSDate); + + #[method(memoryCapacity)] + pub unsafe fn memoryCapacity(&self) -> NSUInteger; + + #[method(setMemoryCapacity:)] + pub unsafe fn setMemoryCapacity(&self, memoryCapacity: NSUInteger); + + #[method(diskCapacity)] + pub unsafe fn diskCapacity(&self) -> NSUInteger; + + #[method(setDiskCapacity:)] + pub unsafe fn setDiskCapacity(&self, diskCapacity: NSUInteger); + + #[method(currentMemoryUsage)] + pub unsafe fn currentMemoryUsage(&self) -> NSUInteger; + + #[method(currentDiskUsage)] + pub unsafe fn currentDiskUsage(&self) -> NSUInteger; + } +); + +extern_methods!( + /// NSURLSessionTaskAdditions + unsafe impl NSURLCache { + #[method(storeCachedResponse:forDataTask:)] + pub unsafe fn storeCachedResponse_forDataTask( + &self, + cachedResponse: &NSCachedURLResponse, + dataTask: &NSURLSessionDataTask, + ); + + #[method(getCachedResponseForDataTask:completionHandler:)] + pub unsafe fn getCachedResponseForDataTask_completionHandler( + &self, + dataTask: &NSURLSessionDataTask, + completionHandler: &Block<(*mut NSCachedURLResponse,), ()>, + ); + + #[method(removeCachedResponseForDataTask:)] + pub unsafe fn removeCachedResponseForDataTask(&self, dataTask: &NSURLSessionDataTask); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSURLConnection.rs b/crates/icrate/src/generated/Foundation/NSURLConnection.rs new file mode 100644 index 000000000..095d6f06c --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLConnection.rs @@ -0,0 +1,231 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSURLConnection; + + unsafe impl ClassType for NSURLConnection { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLConnection { + #[method_id(@__retain_semantics Init initWithRequest:delegate:startImmediately:)] + pub unsafe fn initWithRequest_delegate_startImmediately( + this: Option>, + request: &NSURLRequest, + delegate: Option<&Object>, + startImmediately: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithRequest:delegate:)] + pub unsafe fn initWithRequest_delegate( + this: Option>, + request: &NSURLRequest, + delegate: Option<&Object>, + ) -> Option>; + + #[method_id(@__retain_semantics Other connectionWithRequest:delegate:)] + pub unsafe fn connectionWithRequest_delegate( + request: &NSURLRequest, + delegate: Option<&Object>, + ) -> Option>; + + #[method_id(@__retain_semantics Other originalRequest)] + pub unsafe fn originalRequest(&self) -> Id; + + #[method_id(@__retain_semantics Other currentRequest)] + pub unsafe fn currentRequest(&self) -> Id; + + #[method(start)] + pub unsafe fn start(&self); + + #[method(cancel)] + pub unsafe fn cancel(&self); + + #[method(scheduleInRunLoop:forMode:)] + pub unsafe fn scheduleInRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + + #[method(unscheduleFromRunLoop:forMode:)] + pub unsafe fn unscheduleFromRunLoop_forMode( + &self, + aRunLoop: &NSRunLoop, + mode: &NSRunLoopMode, + ); + + #[method(setDelegateQueue:)] + pub unsafe fn setDelegateQueue(&self, queue: Option<&NSOperationQueue>); + + #[method(canHandleRequest:)] + pub unsafe fn canHandleRequest(request: &NSURLRequest) -> bool; + } +); + +extern_protocol!( + pub struct NSURLConnectionDelegate; + + unsafe impl NSURLConnectionDelegate { + #[optional] + #[method(connection:didFailWithError:)] + pub unsafe fn connection_didFailWithError( + &self, + connection: &NSURLConnection, + error: &NSError, + ); + + #[optional] + #[method(connectionShouldUseCredentialStorage:)] + pub unsafe fn connectionShouldUseCredentialStorage( + &self, + connection: &NSURLConnection, + ) -> bool; + + #[optional] + #[method(connection:willSendRequestForAuthenticationChallenge:)] + pub unsafe fn connection_willSendRequestForAuthenticationChallenge( + &self, + connection: &NSURLConnection, + challenge: &NSURLAuthenticationChallenge, + ); + + #[optional] + #[method(connection:canAuthenticateAgainstProtectionSpace:)] + pub unsafe fn connection_canAuthenticateAgainstProtectionSpace( + &self, + connection: &NSURLConnection, + protectionSpace: &NSURLProtectionSpace, + ) -> bool; + + #[optional] + #[method(connection:didReceiveAuthenticationChallenge:)] + pub unsafe fn connection_didReceiveAuthenticationChallenge( + &self, + connection: &NSURLConnection, + challenge: &NSURLAuthenticationChallenge, + ); + + #[optional] + #[method(connection:didCancelAuthenticationChallenge:)] + pub unsafe fn connection_didCancelAuthenticationChallenge( + &self, + connection: &NSURLConnection, + challenge: &NSURLAuthenticationChallenge, + ); + } +); + +extern_protocol!( + pub struct NSURLConnectionDataDelegate; + + unsafe impl NSURLConnectionDataDelegate { + #[optional] + #[method_id(@__retain_semantics Other connection:willSendRequest:redirectResponse:)] + pub unsafe fn connection_willSendRequest_redirectResponse( + &self, + connection: &NSURLConnection, + request: &NSURLRequest, + response: Option<&NSURLResponse>, + ) -> Option>; + + #[optional] + #[method(connection:didReceiveResponse:)] + pub unsafe fn connection_didReceiveResponse( + &self, + connection: &NSURLConnection, + response: &NSURLResponse, + ); + + #[optional] + #[method(connection:didReceiveData:)] + pub unsafe fn connection_didReceiveData(&self, connection: &NSURLConnection, data: &NSData); + + #[optional] + #[method_id(@__retain_semantics Other connection:needNewBodyStream:)] + pub unsafe fn connection_needNewBodyStream( + &self, + connection: &NSURLConnection, + request: &NSURLRequest, + ) -> Option>; + + #[optional] + #[method(connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:)] + pub unsafe fn connection_didSendBodyData_totalBytesWritten_totalBytesExpectedToWrite( + &self, + connection: &NSURLConnection, + bytesWritten: NSInteger, + totalBytesWritten: NSInteger, + totalBytesExpectedToWrite: NSInteger, + ); + + #[optional] + #[method_id(@__retain_semantics Other connection:willCacheResponse:)] + pub unsafe fn connection_willCacheResponse( + &self, + connection: &NSURLConnection, + cachedResponse: &NSCachedURLResponse, + ) -> Option>; + + #[optional] + #[method(connectionDidFinishLoading:)] + pub unsafe fn connectionDidFinishLoading(&self, connection: &NSURLConnection); + } +); + +extern_protocol!( + pub struct NSURLConnectionDownloadDelegate; + + unsafe impl NSURLConnectionDownloadDelegate { + #[optional] + #[method(connection:didWriteData:totalBytesWritten:expectedTotalBytes:)] + pub unsafe fn connection_didWriteData_totalBytesWritten_expectedTotalBytes( + &self, + connection: &NSURLConnection, + bytesWritten: c_longlong, + totalBytesWritten: c_longlong, + expectedTotalBytes: c_longlong, + ); + + #[optional] + #[method(connectionDidResumeDownloading:totalBytesWritten:expectedTotalBytes:)] + pub unsafe fn connectionDidResumeDownloading_totalBytesWritten_expectedTotalBytes( + &self, + connection: &NSURLConnection, + totalBytesWritten: c_longlong, + expectedTotalBytes: c_longlong, + ); + + #[method(connectionDidFinishDownloading:destinationURL:)] + pub unsafe fn connectionDidFinishDownloading_destinationURL( + &self, + connection: &NSURLConnection, + destinationURL: &NSURL, + ); + } +); + +extern_methods!( + /// NSURLConnectionSynchronousLoading + unsafe impl NSURLConnection { + #[method_id(@__retain_semantics Other sendSynchronousRequest:returningResponse:error:)] + pub unsafe fn sendSynchronousRequest_returningResponse_error( + request: &NSURLRequest, + response: *mut *mut NSURLResponse, + ) -> Result, Id>; + } +); + +extern_methods!( + /// NSURLConnectionQueuedLoading + unsafe impl NSURLConnection { + #[method(sendAsynchronousRequest:queue:completionHandler:)] + pub unsafe fn sendAsynchronousRequest_queue_completionHandler( + request: &NSURLRequest, + queue: &NSOperationQueue, + handler: &Block<(*mut NSURLResponse, *mut NSData, *mut NSError), ()>, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSURLCredential.rs b/crates/icrate/src/generated/Foundation/NSURLCredential.rs new file mode 100644 index 000000000..b8afdac8e --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLCredential.rs @@ -0,0 +1,72 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSURLCredentialPersistence { + NSURLCredentialPersistenceNone = 0, + NSURLCredentialPersistenceForSession = 1, + NSURLCredentialPersistencePermanent = 2, + NSURLCredentialPersistenceSynchronizable = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLCredential; + + unsafe impl ClassType for NSURLCredential { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLCredential { + #[method(persistence)] + pub unsafe fn persistence(&self) -> NSURLCredentialPersistence; + } +); + +extern_methods!( + /// NSInternetPassword + unsafe impl NSURLCredential { + #[method_id(@__retain_semantics Init initWithUser:password:persistence:)] + pub unsafe fn initWithUser_password_persistence( + this: Option>, + user: &NSString, + password: &NSString, + persistence: NSURLCredentialPersistence, + ) -> Id; + + #[method_id(@__retain_semantics Other credentialWithUser:password:persistence:)] + pub unsafe fn credentialWithUser_password_persistence( + user: &NSString, + password: &NSString, + persistence: NSURLCredentialPersistence, + ) -> Id; + + #[method_id(@__retain_semantics Other user)] + pub unsafe fn user(&self) -> Option>; + + #[method_id(@__retain_semantics Other password)] + pub unsafe fn password(&self) -> Option>; + + #[method(hasPassword)] + pub unsafe fn hasPassword(&self) -> bool; + } +); + +extern_methods!( + /// NSClientCertificate + unsafe impl NSURLCredential { + #[method_id(@__retain_semantics Other certificates)] + pub unsafe fn certificates(&self) -> Id; + } +); + +extern_methods!( + /// NSServerTrust + unsafe impl NSURLCredential {} +); diff --git a/crates/icrate/src/generated/Foundation/NSURLCredentialStorage.rs b/crates/icrate/src/generated/Foundation/NSURLCredentialStorage.rs new file mode 100644 index 000000000..99b6389cb --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLCredentialStorage.rs @@ -0,0 +1,116 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSURLCredentialStorage; + + unsafe impl ClassType for NSURLCredentialStorage { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLCredentialStorage { + #[method_id(@__retain_semantics Other sharedCredentialStorage)] + pub unsafe fn sharedCredentialStorage() -> Id; + + #[method_id(@__retain_semantics Other credentialsForProtectionSpace:)] + pub unsafe fn credentialsForProtectionSpace( + &self, + space: &NSURLProtectionSpace, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other allCredentials)] + pub unsafe fn allCredentials( + &self, + ) -> Id>, Shared>; + + #[method(setCredential:forProtectionSpace:)] + pub unsafe fn setCredential_forProtectionSpace( + &self, + credential: &NSURLCredential, + space: &NSURLProtectionSpace, + ); + + #[method(removeCredential:forProtectionSpace:)] + pub unsafe fn removeCredential_forProtectionSpace( + &self, + credential: &NSURLCredential, + space: &NSURLProtectionSpace, + ); + + #[method(removeCredential:forProtectionSpace:options:)] + pub unsafe fn removeCredential_forProtectionSpace_options( + &self, + credential: &NSURLCredential, + space: &NSURLProtectionSpace, + options: Option<&NSDictionary>, + ); + + #[method_id(@__retain_semantics Other defaultCredentialForProtectionSpace:)] + pub unsafe fn defaultCredentialForProtectionSpace( + &self, + space: &NSURLProtectionSpace, + ) -> Option>; + + #[method(setDefaultCredential:forProtectionSpace:)] + pub unsafe fn setDefaultCredential_forProtectionSpace( + &self, + credential: &NSURLCredential, + space: &NSURLProtectionSpace, + ); + } +); + +extern_methods!( + /// NSURLSessionTaskAdditions + unsafe impl NSURLCredentialStorage { + #[method(getCredentialsForProtectionSpace:task:completionHandler:)] + pub unsafe fn getCredentialsForProtectionSpace_task_completionHandler( + &self, + protectionSpace: &NSURLProtectionSpace, + task: &NSURLSessionTask, + completionHandler: &Block<(*mut NSDictionary,), ()>, + ); + + #[method(setCredential:forProtectionSpace:task:)] + pub unsafe fn setCredential_forProtectionSpace_task( + &self, + credential: &NSURLCredential, + protectionSpace: &NSURLProtectionSpace, + task: &NSURLSessionTask, + ); + + #[method(removeCredential:forProtectionSpace:options:task:)] + pub unsafe fn removeCredential_forProtectionSpace_options_task( + &self, + credential: &NSURLCredential, + protectionSpace: &NSURLProtectionSpace, + options: Option<&NSDictionary>, + task: &NSURLSessionTask, + ); + + #[method(getDefaultCredentialForProtectionSpace:task:completionHandler:)] + pub unsafe fn getDefaultCredentialForProtectionSpace_task_completionHandler( + &self, + space: &NSURLProtectionSpace, + task: &NSURLSessionTask, + completionHandler: &Block<(*mut NSURLCredential,), ()>, + ); + + #[method(setDefaultCredential:forProtectionSpace:task:)] + pub unsafe fn setDefaultCredential_forProtectionSpace_task( + &self, + credential: &NSURLCredential, + protectionSpace: &NSURLProtectionSpace, + task: &NSURLSessionTask, + ); + } +); + +extern_static!(NSURLCredentialStorageChangedNotification: &'static NSNotificationName); + +extern_static!(NSURLCredentialStorageRemoveSynchronizableCredentials: &'static NSString); diff --git a/crates/icrate/src/generated/Foundation/NSURLDownload.rs b/crates/icrate/src/generated/Foundation/NSURLDownload.rs new file mode 100644 index 000000000..6a50d330d --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLDownload.rs @@ -0,0 +1,157 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSURLDownload; + + unsafe impl ClassType for NSURLDownload { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLDownload { + #[method(canResumeDownloadDecodedWithEncodingMIMEType:)] + pub unsafe fn canResumeDownloadDecodedWithEncodingMIMEType(MIMEType: &NSString) -> bool; + + #[method_id(@__retain_semantics Init initWithRequest:delegate:)] + pub unsafe fn initWithRequest_delegate( + this: Option>, + request: &NSURLRequest, + delegate: Option<&NSURLDownloadDelegate>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithResumeData:delegate:path:)] + pub unsafe fn initWithResumeData_delegate_path( + this: Option>, + resumeData: &NSData, + delegate: Option<&NSURLDownloadDelegate>, + path: &NSString, + ) -> Id; + + #[method(cancel)] + pub unsafe fn cancel(&self); + + #[method(setDestination:allowOverwrite:)] + pub unsafe fn setDestination_allowOverwrite(&self, path: &NSString, allowOverwrite: bool); + + #[method_id(@__retain_semantics Other request)] + pub unsafe fn request(&self) -> Id; + + #[method_id(@__retain_semantics Other resumeData)] + pub unsafe fn resumeData(&self) -> Option>; + + #[method(deletesFileUponFailure)] + pub unsafe fn deletesFileUponFailure(&self) -> bool; + + #[method(setDeletesFileUponFailure:)] + pub unsafe fn setDeletesFileUponFailure(&self, deletesFileUponFailure: bool); + } +); + +extern_protocol!( + pub struct NSURLDownloadDelegate; + + unsafe impl NSURLDownloadDelegate { + #[optional] + #[method(downloadDidBegin:)] + pub unsafe fn downloadDidBegin(&self, download: &NSURLDownload); + + #[optional] + #[method_id(@__retain_semantics Other download:willSendRequest:redirectResponse:)] + pub unsafe fn download_willSendRequest_redirectResponse( + &self, + download: &NSURLDownload, + request: &NSURLRequest, + redirectResponse: Option<&NSURLResponse>, + ) -> Option>; + + #[optional] + #[method(download:canAuthenticateAgainstProtectionSpace:)] + pub unsafe fn download_canAuthenticateAgainstProtectionSpace( + &self, + connection: &NSURLDownload, + protectionSpace: &NSURLProtectionSpace, + ) -> bool; + + #[optional] + #[method(download:didReceiveAuthenticationChallenge:)] + pub unsafe fn download_didReceiveAuthenticationChallenge( + &self, + download: &NSURLDownload, + challenge: &NSURLAuthenticationChallenge, + ); + + #[optional] + #[method(download:didCancelAuthenticationChallenge:)] + pub unsafe fn download_didCancelAuthenticationChallenge( + &self, + download: &NSURLDownload, + challenge: &NSURLAuthenticationChallenge, + ); + + #[optional] + #[method(downloadShouldUseCredentialStorage:)] + pub unsafe fn downloadShouldUseCredentialStorage(&self, download: &NSURLDownload) -> bool; + + #[optional] + #[method(download:didReceiveResponse:)] + pub unsafe fn download_didReceiveResponse( + &self, + download: &NSURLDownload, + response: &NSURLResponse, + ); + + #[optional] + #[method(download:willResumeWithResponse:fromByte:)] + pub unsafe fn download_willResumeWithResponse_fromByte( + &self, + download: &NSURLDownload, + response: &NSURLResponse, + startingByte: c_longlong, + ); + + #[optional] + #[method(download:didReceiveDataOfLength:)] + pub unsafe fn download_didReceiveDataOfLength( + &self, + download: &NSURLDownload, + length: NSUInteger, + ); + + #[optional] + #[method(download:shouldDecodeSourceDataOfMIMEType:)] + pub unsafe fn download_shouldDecodeSourceDataOfMIMEType( + &self, + download: &NSURLDownload, + encodingType: &NSString, + ) -> bool; + + #[optional] + #[method(download:decideDestinationWithSuggestedFilename:)] + pub unsafe fn download_decideDestinationWithSuggestedFilename( + &self, + download: &NSURLDownload, + filename: &NSString, + ); + + #[optional] + #[method(download:didCreateDestination:)] + pub unsafe fn download_didCreateDestination( + &self, + download: &NSURLDownload, + path: &NSString, + ); + + #[optional] + #[method(downloadDidFinish:)] + pub unsafe fn downloadDidFinish(&self, download: &NSURLDownload); + + #[optional] + #[method(download:didFailWithError:)] + pub unsafe fn download_didFailWithError(&self, download: &NSURLDownload, error: &NSError); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSURLError.rs b/crates/icrate/src/generated/Foundation/NSURLError.rs new file mode 100644 index 000000000..05ac44e28 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLError.rs @@ -0,0 +1,91 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSURLErrorDomain: &'static NSErrorDomain); + +extern_static!(NSURLErrorFailingURLErrorKey: &'static NSString); + +extern_static!(NSURLErrorFailingURLStringErrorKey: &'static NSString); + +extern_static!(NSErrorFailingURLStringKey: &'static NSString); + +extern_static!(NSURLErrorFailingURLPeerTrustErrorKey: &'static NSString); + +extern_static!(NSURLErrorBackgroundTaskCancelledReasonKey: &'static NSString); + +ns_enum!( + #[underlying(NSInteger)] + pub enum { + NSURLErrorCancelledReasonUserForceQuitApplication = 0, + NSURLErrorCancelledReasonBackgroundUpdatesDisabled = 1, + NSURLErrorCancelledReasonInsufficientSystemResources = 2, + } +); + +extern_static!(NSURLErrorNetworkUnavailableReasonKey: &'static NSErrorUserInfoKey); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSURLErrorNetworkUnavailableReason { + NSURLErrorNetworkUnavailableReasonCellular = 0, + NSURLErrorNetworkUnavailableReasonExpensive = 1, + NSURLErrorNetworkUnavailableReasonConstrained = 2, + } +); + +ns_error_enum!( + #[underlying(NSInteger)] + pub enum { + NSURLErrorUnknown = -1, + NSURLErrorCancelled = -999, + NSURLErrorBadURL = -1000, + NSURLErrorTimedOut = -1001, + NSURLErrorUnsupportedURL = -1002, + NSURLErrorCannotFindHost = -1003, + NSURLErrorCannotConnectToHost = -1004, + NSURLErrorNetworkConnectionLost = -1005, + NSURLErrorDNSLookupFailed = -1006, + NSURLErrorHTTPTooManyRedirects = -1007, + NSURLErrorResourceUnavailable = -1008, + NSURLErrorNotConnectedToInternet = -1009, + NSURLErrorRedirectToNonExistentLocation = -1010, + NSURLErrorBadServerResponse = -1011, + NSURLErrorUserCancelledAuthentication = -1012, + NSURLErrorUserAuthenticationRequired = -1013, + NSURLErrorZeroByteResource = -1014, + NSURLErrorCannotDecodeRawData = -1015, + NSURLErrorCannotDecodeContentData = -1016, + NSURLErrorCannotParseResponse = -1017, + NSURLErrorAppTransportSecurityRequiresSecureConnection = -1022, + NSURLErrorFileDoesNotExist = -1100, + NSURLErrorFileIsDirectory = -1101, + NSURLErrorNoPermissionsToReadFile = -1102, + NSURLErrorDataLengthExceedsMaximum = -1103, + NSURLErrorFileOutsideSafeArea = -1104, + NSURLErrorSecureConnectionFailed = -1200, + NSURLErrorServerCertificateHasBadDate = -1201, + NSURLErrorServerCertificateUntrusted = -1202, + NSURLErrorServerCertificateHasUnknownRoot = -1203, + NSURLErrorServerCertificateNotYetValid = -1204, + NSURLErrorClientCertificateRejected = -1205, + NSURLErrorClientCertificateRequired = -1206, + NSURLErrorCannotLoadFromNetwork = -2000, + NSURLErrorCannotCreateFile = -3000, + NSURLErrorCannotOpenFile = -3001, + NSURLErrorCannotCloseFile = -3002, + NSURLErrorCannotWriteToFile = -3003, + NSURLErrorCannotRemoveFile = -3004, + NSURLErrorCannotMoveFile = -3005, + NSURLErrorDownloadDecodingFailedMidStream = -3006, + NSURLErrorDownloadDecodingFailedToComplete = -3007, + NSURLErrorInternationalRoamingOff = -1018, + NSURLErrorCallIsActive = -1019, + NSURLErrorDataNotAllowed = -1020, + NSURLErrorRequestBodyStreamExhausted = -1021, + NSURLErrorBackgroundSessionRequiresSharedContainer = -995, + NSURLErrorBackgroundSessionInUseByAnotherProcess = -996, + NSURLErrorBackgroundSessionWasDisconnected = -997, + } +); diff --git a/crates/icrate/src/generated/Foundation/NSURLHandle.rs b/crates/icrate/src/generated/Foundation/NSURLHandle.rs new file mode 100644 index 000000000..c0e638e07 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLHandle.rs @@ -0,0 +1,164 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSHTTPPropertyStatusCodeKey: Option<&'static NSString>); + +extern_static!(NSHTTPPropertyStatusReasonKey: Option<&'static NSString>); + +extern_static!(NSHTTPPropertyServerHTTPVersionKey: Option<&'static NSString>); + +extern_static!(NSHTTPPropertyRedirectionHeadersKey: Option<&'static NSString>); + +extern_static!(NSHTTPPropertyErrorPageDataKey: Option<&'static NSString>); + +extern_static!(NSHTTPPropertyHTTPProxy: Option<&'static NSString>); + +extern_static!(NSFTPPropertyUserLoginKey: Option<&'static NSString>); + +extern_static!(NSFTPPropertyUserPasswordKey: Option<&'static NSString>); + +extern_static!(NSFTPPropertyActiveTransferModeKey: Option<&'static NSString>); + +extern_static!(NSFTPPropertyFileOffsetKey: Option<&'static NSString>); + +extern_static!(NSFTPPropertyFTPProxy: Option<&'static NSString>); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSURLHandleStatus { + NSURLHandleNotLoaded = 0, + NSURLHandleLoadSucceeded = 1, + NSURLHandleLoadInProgress = 2, + NSURLHandleLoadFailed = 3, + } +); + +extern_protocol!( + pub struct NSURLHandleClient; + + unsafe impl NSURLHandleClient { + #[method(URLHandle:resourceDataDidBecomeAvailable:)] + pub unsafe fn URLHandle_resourceDataDidBecomeAvailable( + &self, + sender: Option<&NSURLHandle>, + newBytes: Option<&NSData>, + ); + + #[method(URLHandleResourceDidBeginLoading:)] + pub unsafe fn URLHandleResourceDidBeginLoading(&self, sender: Option<&NSURLHandle>); + + #[method(URLHandleResourceDidFinishLoading:)] + pub unsafe fn URLHandleResourceDidFinishLoading(&self, sender: Option<&NSURLHandle>); + + #[method(URLHandleResourceDidCancelLoading:)] + pub unsafe fn URLHandleResourceDidCancelLoading(&self, sender: Option<&NSURLHandle>); + + #[method(URLHandle:resourceDidFailLoadingWithReason:)] + pub unsafe fn URLHandle_resourceDidFailLoadingWithReason( + &self, + sender: Option<&NSURLHandle>, + reason: Option<&NSString>, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLHandle; + + unsafe impl ClassType for NSURLHandle { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLHandle { + #[method(registerURLHandleClass:)] + pub unsafe fn registerURLHandleClass(anURLHandleSubclass: Option<&Class>); + + #[method(URLHandleClassForURL:)] + pub unsafe fn URLHandleClassForURL(anURL: Option<&NSURL>) -> Option<&'static Class>; + + #[method(status)] + pub unsafe fn status(&self) -> NSURLHandleStatus; + + #[method_id(@__retain_semantics Other failureReason)] + pub unsafe fn failureReason(&self) -> Option>; + + #[method(addClient:)] + pub unsafe fn addClient(&self, client: Option<&NSURLHandleClient>); + + #[method(removeClient:)] + pub unsafe fn removeClient(&self, client: Option<&NSURLHandleClient>); + + #[method(loadInBackground)] + pub unsafe fn loadInBackground(&self); + + #[method(cancelLoadInBackground)] + pub unsafe fn cancelLoadInBackground(&self); + + #[method_id(@__retain_semantics Other resourceData)] + pub unsafe fn resourceData(&self) -> Option>; + + #[method_id(@__retain_semantics Other availableResourceData)] + pub unsafe fn availableResourceData(&self) -> Option>; + + #[method(expectedResourceDataSize)] + pub unsafe fn expectedResourceDataSize(&self) -> c_longlong; + + #[method(flushCachedData)] + pub unsafe fn flushCachedData(&self); + + #[method(backgroundLoadDidFailWithReason:)] + pub unsafe fn backgroundLoadDidFailWithReason(&self, reason: Option<&NSString>); + + #[method(didLoadBytes:loadComplete:)] + pub unsafe fn didLoadBytes_loadComplete(&self, newBytes: Option<&NSData>, yorn: bool); + + #[method(canInitWithURL:)] + pub unsafe fn canInitWithURL(anURL: Option<&NSURL>) -> bool; + + #[method_id(@__retain_semantics Other cachedHandleForURL:)] + pub unsafe fn cachedHandleForURL(anURL: Option<&NSURL>) -> Option>; + + #[method_id(@__retain_semantics Init initWithURL:cached:)] + pub unsafe fn initWithURL_cached( + this: Option>, + anURL: Option<&NSURL>, + willCache: bool, + ) -> Option>; + + #[method_id(@__retain_semantics Other propertyForKey:)] + pub unsafe fn propertyForKey( + &self, + propertyKey: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Other propertyForKeyIfAvailable:)] + pub unsafe fn propertyForKeyIfAvailable( + &self, + propertyKey: Option<&NSString>, + ) -> Option>; + + #[method(writeProperty:forKey:)] + pub unsafe fn writeProperty_forKey( + &self, + propertyValue: Option<&Object>, + propertyKey: Option<&NSString>, + ) -> bool; + + #[method(writeData:)] + pub unsafe fn writeData(&self, data: Option<&NSData>) -> bool; + + #[method_id(@__retain_semantics Other loadInForeground)] + pub unsafe fn loadInForeground(&self) -> Option>; + + #[method(beginLoadInBackground)] + pub unsafe fn beginLoadInBackground(&self); + + #[method(endLoadInBackground)] + pub unsafe fn endLoadInBackground(&self); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSURLProtectionSpace.rs b/crates/icrate/src/generated/Foundation/NSURLProtectionSpace.rs new file mode 100644 index 000000000..961ffa194 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLProtectionSpace.rs @@ -0,0 +1,104 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSURLProtectionSpaceHTTP: &'static NSString); + +extern_static!(NSURLProtectionSpaceHTTPS: &'static NSString); + +extern_static!(NSURLProtectionSpaceFTP: &'static NSString); + +extern_static!(NSURLProtectionSpaceHTTPProxy: &'static NSString); + +extern_static!(NSURLProtectionSpaceHTTPSProxy: &'static NSString); + +extern_static!(NSURLProtectionSpaceFTPProxy: &'static NSString); + +extern_static!(NSURLProtectionSpaceSOCKSProxy: &'static NSString); + +extern_static!(NSURLAuthenticationMethodDefault: &'static NSString); + +extern_static!(NSURLAuthenticationMethodHTTPBasic: &'static NSString); + +extern_static!(NSURLAuthenticationMethodHTTPDigest: &'static NSString); + +extern_static!(NSURLAuthenticationMethodHTMLForm: &'static NSString); + +extern_static!(NSURLAuthenticationMethodNTLM: &'static NSString); + +extern_static!(NSURLAuthenticationMethodNegotiate: &'static NSString); + +extern_static!(NSURLAuthenticationMethodClientCertificate: &'static NSString); + +extern_static!(NSURLAuthenticationMethodServerTrust: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSURLProtectionSpace; + + unsafe impl ClassType for NSURLProtectionSpace { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLProtectionSpace { + #[method_id(@__retain_semantics Init initWithHost:port:protocol:realm:authenticationMethod:)] + pub unsafe fn initWithHost_port_protocol_realm_authenticationMethod( + this: Option>, + host: &NSString, + port: NSInteger, + protocol: Option<&NSString>, + realm: Option<&NSString>, + authenticationMethod: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithProxyHost:port:type:realm:authenticationMethod:)] + pub unsafe fn initWithProxyHost_port_type_realm_authenticationMethod( + this: Option>, + host: &NSString, + port: NSInteger, + type_: Option<&NSString>, + realm: Option<&NSString>, + authenticationMethod: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Other realm)] + pub unsafe fn realm(&self) -> Option>; + + #[method(receivesCredentialSecurely)] + pub unsafe fn receivesCredentialSecurely(&self) -> bool; + + #[method(isProxy)] + pub unsafe fn isProxy(&self) -> bool; + + #[method_id(@__retain_semantics Other host)] + pub unsafe fn host(&self) -> Id; + + #[method(port)] + pub unsafe fn port(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other proxyType)] + pub unsafe fn proxyType(&self) -> Option>; + + #[method_id(@__retain_semantics Other protocol)] + pub unsafe fn protocol(&self) -> Option>; + + #[method_id(@__retain_semantics Other authenticationMethod)] + pub unsafe fn authenticationMethod(&self) -> Id; + } +); + +extern_methods!( + /// NSClientCertificateSpace + unsafe impl NSURLProtectionSpace { + #[method_id(@__retain_semantics Other distinguishedNames)] + pub unsafe fn distinguishedNames(&self) -> Option, Shared>>; + } +); + +extern_methods!( + /// NSServerTrustValidationSpace + unsafe impl NSURLProtectionSpace {} +); diff --git a/crates/icrate/src/generated/Foundation/NSURLProtocol.rs b/crates/icrate/src/generated/Foundation/NSURLProtocol.rs new file mode 100644 index 000000000..2479082f8 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLProtocol.rs @@ -0,0 +1,151 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSURLProtocolClient; + + unsafe impl NSURLProtocolClient { + #[method(URLProtocol:wasRedirectedToRequest:redirectResponse:)] + pub unsafe fn URLProtocol_wasRedirectedToRequest_redirectResponse( + &self, + protocol: &NSURLProtocol, + request: &NSURLRequest, + redirectResponse: &NSURLResponse, + ); + + #[method(URLProtocol:cachedResponseIsValid:)] + pub unsafe fn URLProtocol_cachedResponseIsValid( + &self, + protocol: &NSURLProtocol, + cachedResponse: &NSCachedURLResponse, + ); + + #[method(URLProtocol:didReceiveResponse:cacheStoragePolicy:)] + pub unsafe fn URLProtocol_didReceiveResponse_cacheStoragePolicy( + &self, + protocol: &NSURLProtocol, + response: &NSURLResponse, + policy: NSURLCacheStoragePolicy, + ); + + #[method(URLProtocol:didLoadData:)] + pub unsafe fn URLProtocol_didLoadData(&self, protocol: &NSURLProtocol, data: &NSData); + + #[method(URLProtocolDidFinishLoading:)] + pub unsafe fn URLProtocolDidFinishLoading(&self, protocol: &NSURLProtocol); + + #[method(URLProtocol:didFailWithError:)] + pub unsafe fn URLProtocol_didFailWithError( + &self, + protocol: &NSURLProtocol, + error: &NSError, + ); + + #[method(URLProtocol:didReceiveAuthenticationChallenge:)] + pub unsafe fn URLProtocol_didReceiveAuthenticationChallenge( + &self, + protocol: &NSURLProtocol, + challenge: &NSURLAuthenticationChallenge, + ); + + #[method(URLProtocol:didCancelAuthenticationChallenge:)] + pub unsafe fn URLProtocol_didCancelAuthenticationChallenge( + &self, + protocol: &NSURLProtocol, + challenge: &NSURLAuthenticationChallenge, + ); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLProtocol; + + unsafe impl ClassType for NSURLProtocol { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLProtocol { + #[method_id(@__retain_semantics Init initWithRequest:cachedResponse:client:)] + pub unsafe fn initWithRequest_cachedResponse_client( + this: Option>, + request: &NSURLRequest, + cachedResponse: Option<&NSCachedURLResponse>, + client: Option<&NSURLProtocolClient>, + ) -> Id; + + #[method_id(@__retain_semantics Other client)] + pub unsafe fn client(&self) -> Option>; + + #[method_id(@__retain_semantics Other request)] + pub unsafe fn request(&self) -> Id; + + #[method_id(@__retain_semantics Other cachedResponse)] + pub unsafe fn cachedResponse(&self) -> Option>; + + #[method(canInitWithRequest:)] + pub unsafe fn canInitWithRequest(request: &NSURLRequest) -> bool; + + #[method_id(@__retain_semantics Other canonicalRequestForRequest:)] + pub unsafe fn canonicalRequestForRequest( + request: &NSURLRequest, + ) -> Id; + + #[method(requestIsCacheEquivalent:toRequest:)] + pub unsafe fn requestIsCacheEquivalent_toRequest( + a: &NSURLRequest, + b: &NSURLRequest, + ) -> bool; + + #[method(startLoading)] + pub unsafe fn startLoading(&self); + + #[method(stopLoading)] + pub unsafe fn stopLoading(&self); + + #[method_id(@__retain_semantics Other propertyForKey:inRequest:)] + pub unsafe fn propertyForKey_inRequest( + key: &NSString, + request: &NSURLRequest, + ) -> Option>; + + #[method(setProperty:forKey:inRequest:)] + pub unsafe fn setProperty_forKey_inRequest( + value: &Object, + key: &NSString, + request: &NSMutableURLRequest, + ); + + #[method(removePropertyForKey:inRequest:)] + pub unsafe fn removePropertyForKey_inRequest(key: &NSString, request: &NSMutableURLRequest); + + #[method(registerClass:)] + pub unsafe fn registerClass(protocolClass: &Class) -> bool; + + #[method(unregisterClass:)] + pub unsafe fn unregisterClass(protocolClass: &Class); + } +); + +extern_methods!( + /// NSURLSessionTaskAdditions + unsafe impl NSURLProtocol { + #[method(canInitWithTask:)] + pub unsafe fn canInitWithTask(task: &NSURLSessionTask) -> bool; + + #[method_id(@__retain_semantics Init initWithTask:cachedResponse:client:)] + pub unsafe fn initWithTask_cachedResponse_client( + this: Option>, + task: &NSURLSessionTask, + cachedResponse: Option<&NSCachedURLResponse>, + client: Option<&NSURLProtocolClient>, + ) -> Id; + + #[method_id(@__retain_semantics Other task)] + pub unsafe fn task(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSURLRequest.rs b/crates/icrate/src/generated/Foundation/NSURLRequest.rs new file mode 100644 index 000000000..afccd3a40 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLRequest.rs @@ -0,0 +1,273 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSURLRequestCachePolicy { + NSURLRequestUseProtocolCachePolicy = 0, + NSURLRequestReloadIgnoringLocalCacheData = 1, + NSURLRequestReloadIgnoringLocalAndRemoteCacheData = 4, + NSURLRequestReloadIgnoringCacheData = NSURLRequestReloadIgnoringLocalCacheData, + NSURLRequestReturnCacheDataElseLoad = 2, + NSURLRequestReturnCacheDataDontLoad = 3, + NSURLRequestReloadRevalidatingCacheData = 5, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSURLRequestNetworkServiceType { + NSURLNetworkServiceTypeDefault = 0, + NSURLNetworkServiceTypeVoIP = 1, + NSURLNetworkServiceTypeVideo = 2, + NSURLNetworkServiceTypeBackground = 3, + NSURLNetworkServiceTypeVoice = 4, + NSURLNetworkServiceTypeResponsiveData = 6, + NSURLNetworkServiceTypeAVStreaming = 8, + NSURLNetworkServiceTypeResponsiveAV = 9, + NSURLNetworkServiceTypeCallSignaling = 11, + } +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSURLRequestAttribution { + NSURLRequestAttributionDeveloper = 0, + NSURLRequestAttributionUser = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLRequest; + + unsafe impl ClassType for NSURLRequest { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLRequest { + #[method_id(@__retain_semantics Other requestWithURL:)] + pub unsafe fn requestWithURL(URL: &NSURL) -> Id; + + #[method(supportsSecureCoding)] + pub unsafe fn supportsSecureCoding() -> bool; + + #[method_id(@__retain_semantics Other requestWithURL:cachePolicy:timeoutInterval:)] + pub unsafe fn requestWithURL_cachePolicy_timeoutInterval( + URL: &NSURL, + cachePolicy: NSURLRequestCachePolicy, + timeoutInterval: NSTimeInterval, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithURL:)] + pub unsafe fn initWithURL(this: Option>, URL: &NSURL) -> Id; + + #[method_id(@__retain_semantics Init initWithURL:cachePolicy:timeoutInterval:)] + pub unsafe fn initWithURL_cachePolicy_timeoutInterval( + this: Option>, + URL: &NSURL, + cachePolicy: NSURLRequestCachePolicy, + timeoutInterval: NSTimeInterval, + ) -> Id; + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + + #[method(cachePolicy)] + pub unsafe fn cachePolicy(&self) -> NSURLRequestCachePolicy; + + #[method(timeoutInterval)] + pub unsafe fn timeoutInterval(&self) -> NSTimeInterval; + + #[method_id(@__retain_semantics Other mainDocumentURL)] + pub unsafe fn mainDocumentURL(&self) -> Option>; + + #[method(networkServiceType)] + pub unsafe fn networkServiceType(&self) -> NSURLRequestNetworkServiceType; + + #[method(allowsCellularAccess)] + pub unsafe fn allowsCellularAccess(&self) -> bool; + + #[method(allowsExpensiveNetworkAccess)] + pub unsafe fn allowsExpensiveNetworkAccess(&self) -> bool; + + #[method(allowsConstrainedNetworkAccess)] + pub unsafe fn allowsConstrainedNetworkAccess(&self) -> bool; + + #[method(assumesHTTP3Capable)] + pub unsafe fn assumesHTTP3Capable(&self) -> bool; + + #[method(attribution)] + pub unsafe fn attribution(&self) -> NSURLRequestAttribution; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSMutableURLRequest; + + unsafe impl ClassType for NSMutableURLRequest { + type Super = NSURLRequest; + } +); + +extern_methods!( + unsafe impl NSMutableURLRequest { + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + + #[method(setURL:)] + pub unsafe fn setURL(&self, URL: Option<&NSURL>); + + #[method(cachePolicy)] + pub unsafe fn cachePolicy(&self) -> NSURLRequestCachePolicy; + + #[method(setCachePolicy:)] + pub unsafe fn setCachePolicy(&self, cachePolicy: NSURLRequestCachePolicy); + + #[method(timeoutInterval)] + pub unsafe fn timeoutInterval(&self) -> NSTimeInterval; + + #[method(setTimeoutInterval:)] + pub unsafe fn setTimeoutInterval(&self, timeoutInterval: NSTimeInterval); + + #[method_id(@__retain_semantics Other mainDocumentURL)] + pub unsafe fn mainDocumentURL(&self) -> Option>; + + #[method(setMainDocumentURL:)] + pub unsafe fn setMainDocumentURL(&self, mainDocumentURL: Option<&NSURL>); + + #[method(networkServiceType)] + pub unsafe fn networkServiceType(&self) -> NSURLRequestNetworkServiceType; + + #[method(setNetworkServiceType:)] + pub unsafe fn setNetworkServiceType( + &self, + networkServiceType: NSURLRequestNetworkServiceType, + ); + + #[method(allowsCellularAccess)] + pub unsafe fn allowsCellularAccess(&self) -> bool; + + #[method(setAllowsCellularAccess:)] + pub unsafe fn setAllowsCellularAccess(&self, allowsCellularAccess: bool); + + #[method(allowsExpensiveNetworkAccess)] + pub unsafe fn allowsExpensiveNetworkAccess(&self) -> bool; + + #[method(setAllowsExpensiveNetworkAccess:)] + pub unsafe fn setAllowsExpensiveNetworkAccess(&self, allowsExpensiveNetworkAccess: bool); + + #[method(allowsConstrainedNetworkAccess)] + pub unsafe fn allowsConstrainedNetworkAccess(&self) -> bool; + + #[method(setAllowsConstrainedNetworkAccess:)] + pub unsafe fn setAllowsConstrainedNetworkAccess( + &self, + allowsConstrainedNetworkAccess: bool, + ); + + #[method(assumesHTTP3Capable)] + pub unsafe fn assumesHTTP3Capable(&self) -> bool; + + #[method(setAssumesHTTP3Capable:)] + pub unsafe fn setAssumesHTTP3Capable(&self, assumesHTTP3Capable: bool); + + #[method(attribution)] + pub unsafe fn attribution(&self) -> NSURLRequestAttribution; + + #[method(setAttribution:)] + pub unsafe fn setAttribution(&self, attribution: NSURLRequestAttribution); + } +); + +extern_methods!( + /// NSHTTPURLRequest + unsafe impl NSURLRequest { + #[method_id(@__retain_semantics Other HTTPMethod)] + pub unsafe fn HTTPMethod(&self) -> Option>; + + #[method_id(@__retain_semantics Other allHTTPHeaderFields)] + pub unsafe fn allHTTPHeaderFields( + &self, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other valueForHTTPHeaderField:)] + pub unsafe fn valueForHTTPHeaderField( + &self, + field: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other HTTPBody)] + pub unsafe fn HTTPBody(&self) -> Option>; + + #[method_id(@__retain_semantics Other HTTPBodyStream)] + pub unsafe fn HTTPBodyStream(&self) -> Option>; + + #[method(HTTPShouldHandleCookies)] + pub unsafe fn HTTPShouldHandleCookies(&self) -> bool; + + #[method(HTTPShouldUsePipelining)] + pub unsafe fn HTTPShouldUsePipelining(&self) -> bool; + } +); + +extern_methods!( + /// NSMutableHTTPURLRequest + unsafe impl NSMutableURLRequest { + #[method_id(@__retain_semantics Other HTTPMethod)] + pub unsafe fn HTTPMethod(&self) -> Id; + + #[method(setHTTPMethod:)] + pub unsafe fn setHTTPMethod(&self, HTTPMethod: &NSString); + + #[method_id(@__retain_semantics Other allHTTPHeaderFields)] + pub unsafe fn allHTTPHeaderFields( + &self, + ) -> Option, Shared>>; + + #[method(setAllHTTPHeaderFields:)] + pub unsafe fn setAllHTTPHeaderFields( + &self, + allHTTPHeaderFields: Option<&NSDictionary>, + ); + + #[method(setValue:forHTTPHeaderField:)] + pub unsafe fn setValue_forHTTPHeaderField( + &self, + value: Option<&NSString>, + field: &NSString, + ); + + #[method(addValue:forHTTPHeaderField:)] + pub unsafe fn addValue_forHTTPHeaderField(&self, value: &NSString, field: &NSString); + + #[method_id(@__retain_semantics Other HTTPBody)] + pub unsafe fn HTTPBody(&self) -> Option>; + + #[method(setHTTPBody:)] + pub unsafe fn setHTTPBody(&self, HTTPBody: Option<&NSData>); + + #[method_id(@__retain_semantics Other HTTPBodyStream)] + pub unsafe fn HTTPBodyStream(&self) -> Option>; + + #[method(setHTTPBodyStream:)] + pub unsafe fn setHTTPBodyStream(&self, HTTPBodyStream: Option<&NSInputStream>); + + #[method(HTTPShouldHandleCookies)] + pub unsafe fn HTTPShouldHandleCookies(&self) -> bool; + + #[method(setHTTPShouldHandleCookies:)] + pub unsafe fn setHTTPShouldHandleCookies(&self, HTTPShouldHandleCookies: bool); + + #[method(HTTPShouldUsePipelining)] + pub unsafe fn HTTPShouldUsePipelining(&self) -> bool; + + #[method(setHTTPShouldUsePipelining:)] + pub unsafe fn setHTTPShouldUsePipelining(&self, HTTPShouldUsePipelining: bool); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSURLResponse.rs b/crates/icrate/src/generated/Foundation/NSURLResponse.rs new file mode 100644 index 000000000..55544971c --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLResponse.rs @@ -0,0 +1,78 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSURLResponse; + + unsafe impl ClassType for NSURLResponse { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLResponse { + #[method_id(@__retain_semantics Init initWithURL:MIMEType:expectedContentLength:textEncodingName:)] + pub unsafe fn initWithURL_MIMEType_expectedContentLength_textEncodingName( + this: Option>, + URL: &NSURL, + MIMEType: Option<&NSString>, + length: NSInteger, + name: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Other URL)] + pub unsafe fn URL(&self) -> Option>; + + #[method_id(@__retain_semantics Other MIMEType)] + pub unsafe fn MIMEType(&self) -> Option>; + + #[method(expectedContentLength)] + pub unsafe fn expectedContentLength(&self) -> c_longlong; + + #[method_id(@__retain_semantics Other textEncodingName)] + pub unsafe fn textEncodingName(&self) -> Option>; + + #[method_id(@__retain_semantics Other suggestedFilename)] + pub unsafe fn suggestedFilename(&self) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSHTTPURLResponse; + + unsafe impl ClassType for NSHTTPURLResponse { + type Super = NSURLResponse; + } +); + +extern_methods!( + unsafe impl NSHTTPURLResponse { + #[method_id(@__retain_semantics Init initWithURL:statusCode:HTTPVersion:headerFields:)] + pub unsafe fn initWithURL_statusCode_HTTPVersion_headerFields( + this: Option>, + url: &NSURL, + statusCode: NSInteger, + HTTPVersion: Option<&NSString>, + headerFields: Option<&NSDictionary>, + ) -> Option>; + + #[method(statusCode)] + pub unsafe fn statusCode(&self) -> NSInteger; + + #[method_id(@__retain_semantics Other allHeaderFields)] + pub unsafe fn allHeaderFields(&self) -> Id; + + #[method_id(@__retain_semantics Other valueForHTTPHeaderField:)] + pub unsafe fn valueForHTTPHeaderField( + &self, + field: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other localizedStringForStatusCode:)] + pub unsafe fn localizedStringForStatusCode(statusCode: NSInteger) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSURLSession.rs b/crates/icrate/src/generated/Foundation/NSURLSession.rs new file mode 100644 index 000000000..773d2455e --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSURLSession.rs @@ -0,0 +1,1288 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSURLSessionTransferSizeUnknown: i64); + +extern_class!( + #[derive(Debug)] + pub struct NSURLSession; + + unsafe impl ClassType for NSURLSession { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLSession { + #[method_id(@__retain_semantics Other sharedSession)] + pub unsafe fn sharedSession() -> Id; + + #[method_id(@__retain_semantics Other sessionWithConfiguration:)] + pub unsafe fn sessionWithConfiguration( + configuration: &NSURLSessionConfiguration, + ) -> Id; + + #[method_id(@__retain_semantics Other sessionWithConfiguration:delegate:delegateQueue:)] + pub unsafe fn sessionWithConfiguration_delegate_delegateQueue( + configuration: &NSURLSessionConfiguration, + delegate: Option<&NSURLSessionDelegate>, + queue: Option<&NSOperationQueue>, + ) -> Id; + + #[method_id(@__retain_semantics Other delegateQueue)] + pub unsafe fn delegateQueue(&self) -> Id; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method_id(@__retain_semantics Other configuration)] + pub unsafe fn configuration(&self) -> Id; + + #[method_id(@__retain_semantics Other sessionDescription)] + pub unsafe fn sessionDescription(&self) -> Option>; + + #[method(setSessionDescription:)] + pub unsafe fn setSessionDescription(&self, sessionDescription: Option<&NSString>); + + #[method(finishTasksAndInvalidate)] + pub unsafe fn finishTasksAndInvalidate(&self); + + #[method(invalidateAndCancel)] + pub unsafe fn invalidateAndCancel(&self); + + #[method(resetWithCompletionHandler:)] + pub unsafe fn resetWithCompletionHandler(&self, completionHandler: &Block<(), ()>); + + #[method(flushWithCompletionHandler:)] + pub unsafe fn flushWithCompletionHandler(&self, completionHandler: &Block<(), ()>); + + #[method(getTasksWithCompletionHandler:)] + pub unsafe fn getTasksWithCompletionHandler( + &self, + completionHandler: &Block< + ( + NonNull>, + NonNull>, + NonNull>, + ), + (), + >, + ); + + #[method(getAllTasksWithCompletionHandler:)] + pub unsafe fn getAllTasksWithCompletionHandler( + &self, + completionHandler: &Block<(NonNull>,), ()>, + ); + + #[method_id(@__retain_semantics Other dataTaskWithRequest:)] + pub unsafe fn dataTaskWithRequest( + &self, + request: &NSURLRequest, + ) -> Id; + + #[method_id(@__retain_semantics Other dataTaskWithURL:)] + pub unsafe fn dataTaskWithURL(&self, url: &NSURL) -> Id; + + #[method_id(@__retain_semantics Other uploadTaskWithRequest:fromFile:)] + pub unsafe fn uploadTaskWithRequest_fromFile( + &self, + request: &NSURLRequest, + fileURL: &NSURL, + ) -> Id; + + #[method_id(@__retain_semantics Other uploadTaskWithRequest:fromData:)] + pub unsafe fn uploadTaskWithRequest_fromData( + &self, + request: &NSURLRequest, + bodyData: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Other uploadTaskWithStreamedRequest:)] + pub unsafe fn uploadTaskWithStreamedRequest( + &self, + request: &NSURLRequest, + ) -> Id; + + #[method_id(@__retain_semantics Other downloadTaskWithRequest:)] + pub unsafe fn downloadTaskWithRequest( + &self, + request: &NSURLRequest, + ) -> Id; + + #[method_id(@__retain_semantics Other downloadTaskWithURL:)] + pub unsafe fn downloadTaskWithURL( + &self, + url: &NSURL, + ) -> Id; + + #[method_id(@__retain_semantics Other downloadTaskWithResumeData:)] + pub unsafe fn downloadTaskWithResumeData( + &self, + resumeData: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Other streamTaskWithHostName:port:)] + pub unsafe fn streamTaskWithHostName_port( + &self, + hostname: &NSString, + port: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Other streamTaskWithNetService:)] + pub unsafe fn streamTaskWithNetService( + &self, + service: &NSNetService, + ) -> Id; + + #[method_id(@__retain_semantics Other webSocketTaskWithURL:)] + pub unsafe fn webSocketTaskWithURL( + &self, + url: &NSURL, + ) -> Id; + + #[method_id(@__retain_semantics Other webSocketTaskWithURL:protocols:)] + pub unsafe fn webSocketTaskWithURL_protocols( + &self, + url: &NSURL, + protocols: &NSArray, + ) -> Id; + + #[method_id(@__retain_semantics Other webSocketTaskWithRequest:)] + pub unsafe fn webSocketTaskWithRequest( + &self, + request: &NSURLRequest, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); + +extern_methods!( + /// NSURLSessionAsynchronousConvenience + unsafe impl NSURLSession { + #[method_id(@__retain_semantics Other dataTaskWithRequest:completionHandler:)] + pub unsafe fn dataTaskWithRequest_completionHandler( + &self, + request: &NSURLRequest, + completionHandler: &Block<(*mut NSData, *mut NSURLResponse, *mut NSError), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Other dataTaskWithURL:completionHandler:)] + pub unsafe fn dataTaskWithURL_completionHandler( + &self, + url: &NSURL, + completionHandler: &Block<(*mut NSData, *mut NSURLResponse, *mut NSError), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Other uploadTaskWithRequest:fromFile:completionHandler:)] + pub unsafe fn uploadTaskWithRequest_fromFile_completionHandler( + &self, + request: &NSURLRequest, + fileURL: &NSURL, + completionHandler: &Block<(*mut NSData, *mut NSURLResponse, *mut NSError), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Other uploadTaskWithRequest:fromData:completionHandler:)] + pub unsafe fn uploadTaskWithRequest_fromData_completionHandler( + &self, + request: &NSURLRequest, + bodyData: Option<&NSData>, + completionHandler: &Block<(*mut NSData, *mut NSURLResponse, *mut NSError), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Other downloadTaskWithRequest:completionHandler:)] + pub unsafe fn downloadTaskWithRequest_completionHandler( + &self, + request: &NSURLRequest, + completionHandler: &Block<(*mut NSURL, *mut NSURLResponse, *mut NSError), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Other downloadTaskWithURL:completionHandler:)] + pub unsafe fn downloadTaskWithURL_completionHandler( + &self, + url: &NSURL, + completionHandler: &Block<(*mut NSURL, *mut NSURLResponse, *mut NSError), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Other downloadTaskWithResumeData:completionHandler:)] + pub unsafe fn downloadTaskWithResumeData_completionHandler( + &self, + resumeData: &NSData, + completionHandler: &Block<(*mut NSURL, *mut NSURLResponse, *mut NSError), ()>, + ) -> Id; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSURLSessionTaskState { + NSURLSessionTaskStateRunning = 0, + NSURLSessionTaskStateSuspended = 1, + NSURLSessionTaskStateCanceling = 2, + NSURLSessionTaskStateCompleted = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLSessionTask; + + unsafe impl ClassType for NSURLSessionTask { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLSessionTask { + #[method(taskIdentifier)] + pub unsafe fn taskIdentifier(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other originalRequest)] + pub unsafe fn originalRequest(&self) -> Option>; + + #[method_id(@__retain_semantics Other currentRequest)] + pub unsafe fn currentRequest(&self) -> Option>; + + #[method_id(@__retain_semantics Other response)] + pub unsafe fn response(&self) -> Option>; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSURLSessionTaskDelegate>); + + #[method_id(@__retain_semantics Other progress)] + pub unsafe fn progress(&self) -> Id; + + #[method_id(@__retain_semantics Other earliestBeginDate)] + pub unsafe fn earliestBeginDate(&self) -> Option>; + + #[method(setEarliestBeginDate:)] + pub unsafe fn setEarliestBeginDate(&self, earliestBeginDate: Option<&NSDate>); + + #[method(countOfBytesClientExpectsToSend)] + pub unsafe fn countOfBytesClientExpectsToSend(&self) -> i64; + + #[method(setCountOfBytesClientExpectsToSend:)] + pub unsafe fn setCountOfBytesClientExpectsToSend( + &self, + countOfBytesClientExpectsToSend: i64, + ); + + #[method(countOfBytesClientExpectsToReceive)] + pub unsafe fn countOfBytesClientExpectsToReceive(&self) -> i64; + + #[method(setCountOfBytesClientExpectsToReceive:)] + pub unsafe fn setCountOfBytesClientExpectsToReceive( + &self, + countOfBytesClientExpectsToReceive: i64, + ); + + #[method(countOfBytesSent)] + pub unsafe fn countOfBytesSent(&self) -> i64; + + #[method(countOfBytesReceived)] + pub unsafe fn countOfBytesReceived(&self) -> i64; + + #[method(countOfBytesExpectedToSend)] + pub unsafe fn countOfBytesExpectedToSend(&self) -> i64; + + #[method(countOfBytesExpectedToReceive)] + pub unsafe fn countOfBytesExpectedToReceive(&self) -> i64; + + #[method_id(@__retain_semantics Other taskDescription)] + pub unsafe fn taskDescription(&self) -> Option>; + + #[method(setTaskDescription:)] + pub unsafe fn setTaskDescription(&self, taskDescription: Option<&NSString>); + + #[method(cancel)] + pub unsafe fn cancel(&self); + + #[method(state)] + pub unsafe fn state(&self) -> NSURLSessionTaskState; + + #[method_id(@__retain_semantics Other error)] + pub unsafe fn error(&self) -> Option>; + + #[method(suspend)] + pub unsafe fn suspend(&self); + + #[method(resume)] + pub unsafe fn resume(&self); + + #[method(priority)] + pub unsafe fn priority(&self) -> c_float; + + #[method(setPriority:)] + pub unsafe fn setPriority(&self, priority: c_float); + + #[method(prefersIncrementalDelivery)] + pub unsafe fn prefersIncrementalDelivery(&self) -> bool; + + #[method(setPrefersIncrementalDelivery:)] + pub unsafe fn setPrefersIncrementalDelivery(&self, prefersIncrementalDelivery: bool); + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); + +extern_static!(NSURLSessionTaskPriorityDefault: c_float); + +extern_static!(NSURLSessionTaskPriorityLow: c_float); + +extern_static!(NSURLSessionTaskPriorityHigh: c_float); + +extern_class!( + #[derive(Debug)] + pub struct NSURLSessionDataTask; + + unsafe impl ClassType for NSURLSessionDataTask { + type Super = NSURLSessionTask; + } +); + +extern_methods!( + unsafe impl NSURLSessionDataTask { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLSessionUploadTask; + + unsafe impl ClassType for NSURLSessionUploadTask { + type Super = NSURLSessionDataTask; + } +); + +extern_methods!( + unsafe impl NSURLSessionUploadTask { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLSessionDownloadTask; + + unsafe impl ClassType for NSURLSessionDownloadTask { + type Super = NSURLSessionTask; + } +); + +extern_methods!( + unsafe impl NSURLSessionDownloadTask { + #[method(cancelByProducingResumeData:)] + pub unsafe fn cancelByProducingResumeData( + &self, + completionHandler: &Block<(*mut NSData,), ()>, + ); + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLSessionStreamTask; + + unsafe impl ClassType for NSURLSessionStreamTask { + type Super = NSURLSessionTask; + } +); + +extern_methods!( + unsafe impl NSURLSessionStreamTask { + #[method(readDataOfMinLength:maxLength:timeout:completionHandler:)] + pub unsafe fn readDataOfMinLength_maxLength_timeout_completionHandler( + &self, + minBytes: NSUInteger, + maxBytes: NSUInteger, + timeout: NSTimeInterval, + completionHandler: &Block<(*mut NSData, Bool, *mut NSError), ()>, + ); + + #[method(writeData:timeout:completionHandler:)] + pub unsafe fn writeData_timeout_completionHandler( + &self, + data: &NSData, + timeout: NSTimeInterval, + completionHandler: &Block<(*mut NSError,), ()>, + ); + + #[method(captureStreams)] + pub unsafe fn captureStreams(&self); + + #[method(closeWrite)] + pub unsafe fn closeWrite(&self); + + #[method(closeRead)] + pub unsafe fn closeRead(&self); + + #[method(startSecureConnection)] + pub unsafe fn startSecureConnection(&self); + + #[method(stopSecureConnection)] + pub unsafe fn stopSecureConnection(&self); + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSURLSessionWebSocketMessageType { + NSURLSessionWebSocketMessageTypeData = 0, + NSURLSessionWebSocketMessageTypeString = 1, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLSessionWebSocketMessage; + + unsafe impl ClassType for NSURLSessionWebSocketMessage { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLSessionWebSocketMessage { + #[method_id(@__retain_semantics Init initWithData:)] + pub unsafe fn initWithData( + this: Option>, + data: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithString:)] + pub unsafe fn initWithString( + this: Option>, + string: &NSString, + ) -> Id; + + #[method(type)] + pub unsafe fn type_(&self) -> NSURLSessionWebSocketMessageType; + + #[method_id(@__retain_semantics Other data)] + pub unsafe fn data(&self) -> Option>; + + #[method_id(@__retain_semantics Other string)] + pub unsafe fn string(&self) -> Option>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSURLSessionWebSocketCloseCode { + NSURLSessionWebSocketCloseCodeInvalid = 0, + NSURLSessionWebSocketCloseCodeNormalClosure = 1000, + NSURLSessionWebSocketCloseCodeGoingAway = 1001, + NSURLSessionWebSocketCloseCodeProtocolError = 1002, + NSURLSessionWebSocketCloseCodeUnsupportedData = 1003, + NSURLSessionWebSocketCloseCodeNoStatusReceived = 1005, + NSURLSessionWebSocketCloseCodeAbnormalClosure = 1006, + NSURLSessionWebSocketCloseCodeInvalidFramePayloadData = 1007, + NSURLSessionWebSocketCloseCodePolicyViolation = 1008, + NSURLSessionWebSocketCloseCodeMessageTooBig = 1009, + NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing = 1010, + NSURLSessionWebSocketCloseCodeInternalServerError = 1011, + NSURLSessionWebSocketCloseCodeTLSHandshakeFailure = 1015, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLSessionWebSocketTask; + + unsafe impl ClassType for NSURLSessionWebSocketTask { + type Super = NSURLSessionTask; + } +); + +extern_methods!( + unsafe impl NSURLSessionWebSocketTask { + #[method(sendMessage:completionHandler:)] + pub unsafe fn sendMessage_completionHandler( + &self, + message: &NSURLSessionWebSocketMessage, + completionHandler: &Block<(*mut NSError,), ()>, + ); + + #[method(receiveMessageWithCompletionHandler:)] + pub unsafe fn receiveMessageWithCompletionHandler( + &self, + completionHandler: &Block<(*mut NSURLSessionWebSocketMessage, *mut NSError), ()>, + ); + + #[method(sendPingWithPongReceiveHandler:)] + pub unsafe fn sendPingWithPongReceiveHandler( + &self, + pongReceiveHandler: &Block<(*mut NSError,), ()>, + ); + + #[method(cancelWithCloseCode:reason:)] + pub unsafe fn cancelWithCloseCode_reason( + &self, + closeCode: NSURLSessionWebSocketCloseCode, + reason: Option<&NSData>, + ); + + #[method(maximumMessageSize)] + pub unsafe fn maximumMessageSize(&self) -> NSInteger; + + #[method(setMaximumMessageSize:)] + pub unsafe fn setMaximumMessageSize(&self, maximumMessageSize: NSInteger); + + #[method(closeCode)] + pub unsafe fn closeCode(&self) -> NSURLSessionWebSocketCloseCode; + + #[method_id(@__retain_semantics Other closeReason)] + pub unsafe fn closeReason(&self) -> Option>; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSURLSessionMultipathServiceType { + NSURLSessionMultipathServiceTypeNone = 0, + NSURLSessionMultipathServiceTypeHandover = 1, + NSURLSessionMultipathServiceTypeInteractive = 2, + NSURLSessionMultipathServiceTypeAggregate = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLSessionConfiguration; + + unsafe impl ClassType for NSURLSessionConfiguration { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLSessionConfiguration { + #[method_id(@__retain_semantics Other defaultSessionConfiguration)] + pub unsafe fn defaultSessionConfiguration() -> Id; + + #[method_id(@__retain_semantics Other ephemeralSessionConfiguration)] + pub unsafe fn ephemeralSessionConfiguration() -> Id; + + #[method_id(@__retain_semantics Other backgroundSessionConfigurationWithIdentifier:)] + pub unsafe fn backgroundSessionConfigurationWithIdentifier( + identifier: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Option>; + + #[method(requestCachePolicy)] + pub unsafe fn requestCachePolicy(&self) -> NSURLRequestCachePolicy; + + #[method(setRequestCachePolicy:)] + pub unsafe fn setRequestCachePolicy(&self, requestCachePolicy: NSURLRequestCachePolicy); + + #[method(timeoutIntervalForRequest)] + pub unsafe fn timeoutIntervalForRequest(&self) -> NSTimeInterval; + + #[method(setTimeoutIntervalForRequest:)] + pub unsafe fn setTimeoutIntervalForRequest( + &self, + timeoutIntervalForRequest: NSTimeInterval, + ); + + #[method(timeoutIntervalForResource)] + pub unsafe fn timeoutIntervalForResource(&self) -> NSTimeInterval; + + #[method(setTimeoutIntervalForResource:)] + pub unsafe fn setTimeoutIntervalForResource( + &self, + timeoutIntervalForResource: NSTimeInterval, + ); + + #[method(networkServiceType)] + pub unsafe fn networkServiceType(&self) -> NSURLRequestNetworkServiceType; + + #[method(setNetworkServiceType:)] + pub unsafe fn setNetworkServiceType( + &self, + networkServiceType: NSURLRequestNetworkServiceType, + ); + + #[method(allowsCellularAccess)] + pub unsafe fn allowsCellularAccess(&self) -> bool; + + #[method(setAllowsCellularAccess:)] + pub unsafe fn setAllowsCellularAccess(&self, allowsCellularAccess: bool); + + #[method(allowsExpensiveNetworkAccess)] + pub unsafe fn allowsExpensiveNetworkAccess(&self) -> bool; + + #[method(setAllowsExpensiveNetworkAccess:)] + pub unsafe fn setAllowsExpensiveNetworkAccess(&self, allowsExpensiveNetworkAccess: bool); + + #[method(allowsConstrainedNetworkAccess)] + pub unsafe fn allowsConstrainedNetworkAccess(&self) -> bool; + + #[method(setAllowsConstrainedNetworkAccess:)] + pub unsafe fn setAllowsConstrainedNetworkAccess( + &self, + allowsConstrainedNetworkAccess: bool, + ); + + #[method(waitsForConnectivity)] + pub unsafe fn waitsForConnectivity(&self) -> bool; + + #[method(setWaitsForConnectivity:)] + pub unsafe fn setWaitsForConnectivity(&self, waitsForConnectivity: bool); + + #[method(isDiscretionary)] + pub unsafe fn isDiscretionary(&self) -> bool; + + #[method(setDiscretionary:)] + pub unsafe fn setDiscretionary(&self, discretionary: bool); + + #[method_id(@__retain_semantics Other sharedContainerIdentifier)] + pub unsafe fn sharedContainerIdentifier(&self) -> Option>; + + #[method(setSharedContainerIdentifier:)] + pub unsafe fn setSharedContainerIdentifier( + &self, + sharedContainerIdentifier: Option<&NSString>, + ); + + #[method(sessionSendsLaunchEvents)] + pub unsafe fn sessionSendsLaunchEvents(&self) -> bool; + + #[method(setSessionSendsLaunchEvents:)] + pub unsafe fn setSessionSendsLaunchEvents(&self, sessionSendsLaunchEvents: bool); + + #[method_id(@__retain_semantics Other connectionProxyDictionary)] + pub unsafe fn connectionProxyDictionary(&self) -> Option>; + + #[method(setConnectionProxyDictionary:)] + pub unsafe fn setConnectionProxyDictionary( + &self, + connectionProxyDictionary: Option<&NSDictionary>, + ); + + #[method(HTTPShouldUsePipelining)] + pub unsafe fn HTTPShouldUsePipelining(&self) -> bool; + + #[method(setHTTPShouldUsePipelining:)] + pub unsafe fn setHTTPShouldUsePipelining(&self, HTTPShouldUsePipelining: bool); + + #[method(HTTPShouldSetCookies)] + pub unsafe fn HTTPShouldSetCookies(&self) -> bool; + + #[method(setHTTPShouldSetCookies:)] + pub unsafe fn setHTTPShouldSetCookies(&self, HTTPShouldSetCookies: bool); + + #[method(HTTPCookieAcceptPolicy)] + pub unsafe fn HTTPCookieAcceptPolicy(&self) -> NSHTTPCookieAcceptPolicy; + + #[method(setHTTPCookieAcceptPolicy:)] + pub unsafe fn setHTTPCookieAcceptPolicy( + &self, + HTTPCookieAcceptPolicy: NSHTTPCookieAcceptPolicy, + ); + + #[method_id(@__retain_semantics Other HTTPAdditionalHeaders)] + pub unsafe fn HTTPAdditionalHeaders(&self) -> Option>; + + #[method(setHTTPAdditionalHeaders:)] + pub unsafe fn setHTTPAdditionalHeaders(&self, HTTPAdditionalHeaders: Option<&NSDictionary>); + + #[method(HTTPMaximumConnectionsPerHost)] + pub unsafe fn HTTPMaximumConnectionsPerHost(&self) -> NSInteger; + + #[method(setHTTPMaximumConnectionsPerHost:)] + pub unsafe fn setHTTPMaximumConnectionsPerHost( + &self, + HTTPMaximumConnectionsPerHost: NSInteger, + ); + + #[method_id(@__retain_semantics Other HTTPCookieStorage)] + pub unsafe fn HTTPCookieStorage(&self) -> Option>; + + #[method(setHTTPCookieStorage:)] + pub unsafe fn setHTTPCookieStorage(&self, HTTPCookieStorage: Option<&NSHTTPCookieStorage>); + + #[method_id(@__retain_semantics Other URLCredentialStorage)] + pub unsafe fn URLCredentialStorage(&self) -> Option>; + + #[method(setURLCredentialStorage:)] + pub unsafe fn setURLCredentialStorage( + &self, + URLCredentialStorage: Option<&NSURLCredentialStorage>, + ); + + #[method_id(@__retain_semantics Other URLCache)] + pub unsafe fn URLCache(&self) -> Option>; + + #[method(setURLCache:)] + pub unsafe fn setURLCache(&self, URLCache: Option<&NSURLCache>); + + #[method(shouldUseExtendedBackgroundIdleMode)] + pub unsafe fn shouldUseExtendedBackgroundIdleMode(&self) -> bool; + + #[method(setShouldUseExtendedBackgroundIdleMode:)] + pub unsafe fn setShouldUseExtendedBackgroundIdleMode( + &self, + shouldUseExtendedBackgroundIdleMode: bool, + ); + + #[method_id(@__retain_semantics Other protocolClasses)] + pub unsafe fn protocolClasses(&self) -> Option, Shared>>; + + #[method(setProtocolClasses:)] + pub unsafe fn setProtocolClasses(&self, protocolClasses: Option<&NSArray>); + + #[method(multipathServiceType)] + pub unsafe fn multipathServiceType(&self) -> NSURLSessionMultipathServiceType; + + #[method(setMultipathServiceType:)] + pub unsafe fn setMultipathServiceType( + &self, + multipathServiceType: NSURLSessionMultipathServiceType, + ); + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSURLSessionDelayedRequestDisposition { + NSURLSessionDelayedRequestContinueLoading = 0, + NSURLSessionDelayedRequestUseNewRequest = 1, + NSURLSessionDelayedRequestCancel = 2, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSURLSessionAuthChallengeDisposition { + NSURLSessionAuthChallengeUseCredential = 0, + NSURLSessionAuthChallengePerformDefaultHandling = 1, + NSURLSessionAuthChallengeCancelAuthenticationChallenge = 2, + NSURLSessionAuthChallengeRejectProtectionSpace = 3, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSURLSessionResponseDisposition { + NSURLSessionResponseCancel = 0, + NSURLSessionResponseAllow = 1, + NSURLSessionResponseBecomeDownload = 2, + NSURLSessionResponseBecomeStream = 3, + } +); + +extern_protocol!( + pub struct NSURLSessionDelegate; + + unsafe impl NSURLSessionDelegate { + #[optional] + #[method(URLSession:didBecomeInvalidWithError:)] + pub unsafe fn URLSession_didBecomeInvalidWithError( + &self, + session: &NSURLSession, + error: Option<&NSError>, + ); + + #[optional] + #[method(URLSession:didReceiveChallenge:completionHandler:)] + pub unsafe fn URLSession_didReceiveChallenge_completionHandler( + &self, + session: &NSURLSession, + challenge: &NSURLAuthenticationChallenge, + completionHandler: &Block< + (NSURLSessionAuthChallengeDisposition, *mut NSURLCredential), + (), + >, + ); + + #[optional] + #[method(URLSessionDidFinishEventsForBackgroundURLSession:)] + pub unsafe fn URLSessionDidFinishEventsForBackgroundURLSession( + &self, + session: &NSURLSession, + ); + } +); + +extern_protocol!( + pub struct NSURLSessionTaskDelegate; + + unsafe impl NSURLSessionTaskDelegate { + #[optional] + #[method(URLSession:task:willBeginDelayedRequest:completionHandler:)] + pub unsafe fn URLSession_task_willBeginDelayedRequest_completionHandler( + &self, + session: &NSURLSession, + task: &NSURLSessionTask, + request: &NSURLRequest, + completionHandler: &Block< + (NSURLSessionDelayedRequestDisposition, *mut NSURLRequest), + (), + >, + ); + + #[optional] + #[method(URLSession:taskIsWaitingForConnectivity:)] + pub unsafe fn URLSession_taskIsWaitingForConnectivity( + &self, + session: &NSURLSession, + task: &NSURLSessionTask, + ); + + #[optional] + #[method(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:)] + pub unsafe fn URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler( + &self, + session: &NSURLSession, + task: &NSURLSessionTask, + response: &NSHTTPURLResponse, + request: &NSURLRequest, + completionHandler: &Block<(*mut NSURLRequest,), ()>, + ); + + #[optional] + #[method(URLSession:task:didReceiveChallenge:completionHandler:)] + pub unsafe fn URLSession_task_didReceiveChallenge_completionHandler( + &self, + session: &NSURLSession, + task: &NSURLSessionTask, + challenge: &NSURLAuthenticationChallenge, + completionHandler: &Block< + (NSURLSessionAuthChallengeDisposition, *mut NSURLCredential), + (), + >, + ); + + #[optional] + #[method(URLSession:task:needNewBodyStream:)] + pub unsafe fn URLSession_task_needNewBodyStream( + &self, + session: &NSURLSession, + task: &NSURLSessionTask, + completionHandler: &Block<(*mut NSInputStream,), ()>, + ); + + #[optional] + #[method(URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)] + pub unsafe fn URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend( + &self, + session: &NSURLSession, + task: &NSURLSessionTask, + bytesSent: i64, + totalBytesSent: i64, + totalBytesExpectedToSend: i64, + ); + + #[optional] + #[method(URLSession:task:didFinishCollectingMetrics:)] + pub unsafe fn URLSession_task_didFinishCollectingMetrics( + &self, + session: &NSURLSession, + task: &NSURLSessionTask, + metrics: &NSURLSessionTaskMetrics, + ); + + #[optional] + #[method(URLSession:task:didCompleteWithError:)] + pub unsafe fn URLSession_task_didCompleteWithError( + &self, + session: &NSURLSession, + task: &NSURLSessionTask, + error: Option<&NSError>, + ); + } +); + +extern_protocol!( + pub struct NSURLSessionDataDelegate; + + unsafe impl NSURLSessionDataDelegate { + #[optional] + #[method(URLSession:dataTask:didReceiveResponse:completionHandler:)] + pub unsafe fn URLSession_dataTask_didReceiveResponse_completionHandler( + &self, + session: &NSURLSession, + dataTask: &NSURLSessionDataTask, + response: &NSURLResponse, + completionHandler: &Block<(NSURLSessionResponseDisposition,), ()>, + ); + + #[optional] + #[method(URLSession:dataTask:didBecomeDownloadTask:)] + pub unsafe fn URLSession_dataTask_didBecomeDownloadTask( + &self, + session: &NSURLSession, + dataTask: &NSURLSessionDataTask, + downloadTask: &NSURLSessionDownloadTask, + ); + + #[optional] + #[method(URLSession:dataTask:didBecomeStreamTask:)] + pub unsafe fn URLSession_dataTask_didBecomeStreamTask( + &self, + session: &NSURLSession, + dataTask: &NSURLSessionDataTask, + streamTask: &NSURLSessionStreamTask, + ); + + #[optional] + #[method(URLSession:dataTask:didReceiveData:)] + pub unsafe fn URLSession_dataTask_didReceiveData( + &self, + session: &NSURLSession, + dataTask: &NSURLSessionDataTask, + data: &NSData, + ); + + #[optional] + #[method(URLSession:dataTask:willCacheResponse:completionHandler:)] + pub unsafe fn URLSession_dataTask_willCacheResponse_completionHandler( + &self, + session: &NSURLSession, + dataTask: &NSURLSessionDataTask, + proposedResponse: &NSCachedURLResponse, + completionHandler: &Block<(*mut NSCachedURLResponse,), ()>, + ); + } +); + +extern_protocol!( + pub struct NSURLSessionDownloadDelegate; + + unsafe impl NSURLSessionDownloadDelegate { + #[method(URLSession:downloadTask:didFinishDownloadingToURL:)] + pub unsafe fn URLSession_downloadTask_didFinishDownloadingToURL( + &self, + session: &NSURLSession, + downloadTask: &NSURLSessionDownloadTask, + location: &NSURL, + ); + + #[optional] + #[method(URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)] + pub unsafe fn URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite( + &self, + session: &NSURLSession, + downloadTask: &NSURLSessionDownloadTask, + bytesWritten: i64, + totalBytesWritten: i64, + totalBytesExpectedToWrite: i64, + ); + + #[optional] + #[method(URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:)] + pub unsafe fn URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes( + &self, + session: &NSURLSession, + downloadTask: &NSURLSessionDownloadTask, + fileOffset: i64, + expectedTotalBytes: i64, + ); + } +); + +extern_protocol!( + pub struct NSURLSessionStreamDelegate; + + unsafe impl NSURLSessionStreamDelegate { + #[optional] + #[method(URLSession:readClosedForStreamTask:)] + pub unsafe fn URLSession_readClosedForStreamTask( + &self, + session: &NSURLSession, + streamTask: &NSURLSessionStreamTask, + ); + + #[optional] + #[method(URLSession:writeClosedForStreamTask:)] + pub unsafe fn URLSession_writeClosedForStreamTask( + &self, + session: &NSURLSession, + streamTask: &NSURLSessionStreamTask, + ); + + #[optional] + #[method(URLSession:betterRouteDiscoveredForStreamTask:)] + pub unsafe fn URLSession_betterRouteDiscoveredForStreamTask( + &self, + session: &NSURLSession, + streamTask: &NSURLSessionStreamTask, + ); + + #[optional] + #[method(URLSession:streamTask:didBecomeInputStream:outputStream:)] + pub unsafe fn URLSession_streamTask_didBecomeInputStream_outputStream( + &self, + session: &NSURLSession, + streamTask: &NSURLSessionStreamTask, + inputStream: &NSInputStream, + outputStream: &NSOutputStream, + ); + } +); + +extern_protocol!( + pub struct NSURLSessionWebSocketDelegate; + + unsafe impl NSURLSessionWebSocketDelegate { + #[optional] + #[method(URLSession:webSocketTask:didOpenWithProtocol:)] + pub unsafe fn URLSession_webSocketTask_didOpenWithProtocol( + &self, + session: &NSURLSession, + webSocketTask: &NSURLSessionWebSocketTask, + protocol: Option<&NSString>, + ); + + #[optional] + #[method(URLSession:webSocketTask:didCloseWithCode:reason:)] + pub unsafe fn URLSession_webSocketTask_didCloseWithCode_reason( + &self, + session: &NSURLSession, + webSocketTask: &NSURLSessionWebSocketTask, + closeCode: NSURLSessionWebSocketCloseCode, + reason: Option<&NSData>, + ); + } +); + +extern_static!(NSURLSessionDownloadTaskResumeData: &'static NSString); + +extern_methods!( + /// NSURLSessionDeprecated + unsafe impl NSURLSessionConfiguration { + #[method_id(@__retain_semantics Other backgroundSessionConfiguration:)] + pub unsafe fn backgroundSessionConfiguration( + identifier: &NSString, + ) -> Id; + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSURLSessionTaskMetricsResourceFetchType { + NSURLSessionTaskMetricsResourceFetchTypeUnknown = 0, + NSURLSessionTaskMetricsResourceFetchTypeNetworkLoad = 1, + NSURLSessionTaskMetricsResourceFetchTypeServerPush = 2, + NSURLSessionTaskMetricsResourceFetchTypeLocalCache = 3, + } +); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSURLSessionTaskMetricsDomainResolutionProtocol { + NSURLSessionTaskMetricsDomainResolutionProtocolUnknown = 0, + NSURLSessionTaskMetricsDomainResolutionProtocolUDP = 1, + NSURLSessionTaskMetricsDomainResolutionProtocolTCP = 2, + NSURLSessionTaskMetricsDomainResolutionProtocolTLS = 3, + NSURLSessionTaskMetricsDomainResolutionProtocolHTTPS = 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLSessionTaskTransactionMetrics; + + unsafe impl ClassType for NSURLSessionTaskTransactionMetrics { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLSessionTaskTransactionMetrics { + #[method_id(@__retain_semantics Other request)] + pub unsafe fn request(&self) -> Id; + + #[method_id(@__retain_semantics Other response)] + pub unsafe fn response(&self) -> Option>; + + #[method_id(@__retain_semantics Other fetchStartDate)] + pub unsafe fn fetchStartDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other domainLookupStartDate)] + pub unsafe fn domainLookupStartDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other domainLookupEndDate)] + pub unsafe fn domainLookupEndDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other connectStartDate)] + pub unsafe fn connectStartDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other secureConnectionStartDate)] + pub unsafe fn secureConnectionStartDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other secureConnectionEndDate)] + pub unsafe fn secureConnectionEndDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other connectEndDate)] + pub unsafe fn connectEndDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other requestStartDate)] + pub unsafe fn requestStartDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other requestEndDate)] + pub unsafe fn requestEndDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other responseStartDate)] + pub unsafe fn responseStartDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other responseEndDate)] + pub unsafe fn responseEndDate(&self) -> Option>; + + #[method_id(@__retain_semantics Other networkProtocolName)] + pub unsafe fn networkProtocolName(&self) -> Option>; + + #[method(isProxyConnection)] + pub unsafe fn isProxyConnection(&self) -> bool; + + #[method(isReusedConnection)] + pub unsafe fn isReusedConnection(&self) -> bool; + + #[method(resourceFetchType)] + pub unsafe fn resourceFetchType(&self) -> NSURLSessionTaskMetricsResourceFetchType; + + #[method(countOfRequestHeaderBytesSent)] + pub unsafe fn countOfRequestHeaderBytesSent(&self) -> i64; + + #[method(countOfRequestBodyBytesSent)] + pub unsafe fn countOfRequestBodyBytesSent(&self) -> i64; + + #[method(countOfRequestBodyBytesBeforeEncoding)] + pub unsafe fn countOfRequestBodyBytesBeforeEncoding(&self) -> i64; + + #[method(countOfResponseHeaderBytesReceived)] + pub unsafe fn countOfResponseHeaderBytesReceived(&self) -> i64; + + #[method(countOfResponseBodyBytesReceived)] + pub unsafe fn countOfResponseBodyBytesReceived(&self) -> i64; + + #[method(countOfResponseBodyBytesAfterDecoding)] + pub unsafe fn countOfResponseBodyBytesAfterDecoding(&self) -> i64; + + #[method_id(@__retain_semantics Other localAddress)] + pub unsafe fn localAddress(&self) -> Option>; + + #[method_id(@__retain_semantics Other localPort)] + pub unsafe fn localPort(&self) -> Option>; + + #[method_id(@__retain_semantics Other remoteAddress)] + pub unsafe fn remoteAddress(&self) -> Option>; + + #[method_id(@__retain_semantics Other remotePort)] + pub unsafe fn remotePort(&self) -> Option>; + + #[method_id(@__retain_semantics Other negotiatedTLSProtocolVersion)] + pub unsafe fn negotiatedTLSProtocolVersion(&self) -> Option>; + + #[method_id(@__retain_semantics Other negotiatedTLSCipherSuite)] + pub unsafe fn negotiatedTLSCipherSuite(&self) -> Option>; + + #[method(isCellular)] + pub unsafe fn isCellular(&self) -> bool; + + #[method(isExpensive)] + pub unsafe fn isExpensive(&self) -> bool; + + #[method(isConstrained)] + pub unsafe fn isConstrained(&self) -> bool; + + #[method(isMultipath)] + pub unsafe fn isMultipath(&self) -> bool; + + #[method(domainResolutionProtocol)] + pub unsafe fn domainResolutionProtocol( + &self, + ) -> NSURLSessionTaskMetricsDomainResolutionProtocol; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSURLSessionTaskMetrics; + + unsafe impl ClassType for NSURLSessionTaskMetrics { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSURLSessionTaskMetrics { + #[method_id(@__retain_semantics Other transactionMetrics)] + pub unsafe fn transactionMetrics( + &self, + ) -> Id, Shared>; + + #[method_id(@__retain_semantics Other taskInterval)] + pub unsafe fn taskInterval(&self) -> Id; + + #[method(redirectCount)] + pub unsafe fn redirectCount(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSUUID.rs b/crates/icrate/src/generated/Foundation/NSUUID.rs new file mode 100644 index 000000000..7212e8fec --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSUUID.rs @@ -0,0 +1,35 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSUUID; + + unsafe impl ClassType for NSUUID { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSUUID { + #[method_id(@__retain_semantics Other UUID)] + pub unsafe fn UUID() -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithUUIDString:)] + pub unsafe fn initWithUUIDString( + this: Option>, + string: &NSString, + ) -> Option>; + + #[method(compare:)] + pub unsafe fn compare(&self, otherUUID: &NSUUID) -> NSComparisonResult; + + #[method_id(@__retain_semantics Other UUIDString)] + pub unsafe fn UUIDString(&self) -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSUbiquitousKeyValueStore.rs b/crates/icrate/src/generated/Foundation/NSUbiquitousKeyValueStore.rs new file mode 100644 index 000000000..bb33c024b --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSUbiquitousKeyValueStore.rs @@ -0,0 +1,103 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSUbiquitousKeyValueStore; + + unsafe impl ClassType for NSUbiquitousKeyValueStore { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSUbiquitousKeyValueStore { + #[method_id(@__retain_semantics Other defaultStore)] + pub unsafe fn defaultStore() -> Id; + + #[method_id(@__retain_semantics Other objectForKey:)] + pub unsafe fn objectForKey(&self, aKey: &NSString) -> Option>; + + #[method(setObject:forKey:)] + pub unsafe fn setObject_forKey(&self, anObject: Option<&Object>, aKey: &NSString); + + #[method(removeObjectForKey:)] + pub unsafe fn removeObjectForKey(&self, aKey: &NSString); + + #[method_id(@__retain_semantics Other stringForKey:)] + pub unsafe fn stringForKey(&self, aKey: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other arrayForKey:)] + pub unsafe fn arrayForKey(&self, aKey: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other dictionaryForKey:)] + pub unsafe fn dictionaryForKey( + &self, + aKey: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other dataForKey:)] + pub unsafe fn dataForKey(&self, aKey: &NSString) -> Option>; + + #[method(longLongForKey:)] + pub unsafe fn longLongForKey(&self, aKey: &NSString) -> c_longlong; + + #[method(doubleForKey:)] + pub unsafe fn doubleForKey(&self, aKey: &NSString) -> c_double; + + #[method(boolForKey:)] + pub unsafe fn boolForKey(&self, aKey: &NSString) -> bool; + + #[method(setString:forKey:)] + pub unsafe fn setString_forKey(&self, aString: Option<&NSString>, aKey: &NSString); + + #[method(setData:forKey:)] + pub unsafe fn setData_forKey(&self, aData: Option<&NSData>, aKey: &NSString); + + #[method(setArray:forKey:)] + pub unsafe fn setArray_forKey(&self, anArray: Option<&NSArray>, aKey: &NSString); + + #[method(setDictionary:forKey:)] + pub unsafe fn setDictionary_forKey( + &self, + aDictionary: Option<&NSDictionary>, + aKey: &NSString, + ); + + #[method(setLongLong:forKey:)] + pub unsafe fn setLongLong_forKey(&self, value: c_longlong, aKey: &NSString); + + #[method(setDouble:forKey:)] + pub unsafe fn setDouble_forKey(&self, value: c_double, aKey: &NSString); + + #[method(setBool:forKey:)] + pub unsafe fn setBool_forKey(&self, value: bool, aKey: &NSString); + + #[method_id(@__retain_semantics Other dictionaryRepresentation)] + pub unsafe fn dictionaryRepresentation(&self) + -> Id, Shared>; + + #[method(synchronize)] + pub unsafe fn synchronize(&self) -> bool; + } +); + +extern_static!( + NSUbiquitousKeyValueStoreDidChangeExternallyNotification: &'static NSNotificationName +); + +extern_static!(NSUbiquitousKeyValueStoreChangeReasonKey: &'static NSString); + +extern_static!(NSUbiquitousKeyValueStoreChangedKeysKey: &'static NSString); + +ns_enum!( + #[underlying(NSInteger)] + pub enum { + NSUbiquitousKeyValueStoreServerChange = 0, + NSUbiquitousKeyValueStoreInitialSyncChange = 1, + NSUbiquitousKeyValueStoreQuotaViolationChange = 2, + NSUbiquitousKeyValueStoreAccountChange = 3, + } +); diff --git a/crates/icrate/src/generated/Foundation/NSUndoManager.rs b/crates/icrate/src/generated/Foundation/NSUndoManager.rs new file mode 100644 index 000000000..02ea1c6d7 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSUndoManager.rs @@ -0,0 +1,154 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSUndoCloseGroupingRunLoopOrdering: NSUInteger = 350000); + +extern_static!(NSUndoManagerGroupIsDiscardableKey: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSUndoManager; + + unsafe impl ClassType for NSUndoManager { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSUndoManager { + #[method(beginUndoGrouping)] + pub unsafe fn beginUndoGrouping(&self); + + #[method(endUndoGrouping)] + pub unsafe fn endUndoGrouping(&self); + + #[method(groupingLevel)] + pub unsafe fn groupingLevel(&self) -> NSInteger; + + #[method(disableUndoRegistration)] + pub unsafe fn disableUndoRegistration(&self); + + #[method(enableUndoRegistration)] + pub unsafe fn enableUndoRegistration(&self); + + #[method(isUndoRegistrationEnabled)] + pub unsafe fn isUndoRegistrationEnabled(&self) -> bool; + + #[method(groupsByEvent)] + pub unsafe fn groupsByEvent(&self) -> bool; + + #[method(setGroupsByEvent:)] + pub unsafe fn setGroupsByEvent(&self, groupsByEvent: bool); + + #[method(levelsOfUndo)] + pub unsafe fn levelsOfUndo(&self) -> NSUInteger; + + #[method(setLevelsOfUndo:)] + pub unsafe fn setLevelsOfUndo(&self, levelsOfUndo: NSUInteger); + + #[method_id(@__retain_semantics Other runLoopModes)] + pub unsafe fn runLoopModes(&self) -> Id, Shared>; + + #[method(setRunLoopModes:)] + pub unsafe fn setRunLoopModes(&self, runLoopModes: &NSArray); + + #[method(undo)] + pub unsafe fn undo(&self); + + #[method(redo)] + pub unsafe fn redo(&self); + + #[method(undoNestedGroup)] + pub unsafe fn undoNestedGroup(&self); + + #[method(canUndo)] + pub unsafe fn canUndo(&self) -> bool; + + #[method(canRedo)] + pub unsafe fn canRedo(&self) -> bool; + + #[method(isUndoing)] + pub unsafe fn isUndoing(&self) -> bool; + + #[method(isRedoing)] + pub unsafe fn isRedoing(&self) -> bool; + + #[method(removeAllActions)] + pub unsafe fn removeAllActions(&self); + + #[method(removeAllActionsWithTarget:)] + pub unsafe fn removeAllActionsWithTarget(&self, target: &Object); + + #[method(registerUndoWithTarget:selector:object:)] + pub unsafe fn registerUndoWithTarget_selector_object( + &self, + target: &Object, + selector: Sel, + anObject: Option<&Object>, + ); + + #[method_id(@__retain_semantics Other prepareWithInvocationTarget:)] + pub unsafe fn prepareWithInvocationTarget(&self, target: &Object) -> Id; + + #[method(registerUndoWithTarget:handler:)] + pub unsafe fn registerUndoWithTarget_handler( + &self, + target: &Object, + undoHandler: &Block<(NonNull,), ()>, + ); + + #[method(setActionIsDiscardable:)] + pub unsafe fn setActionIsDiscardable(&self, discardable: bool); + + #[method(undoActionIsDiscardable)] + pub unsafe fn undoActionIsDiscardable(&self) -> bool; + + #[method(redoActionIsDiscardable)] + pub unsafe fn redoActionIsDiscardable(&self) -> bool; + + #[method_id(@__retain_semantics Other undoActionName)] + pub unsafe fn undoActionName(&self) -> Id; + + #[method_id(@__retain_semantics Other redoActionName)] + pub unsafe fn redoActionName(&self) -> Id; + + #[method(setActionName:)] + pub unsafe fn setActionName(&self, actionName: &NSString); + + #[method_id(@__retain_semantics Other undoMenuItemTitle)] + pub unsafe fn undoMenuItemTitle(&self) -> Id; + + #[method_id(@__retain_semantics Other redoMenuItemTitle)] + pub unsafe fn redoMenuItemTitle(&self) -> Id; + + #[method_id(@__retain_semantics Other undoMenuTitleForUndoActionName:)] + pub unsafe fn undoMenuTitleForUndoActionName( + &self, + actionName: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other redoMenuTitleForUndoActionName:)] + pub unsafe fn redoMenuTitleForUndoActionName( + &self, + actionName: &NSString, + ) -> Id; + } +); + +extern_static!(NSUndoManagerCheckpointNotification: &'static NSNotificationName); + +extern_static!(NSUndoManagerWillUndoChangeNotification: &'static NSNotificationName); + +extern_static!(NSUndoManagerWillRedoChangeNotification: &'static NSNotificationName); + +extern_static!(NSUndoManagerDidUndoChangeNotification: &'static NSNotificationName); + +extern_static!(NSUndoManagerDidRedoChangeNotification: &'static NSNotificationName); + +extern_static!(NSUndoManagerDidOpenUndoGroupNotification: &'static NSNotificationName); + +extern_static!(NSUndoManagerWillCloseUndoGroupNotification: &'static NSNotificationName); + +extern_static!(NSUndoManagerDidCloseUndoGroupNotification: &'static NSNotificationName); diff --git a/crates/icrate/src/generated/Foundation/NSUnit.rs b/crates/icrate/src/generated/Foundation/NSUnit.rs new file mode 100644 index 000000000..67bce1a1f --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSUnit.rs @@ -0,0 +1,1009 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSUnitConverter; + + unsafe impl ClassType for NSUnitConverter { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSUnitConverter { + #[method(baseUnitValueFromValue:)] + pub unsafe fn baseUnitValueFromValue(&self, value: c_double) -> c_double; + + #[method(valueFromBaseUnitValue:)] + pub unsafe fn valueFromBaseUnitValue(&self, baseUnitValue: c_double) -> c_double; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitConverterLinear; + + unsafe impl ClassType for NSUnitConverterLinear { + type Super = NSUnitConverter; + } +); + +extern_methods!( + unsafe impl NSUnitConverterLinear { + #[method(coefficient)] + pub unsafe fn coefficient(&self) -> c_double; + + #[method(constant)] + pub unsafe fn constant(&self) -> c_double; + + #[method_id(@__retain_semantics Init initWithCoefficient:)] + pub unsafe fn initWithCoefficient( + this: Option>, + coefficient: c_double, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoefficient:constant:)] + pub unsafe fn initWithCoefficient_constant( + this: Option>, + coefficient: c_double, + constant: c_double, + ) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnit; + + unsafe impl ClassType for NSUnit { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSUnit { + #[method_id(@__retain_semantics Other symbol)] + pub unsafe fn symbol(&self) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics New new)] + pub unsafe fn new() -> Id; + + #[method_id(@__retain_semantics Init initWithSymbol:)] + pub unsafe fn initWithSymbol( + this: Option>, + symbol: &NSString, + ) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSDimension; + + unsafe impl ClassType for NSDimension { + type Super = NSUnit; + } +); + +extern_methods!( + unsafe impl NSDimension { + #[method_id(@__retain_semantics Other converter)] + pub unsafe fn converter(&self) -> Id; + + #[method_id(@__retain_semantics Init initWithSymbol:converter:)] + pub unsafe fn initWithSymbol_converter( + this: Option>, + symbol: &NSString, + converter: &NSUnitConverter, + ) -> Id; + + #[method_id(@__retain_semantics Other baseUnit)] + pub unsafe fn baseUnit() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitAcceleration; + + unsafe impl ClassType for NSUnitAcceleration { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitAcceleration { + #[method_id(@__retain_semantics Other metersPerSecondSquared)] + pub unsafe fn metersPerSecondSquared() -> Id; + + #[method_id(@__retain_semantics Other gravity)] + pub unsafe fn gravity() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitAngle; + + unsafe impl ClassType for NSUnitAngle { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitAngle { + #[method_id(@__retain_semantics Other degrees)] + pub unsafe fn degrees() -> Id; + + #[method_id(@__retain_semantics Other arcMinutes)] + pub unsafe fn arcMinutes() -> Id; + + #[method_id(@__retain_semantics Other arcSeconds)] + pub unsafe fn arcSeconds() -> Id; + + #[method_id(@__retain_semantics Other radians)] + pub unsafe fn radians() -> Id; + + #[method_id(@__retain_semantics Other gradians)] + pub unsafe fn gradians() -> Id; + + #[method_id(@__retain_semantics Other revolutions)] + pub unsafe fn revolutions() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitArea; + + unsafe impl ClassType for NSUnitArea { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitArea { + #[method_id(@__retain_semantics Other squareMegameters)] + pub unsafe fn squareMegameters() -> Id; + + #[method_id(@__retain_semantics Other squareKilometers)] + pub unsafe fn squareKilometers() -> Id; + + #[method_id(@__retain_semantics Other squareMeters)] + pub unsafe fn squareMeters() -> Id; + + #[method_id(@__retain_semantics Other squareCentimeters)] + pub unsafe fn squareCentimeters() -> Id; + + #[method_id(@__retain_semantics Other squareMillimeters)] + pub unsafe fn squareMillimeters() -> Id; + + #[method_id(@__retain_semantics Other squareMicrometers)] + pub unsafe fn squareMicrometers() -> Id; + + #[method_id(@__retain_semantics Other squareNanometers)] + pub unsafe fn squareNanometers() -> Id; + + #[method_id(@__retain_semantics Other squareInches)] + pub unsafe fn squareInches() -> Id; + + #[method_id(@__retain_semantics Other squareFeet)] + pub unsafe fn squareFeet() -> Id; + + #[method_id(@__retain_semantics Other squareYards)] + pub unsafe fn squareYards() -> Id; + + #[method_id(@__retain_semantics Other squareMiles)] + pub unsafe fn squareMiles() -> Id; + + #[method_id(@__retain_semantics Other acres)] + pub unsafe fn acres() -> Id; + + #[method_id(@__retain_semantics Other ares)] + pub unsafe fn ares() -> Id; + + #[method_id(@__retain_semantics Other hectares)] + pub unsafe fn hectares() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitConcentrationMass; + + unsafe impl ClassType for NSUnitConcentrationMass { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitConcentrationMass { + #[method_id(@__retain_semantics Other gramsPerLiter)] + pub unsafe fn gramsPerLiter() -> Id; + + #[method_id(@__retain_semantics Other milligramsPerDeciliter)] + pub unsafe fn milligramsPerDeciliter() -> Id; + + #[method_id(@__retain_semantics Other millimolesPerLiterWithGramsPerMole:)] + pub unsafe fn millimolesPerLiterWithGramsPerMole( + gramsPerMole: c_double, + ) -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitDispersion; + + unsafe impl ClassType for NSUnitDispersion { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitDispersion { + #[method_id(@__retain_semantics Other partsPerMillion)] + pub unsafe fn partsPerMillion() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitDuration; + + unsafe impl ClassType for NSUnitDuration { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitDuration { + #[method_id(@__retain_semantics Other hours)] + pub unsafe fn hours() -> Id; + + #[method_id(@__retain_semantics Other minutes)] + pub unsafe fn minutes() -> Id; + + #[method_id(@__retain_semantics Other seconds)] + pub unsafe fn seconds() -> Id; + + #[method_id(@__retain_semantics Other milliseconds)] + pub unsafe fn milliseconds() -> Id; + + #[method_id(@__retain_semantics Other microseconds)] + pub unsafe fn microseconds() -> Id; + + #[method_id(@__retain_semantics Other nanoseconds)] + pub unsafe fn nanoseconds() -> Id; + + #[method_id(@__retain_semantics Other picoseconds)] + pub unsafe fn picoseconds() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitElectricCharge; + + unsafe impl ClassType for NSUnitElectricCharge { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitElectricCharge { + #[method_id(@__retain_semantics Other coulombs)] + pub unsafe fn coulombs() -> Id; + + #[method_id(@__retain_semantics Other megaampereHours)] + pub unsafe fn megaampereHours() -> Id; + + #[method_id(@__retain_semantics Other kiloampereHours)] + pub unsafe fn kiloampereHours() -> Id; + + #[method_id(@__retain_semantics Other ampereHours)] + pub unsafe fn ampereHours() -> Id; + + #[method_id(@__retain_semantics Other milliampereHours)] + pub unsafe fn milliampereHours() -> Id; + + #[method_id(@__retain_semantics Other microampereHours)] + pub unsafe fn microampereHours() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitElectricCurrent; + + unsafe impl ClassType for NSUnitElectricCurrent { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitElectricCurrent { + #[method_id(@__retain_semantics Other megaamperes)] + pub unsafe fn megaamperes() -> Id; + + #[method_id(@__retain_semantics Other kiloamperes)] + pub unsafe fn kiloamperes() -> Id; + + #[method_id(@__retain_semantics Other amperes)] + pub unsafe fn amperes() -> Id; + + #[method_id(@__retain_semantics Other milliamperes)] + pub unsafe fn milliamperes() -> Id; + + #[method_id(@__retain_semantics Other microamperes)] + pub unsafe fn microamperes() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitElectricPotentialDifference; + + unsafe impl ClassType for NSUnitElectricPotentialDifference { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitElectricPotentialDifference { + #[method_id(@__retain_semantics Other megavolts)] + pub unsafe fn megavolts() -> Id; + + #[method_id(@__retain_semantics Other kilovolts)] + pub unsafe fn kilovolts() -> Id; + + #[method_id(@__retain_semantics Other volts)] + pub unsafe fn volts() -> Id; + + #[method_id(@__retain_semantics Other millivolts)] + pub unsafe fn millivolts() -> Id; + + #[method_id(@__retain_semantics Other microvolts)] + pub unsafe fn microvolts() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitElectricResistance; + + unsafe impl ClassType for NSUnitElectricResistance { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitElectricResistance { + #[method_id(@__retain_semantics Other megaohms)] + pub unsafe fn megaohms() -> Id; + + #[method_id(@__retain_semantics Other kiloohms)] + pub unsafe fn kiloohms() -> Id; + + #[method_id(@__retain_semantics Other ohms)] + pub unsafe fn ohms() -> Id; + + #[method_id(@__retain_semantics Other milliohms)] + pub unsafe fn milliohms() -> Id; + + #[method_id(@__retain_semantics Other microohms)] + pub unsafe fn microohms() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitEnergy; + + unsafe impl ClassType for NSUnitEnergy { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitEnergy { + #[method_id(@__retain_semantics Other kilojoules)] + pub unsafe fn kilojoules() -> Id; + + #[method_id(@__retain_semantics Other joules)] + pub unsafe fn joules() -> Id; + + #[method_id(@__retain_semantics Other kilocalories)] + pub unsafe fn kilocalories() -> Id; + + #[method_id(@__retain_semantics Other calories)] + pub unsafe fn calories() -> Id; + + #[method_id(@__retain_semantics Other kilowattHours)] + pub unsafe fn kilowattHours() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitFrequency; + + unsafe impl ClassType for NSUnitFrequency { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitFrequency { + #[method_id(@__retain_semantics Other terahertz)] + pub unsafe fn terahertz() -> Id; + + #[method_id(@__retain_semantics Other gigahertz)] + pub unsafe fn gigahertz() -> Id; + + #[method_id(@__retain_semantics Other megahertz)] + pub unsafe fn megahertz() -> Id; + + #[method_id(@__retain_semantics Other kilohertz)] + pub unsafe fn kilohertz() -> Id; + + #[method_id(@__retain_semantics Other hertz)] + pub unsafe fn hertz() -> Id; + + #[method_id(@__retain_semantics Other millihertz)] + pub unsafe fn millihertz() -> Id; + + #[method_id(@__retain_semantics Other microhertz)] + pub unsafe fn microhertz() -> Id; + + #[method_id(@__retain_semantics Other nanohertz)] + pub unsafe fn nanohertz() -> Id; + + #[method_id(@__retain_semantics Other framesPerSecond)] + pub unsafe fn framesPerSecond() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitFuelEfficiency; + + unsafe impl ClassType for NSUnitFuelEfficiency { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitFuelEfficiency { + #[method_id(@__retain_semantics Other litersPer100Kilometers)] + pub unsafe fn litersPer100Kilometers() -> Id; + + #[method_id(@__retain_semantics Other milesPerImperialGallon)] + pub unsafe fn milesPerImperialGallon() -> Id; + + #[method_id(@__retain_semantics Other milesPerGallon)] + pub unsafe fn milesPerGallon() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitInformationStorage; + + unsafe impl ClassType for NSUnitInformationStorage { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitInformationStorage { + #[method_id(@__retain_semantics Other bytes)] + pub unsafe fn bytes() -> Id; + + #[method_id(@__retain_semantics Other bits)] + pub unsafe fn bits() -> Id; + + #[method_id(@__retain_semantics Other nibbles)] + pub unsafe fn nibbles() -> Id; + + #[method_id(@__retain_semantics Other yottabytes)] + pub unsafe fn yottabytes() -> Id; + + #[method_id(@__retain_semantics Other zettabytes)] + pub unsafe fn zettabytes() -> Id; + + #[method_id(@__retain_semantics Other exabytes)] + pub unsafe fn exabytes() -> Id; + + #[method_id(@__retain_semantics Other petabytes)] + pub unsafe fn petabytes() -> Id; + + #[method_id(@__retain_semantics Other terabytes)] + pub unsafe fn terabytes() -> Id; + + #[method_id(@__retain_semantics Other gigabytes)] + pub unsafe fn gigabytes() -> Id; + + #[method_id(@__retain_semantics Other megabytes)] + pub unsafe fn megabytes() -> Id; + + #[method_id(@__retain_semantics Other kilobytes)] + pub unsafe fn kilobytes() -> Id; + + #[method_id(@__retain_semantics Other yottabits)] + pub unsafe fn yottabits() -> Id; + + #[method_id(@__retain_semantics Other zettabits)] + pub unsafe fn zettabits() -> Id; + + #[method_id(@__retain_semantics Other exabits)] + pub unsafe fn exabits() -> Id; + + #[method_id(@__retain_semantics Other petabits)] + pub unsafe fn petabits() -> Id; + + #[method_id(@__retain_semantics Other terabits)] + pub unsafe fn terabits() -> Id; + + #[method_id(@__retain_semantics Other gigabits)] + pub unsafe fn gigabits() -> Id; + + #[method_id(@__retain_semantics Other megabits)] + pub unsafe fn megabits() -> Id; + + #[method_id(@__retain_semantics Other kilobits)] + pub unsafe fn kilobits() -> Id; + + #[method_id(@__retain_semantics Other yobibytes)] + pub unsafe fn yobibytes() -> Id; + + #[method_id(@__retain_semantics Other zebibytes)] + pub unsafe fn zebibytes() -> Id; + + #[method_id(@__retain_semantics Other exbibytes)] + pub unsafe fn exbibytes() -> Id; + + #[method_id(@__retain_semantics Other pebibytes)] + pub unsafe fn pebibytes() -> Id; + + #[method_id(@__retain_semantics Other tebibytes)] + pub unsafe fn tebibytes() -> Id; + + #[method_id(@__retain_semantics Other gibibytes)] + pub unsafe fn gibibytes() -> Id; + + #[method_id(@__retain_semantics Other mebibytes)] + pub unsafe fn mebibytes() -> Id; + + #[method_id(@__retain_semantics Other kibibytes)] + pub unsafe fn kibibytes() -> Id; + + #[method_id(@__retain_semantics Other yobibits)] + pub unsafe fn yobibits() -> Id; + + #[method_id(@__retain_semantics Other zebibits)] + pub unsafe fn zebibits() -> Id; + + #[method_id(@__retain_semantics Other exbibits)] + pub unsafe fn exbibits() -> Id; + + #[method_id(@__retain_semantics Other pebibits)] + pub unsafe fn pebibits() -> Id; + + #[method_id(@__retain_semantics Other tebibits)] + pub unsafe fn tebibits() -> Id; + + #[method_id(@__retain_semantics Other gibibits)] + pub unsafe fn gibibits() -> Id; + + #[method_id(@__retain_semantics Other mebibits)] + pub unsafe fn mebibits() -> Id; + + #[method_id(@__retain_semantics Other kibibits)] + pub unsafe fn kibibits() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitLength; + + unsafe impl ClassType for NSUnitLength { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitLength { + #[method_id(@__retain_semantics Other megameters)] + pub unsafe fn megameters() -> Id; + + #[method_id(@__retain_semantics Other kilometers)] + pub unsafe fn kilometers() -> Id; + + #[method_id(@__retain_semantics Other hectometers)] + pub unsafe fn hectometers() -> Id; + + #[method_id(@__retain_semantics Other decameters)] + pub unsafe fn decameters() -> Id; + + #[method_id(@__retain_semantics Other meters)] + pub unsafe fn meters() -> Id; + + #[method_id(@__retain_semantics Other decimeters)] + pub unsafe fn decimeters() -> Id; + + #[method_id(@__retain_semantics Other centimeters)] + pub unsafe fn centimeters() -> Id; + + #[method_id(@__retain_semantics Other millimeters)] + pub unsafe fn millimeters() -> Id; + + #[method_id(@__retain_semantics Other micrometers)] + pub unsafe fn micrometers() -> Id; + + #[method_id(@__retain_semantics Other nanometers)] + pub unsafe fn nanometers() -> Id; + + #[method_id(@__retain_semantics Other picometers)] + pub unsafe fn picometers() -> Id; + + #[method_id(@__retain_semantics Other inches)] + pub unsafe fn inches() -> Id; + + #[method_id(@__retain_semantics Other feet)] + pub unsafe fn feet() -> Id; + + #[method_id(@__retain_semantics Other yards)] + pub unsafe fn yards() -> Id; + + #[method_id(@__retain_semantics Other miles)] + pub unsafe fn miles() -> Id; + + #[method_id(@__retain_semantics Other scandinavianMiles)] + pub unsafe fn scandinavianMiles() -> Id; + + #[method_id(@__retain_semantics Other lightyears)] + pub unsafe fn lightyears() -> Id; + + #[method_id(@__retain_semantics Other nauticalMiles)] + pub unsafe fn nauticalMiles() -> Id; + + #[method_id(@__retain_semantics Other fathoms)] + pub unsafe fn fathoms() -> Id; + + #[method_id(@__retain_semantics Other furlongs)] + pub unsafe fn furlongs() -> Id; + + #[method_id(@__retain_semantics Other astronomicalUnits)] + pub unsafe fn astronomicalUnits() -> Id; + + #[method_id(@__retain_semantics Other parsecs)] + pub unsafe fn parsecs() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitIlluminance; + + unsafe impl ClassType for NSUnitIlluminance { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitIlluminance { + #[method_id(@__retain_semantics Other lux)] + pub unsafe fn lux() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitMass; + + unsafe impl ClassType for NSUnitMass { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitMass { + #[method_id(@__retain_semantics Other kilograms)] + pub unsafe fn kilograms() -> Id; + + #[method_id(@__retain_semantics Other grams)] + pub unsafe fn grams() -> Id; + + #[method_id(@__retain_semantics Other decigrams)] + pub unsafe fn decigrams() -> Id; + + #[method_id(@__retain_semantics Other centigrams)] + pub unsafe fn centigrams() -> Id; + + #[method_id(@__retain_semantics Other milligrams)] + pub unsafe fn milligrams() -> Id; + + #[method_id(@__retain_semantics Other micrograms)] + pub unsafe fn micrograms() -> Id; + + #[method_id(@__retain_semantics Other nanograms)] + pub unsafe fn nanograms() -> Id; + + #[method_id(@__retain_semantics Other picograms)] + pub unsafe fn picograms() -> Id; + + #[method_id(@__retain_semantics Other ounces)] + pub unsafe fn ounces() -> Id; + + #[method_id(@__retain_semantics Other poundsMass)] + pub unsafe fn poundsMass() -> Id; + + #[method_id(@__retain_semantics Other stones)] + pub unsafe fn stones() -> Id; + + #[method_id(@__retain_semantics Other metricTons)] + pub unsafe fn metricTons() -> Id; + + #[method_id(@__retain_semantics Other shortTons)] + pub unsafe fn shortTons() -> Id; + + #[method_id(@__retain_semantics Other carats)] + pub unsafe fn carats() -> Id; + + #[method_id(@__retain_semantics Other ouncesTroy)] + pub unsafe fn ouncesTroy() -> Id; + + #[method_id(@__retain_semantics Other slugs)] + pub unsafe fn slugs() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitPower; + + unsafe impl ClassType for NSUnitPower { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitPower { + #[method_id(@__retain_semantics Other terawatts)] + pub unsafe fn terawatts() -> Id; + + #[method_id(@__retain_semantics Other gigawatts)] + pub unsafe fn gigawatts() -> Id; + + #[method_id(@__retain_semantics Other megawatts)] + pub unsafe fn megawatts() -> Id; + + #[method_id(@__retain_semantics Other kilowatts)] + pub unsafe fn kilowatts() -> Id; + + #[method_id(@__retain_semantics Other watts)] + pub unsafe fn watts() -> Id; + + #[method_id(@__retain_semantics Other milliwatts)] + pub unsafe fn milliwatts() -> Id; + + #[method_id(@__retain_semantics Other microwatts)] + pub unsafe fn microwatts() -> Id; + + #[method_id(@__retain_semantics Other nanowatts)] + pub unsafe fn nanowatts() -> Id; + + #[method_id(@__retain_semantics Other picowatts)] + pub unsafe fn picowatts() -> Id; + + #[method_id(@__retain_semantics Other femtowatts)] + pub unsafe fn femtowatts() -> Id; + + #[method_id(@__retain_semantics Other horsepower)] + pub unsafe fn horsepower() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitPressure; + + unsafe impl ClassType for NSUnitPressure { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitPressure { + #[method_id(@__retain_semantics Other newtonsPerMetersSquared)] + pub unsafe fn newtonsPerMetersSquared() -> Id; + + #[method_id(@__retain_semantics Other gigapascals)] + pub unsafe fn gigapascals() -> Id; + + #[method_id(@__retain_semantics Other megapascals)] + pub unsafe fn megapascals() -> Id; + + #[method_id(@__retain_semantics Other kilopascals)] + pub unsafe fn kilopascals() -> Id; + + #[method_id(@__retain_semantics Other hectopascals)] + pub unsafe fn hectopascals() -> Id; + + #[method_id(@__retain_semantics Other inchesOfMercury)] + pub unsafe fn inchesOfMercury() -> Id; + + #[method_id(@__retain_semantics Other bars)] + pub unsafe fn bars() -> Id; + + #[method_id(@__retain_semantics Other millibars)] + pub unsafe fn millibars() -> Id; + + #[method_id(@__retain_semantics Other millimetersOfMercury)] + pub unsafe fn millimetersOfMercury() -> Id; + + #[method_id(@__retain_semantics Other poundsForcePerSquareInch)] + pub unsafe fn poundsForcePerSquareInch() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitSpeed; + + unsafe impl ClassType for NSUnitSpeed { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitSpeed { + #[method_id(@__retain_semantics Other metersPerSecond)] + pub unsafe fn metersPerSecond() -> Id; + + #[method_id(@__retain_semantics Other kilometersPerHour)] + pub unsafe fn kilometersPerHour() -> Id; + + #[method_id(@__retain_semantics Other milesPerHour)] + pub unsafe fn milesPerHour() -> Id; + + #[method_id(@__retain_semantics Other knots)] + pub unsafe fn knots() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitTemperature; + + unsafe impl ClassType for NSUnitTemperature { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitTemperature { + #[method_id(@__retain_semantics Other kelvin)] + pub unsafe fn kelvin() -> Id; + + #[method_id(@__retain_semantics Other celsius)] + pub unsafe fn celsius() -> Id; + + #[method_id(@__retain_semantics Other fahrenheit)] + pub unsafe fn fahrenheit() -> Id; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUnitVolume; + + unsafe impl ClassType for NSUnitVolume { + type Super = NSDimension; + } +); + +extern_methods!( + unsafe impl NSUnitVolume { + #[method_id(@__retain_semantics Other megaliters)] + pub unsafe fn megaliters() -> Id; + + #[method_id(@__retain_semantics Other kiloliters)] + pub unsafe fn kiloliters() -> Id; + + #[method_id(@__retain_semantics Other liters)] + pub unsafe fn liters() -> Id; + + #[method_id(@__retain_semantics Other deciliters)] + pub unsafe fn deciliters() -> Id; + + #[method_id(@__retain_semantics Other centiliters)] + pub unsafe fn centiliters() -> Id; + + #[method_id(@__retain_semantics Other milliliters)] + pub unsafe fn milliliters() -> Id; + + #[method_id(@__retain_semantics Other cubicKilometers)] + pub unsafe fn cubicKilometers() -> Id; + + #[method_id(@__retain_semantics Other cubicMeters)] + pub unsafe fn cubicMeters() -> Id; + + #[method_id(@__retain_semantics Other cubicDecimeters)] + pub unsafe fn cubicDecimeters() -> Id; + + #[method_id(@__retain_semantics Other cubicCentimeters)] + pub unsafe fn cubicCentimeters() -> Id; + + #[method_id(@__retain_semantics Other cubicMillimeters)] + pub unsafe fn cubicMillimeters() -> Id; + + #[method_id(@__retain_semantics Other cubicInches)] + pub unsafe fn cubicInches() -> Id; + + #[method_id(@__retain_semantics Other cubicFeet)] + pub unsafe fn cubicFeet() -> Id; + + #[method_id(@__retain_semantics Other cubicYards)] + pub unsafe fn cubicYards() -> Id; + + #[method_id(@__retain_semantics Other cubicMiles)] + pub unsafe fn cubicMiles() -> Id; + + #[method_id(@__retain_semantics Other acreFeet)] + pub unsafe fn acreFeet() -> Id; + + #[method_id(@__retain_semantics Other bushels)] + pub unsafe fn bushels() -> Id; + + #[method_id(@__retain_semantics Other teaspoons)] + pub unsafe fn teaspoons() -> Id; + + #[method_id(@__retain_semantics Other tablespoons)] + pub unsafe fn tablespoons() -> Id; + + #[method_id(@__retain_semantics Other fluidOunces)] + pub unsafe fn fluidOunces() -> Id; + + #[method_id(@__retain_semantics Other cups)] + pub unsafe fn cups() -> Id; + + #[method_id(@__retain_semantics Other pints)] + pub unsafe fn pints() -> Id; + + #[method_id(@__retain_semantics Other quarts)] + pub unsafe fn quarts() -> Id; + + #[method_id(@__retain_semantics Other gallons)] + pub unsafe fn gallons() -> Id; + + #[method_id(@__retain_semantics Other imperialTeaspoons)] + pub unsafe fn imperialTeaspoons() -> Id; + + #[method_id(@__retain_semantics Other imperialTablespoons)] + pub unsafe fn imperialTablespoons() -> Id; + + #[method_id(@__retain_semantics Other imperialFluidOunces)] + pub unsafe fn imperialFluidOunces() -> Id; + + #[method_id(@__retain_semantics Other imperialPints)] + pub unsafe fn imperialPints() -> Id; + + #[method_id(@__retain_semantics Other imperialQuarts)] + pub unsafe fn imperialQuarts() -> Id; + + #[method_id(@__retain_semantics Other imperialGallons)] + pub unsafe fn imperialGallons() -> Id; + + #[method_id(@__retain_semantics Other metricCups)] + pub unsafe fn metricCups() -> Id; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSUserActivity.rs b/crates/icrate/src/generated/Foundation/NSUserActivity.rs new file mode 100644 index 000000000..a6d16a8eb --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSUserActivity.rs @@ -0,0 +1,187 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSUserActivityPersistentIdentifier = NSString; + +extern_class!( + #[derive(Debug)] + pub struct NSUserActivity; + + unsafe impl ClassType for NSUserActivity { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSUserActivity { + #[method_id(@__retain_semantics Init initWithActivityType:)] + pub unsafe fn initWithActivityType( + this: Option>, + activityType: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other activityType)] + pub unsafe fn activityType(&self) -> Id; + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Option>; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: Option<&NSString>); + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + + #[method(setUserInfo:)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>); + + #[method(addUserInfoEntriesFromDictionary:)] + pub unsafe fn addUserInfoEntriesFromDictionary(&self, otherDictionary: &NSDictionary); + + #[method_id(@__retain_semantics Other requiredUserInfoKeys)] + pub unsafe fn requiredUserInfoKeys(&self) -> Option, Shared>>; + + #[method(setRequiredUserInfoKeys:)] + pub unsafe fn setRequiredUserInfoKeys( + &self, + requiredUserInfoKeys: Option<&NSSet>, + ); + + #[method(needsSave)] + pub unsafe fn needsSave(&self) -> bool; + + #[method(setNeedsSave:)] + pub unsafe fn setNeedsSave(&self, needsSave: bool); + + #[method_id(@__retain_semantics Other webpageURL)] + pub unsafe fn webpageURL(&self) -> Option>; + + #[method(setWebpageURL:)] + pub unsafe fn setWebpageURL(&self, webpageURL: Option<&NSURL>); + + #[method_id(@__retain_semantics Other referrerURL)] + pub unsafe fn referrerURL(&self) -> Option>; + + #[method(setReferrerURL:)] + pub unsafe fn setReferrerURL(&self, referrerURL: Option<&NSURL>); + + #[method_id(@__retain_semantics Other expirationDate)] + pub unsafe fn expirationDate(&self) -> Option>; + + #[method(setExpirationDate:)] + pub unsafe fn setExpirationDate(&self, expirationDate: Option<&NSDate>); + + #[method_id(@__retain_semantics Other keywords)] + pub unsafe fn keywords(&self) -> Id, Shared>; + + #[method(setKeywords:)] + pub unsafe fn setKeywords(&self, keywords: &NSSet); + + #[method(supportsContinuationStreams)] + pub unsafe fn supportsContinuationStreams(&self) -> bool; + + #[method(setSupportsContinuationStreams:)] + pub unsafe fn setSupportsContinuationStreams(&self, supportsContinuationStreams: bool); + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSUserActivityDelegate>); + + #[method_id(@__retain_semantics Other targetContentIdentifier)] + pub unsafe fn targetContentIdentifier(&self) -> Option>; + + #[method(setTargetContentIdentifier:)] + pub unsafe fn setTargetContentIdentifier(&self, targetContentIdentifier: Option<&NSString>); + + #[method(becomeCurrent)] + pub unsafe fn becomeCurrent(&self); + + #[method(resignCurrent)] + pub unsafe fn resignCurrent(&self); + + #[method(invalidate)] + pub unsafe fn invalidate(&self); + + #[method(getContinuationStreamsWithCompletionHandler:)] + pub unsafe fn getContinuationStreamsWithCompletionHandler( + &self, + completionHandler: &Block<(*mut NSInputStream, *mut NSOutputStream, *mut NSError), ()>, + ); + + #[method(isEligibleForHandoff)] + pub unsafe fn isEligibleForHandoff(&self) -> bool; + + #[method(setEligibleForHandoff:)] + pub unsafe fn setEligibleForHandoff(&self, eligibleForHandoff: bool); + + #[method(isEligibleForSearch)] + pub unsafe fn isEligibleForSearch(&self) -> bool; + + #[method(setEligibleForSearch:)] + pub unsafe fn setEligibleForSearch(&self, eligibleForSearch: bool); + + #[method(isEligibleForPublicIndexing)] + pub unsafe fn isEligibleForPublicIndexing(&self) -> bool; + + #[method(setEligibleForPublicIndexing:)] + pub unsafe fn setEligibleForPublicIndexing(&self, eligibleForPublicIndexing: bool); + + #[method(isEligibleForPrediction)] + pub unsafe fn isEligibleForPrediction(&self) -> bool; + + #[method(setEligibleForPrediction:)] + pub unsafe fn setEligibleForPrediction(&self, eligibleForPrediction: bool); + + #[method_id(@__retain_semantics Other persistentIdentifier)] + pub unsafe fn persistentIdentifier( + &self, + ) -> Option>; + + #[method(setPersistentIdentifier:)] + pub unsafe fn setPersistentIdentifier( + &self, + persistentIdentifier: Option<&NSUserActivityPersistentIdentifier>, + ); + + #[method(deleteSavedUserActivitiesWithPersistentIdentifiers:completionHandler:)] + pub unsafe fn deleteSavedUserActivitiesWithPersistentIdentifiers_completionHandler( + persistentIdentifiers: &NSArray, + handler: &Block<(), ()>, + ); + + #[method(deleteAllSavedUserActivitiesWithCompletionHandler:)] + pub unsafe fn deleteAllSavedUserActivitiesWithCompletionHandler(handler: &Block<(), ()>); + } +); + +extern_static!(NSUserActivityTypeBrowsingWeb: &'static NSString); + +extern_protocol!( + pub struct NSUserActivityDelegate; + + unsafe impl NSUserActivityDelegate { + #[optional] + #[method(userActivityWillSave:)] + pub unsafe fn userActivityWillSave(&self, userActivity: &NSUserActivity); + + #[optional] + #[method(userActivityWasContinued:)] + pub unsafe fn userActivityWasContinued(&self, userActivity: &NSUserActivity); + + #[optional] + #[method(userActivity:didReceiveInputStream:outputStream:)] + pub unsafe fn userActivity_didReceiveInputStream_outputStream( + &self, + userActivity: &NSUserActivity, + inputStream: &NSInputStream, + outputStream: &NSOutputStream, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSUserDefaults.rs b/crates/icrate/src/generated/Foundation/NSUserDefaults.rs new file mode 100644 index 000000000..4737cbcf1 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSUserDefaults.rs @@ -0,0 +1,235 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_static!(NSGlobalDomain: &'static NSString); + +extern_static!(NSArgumentDomain: &'static NSString); + +extern_static!(NSRegistrationDomain: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSUserDefaults; + + unsafe impl ClassType for NSUserDefaults { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSUserDefaults { + #[method_id(@__retain_semantics Other standardUserDefaults)] + pub unsafe fn standardUserDefaults() -> Id; + + #[method(resetStandardUserDefaults)] + pub unsafe fn resetStandardUserDefaults(); + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithSuiteName:)] + pub unsafe fn initWithSuiteName( + this: Option>, + suitename: Option<&NSString>, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithUser:)] + pub unsafe fn initWithUser( + this: Option>, + username: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other objectForKey:)] + pub unsafe fn objectForKey(&self, defaultName: &NSString) -> Option>; + + #[method(setObject:forKey:)] + pub unsafe fn setObject_forKey(&self, value: Option<&Object>, defaultName: &NSString); + + #[method(removeObjectForKey:)] + pub unsafe fn removeObjectForKey(&self, defaultName: &NSString); + + #[method_id(@__retain_semantics Other stringForKey:)] + pub unsafe fn stringForKey(&self, defaultName: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other arrayForKey:)] + pub unsafe fn arrayForKey(&self, defaultName: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other dictionaryForKey:)] + pub unsafe fn dictionaryForKey( + &self, + defaultName: &NSString, + ) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other dataForKey:)] + pub unsafe fn dataForKey(&self, defaultName: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other stringArrayForKey:)] + pub unsafe fn stringArrayForKey( + &self, + defaultName: &NSString, + ) -> Option, Shared>>; + + #[method(integerForKey:)] + pub unsafe fn integerForKey(&self, defaultName: &NSString) -> NSInteger; + + #[method(floatForKey:)] + pub unsafe fn floatForKey(&self, defaultName: &NSString) -> c_float; + + #[method(doubleForKey:)] + pub unsafe fn doubleForKey(&self, defaultName: &NSString) -> c_double; + + #[method(boolForKey:)] + pub unsafe fn boolForKey(&self, defaultName: &NSString) -> bool; + + #[method_id(@__retain_semantics Other URLForKey:)] + pub unsafe fn URLForKey(&self, defaultName: &NSString) -> Option>; + + #[method(setInteger:forKey:)] + pub unsafe fn setInteger_forKey(&self, value: NSInteger, defaultName: &NSString); + + #[method(setFloat:forKey:)] + pub unsafe fn setFloat_forKey(&self, value: c_float, defaultName: &NSString); + + #[method(setDouble:forKey:)] + pub unsafe fn setDouble_forKey(&self, value: c_double, defaultName: &NSString); + + #[method(setBool:forKey:)] + pub unsafe fn setBool_forKey(&self, value: bool, defaultName: &NSString); + + #[method(setURL:forKey:)] + pub unsafe fn setURL_forKey(&self, url: Option<&NSURL>, defaultName: &NSString); + + #[method(registerDefaults:)] + pub unsafe fn registerDefaults( + &self, + registrationDictionary: &NSDictionary, + ); + + #[method(addSuiteNamed:)] + pub unsafe fn addSuiteNamed(&self, suiteName: &NSString); + + #[method(removeSuiteNamed:)] + pub unsafe fn removeSuiteNamed(&self, suiteName: &NSString); + + #[method_id(@__retain_semantics Other dictionaryRepresentation)] + pub unsafe fn dictionaryRepresentation(&self) + -> Id, Shared>; + + #[method_id(@__retain_semantics Other volatileDomainNames)] + pub unsafe fn volatileDomainNames(&self) -> Id, Shared>; + + #[method_id(@__retain_semantics Other volatileDomainForName:)] + pub unsafe fn volatileDomainForName( + &self, + domainName: &NSString, + ) -> Id, Shared>; + + #[method(setVolatileDomain:forName:)] + pub unsafe fn setVolatileDomain_forName( + &self, + domain: &NSDictionary, + domainName: &NSString, + ); + + #[method(removeVolatileDomainForName:)] + pub unsafe fn removeVolatileDomainForName(&self, domainName: &NSString); + + #[method_id(@__retain_semantics Other persistentDomainNames)] + pub unsafe fn persistentDomainNames(&self) -> Id; + + #[method_id(@__retain_semantics Other persistentDomainForName:)] + pub unsafe fn persistentDomainForName( + &self, + domainName: &NSString, + ) -> Option, Shared>>; + + #[method(setPersistentDomain:forName:)] + pub unsafe fn setPersistentDomain_forName( + &self, + domain: &NSDictionary, + domainName: &NSString, + ); + + #[method(removePersistentDomainForName:)] + pub unsafe fn removePersistentDomainForName(&self, domainName: &NSString); + + #[method(synchronize)] + pub unsafe fn synchronize(&self) -> bool; + + #[method(objectIsForcedForKey:)] + pub unsafe fn objectIsForcedForKey(&self, key: &NSString) -> bool; + + #[method(objectIsForcedForKey:inDomain:)] + pub unsafe fn objectIsForcedForKey_inDomain( + &self, + key: &NSString, + domain: &NSString, + ) -> bool; + } +); + +extern_static!(NSUserDefaultsSizeLimitExceededNotification: &'static NSNotificationName); + +extern_static!(NSUbiquitousUserDefaultsNoCloudAccountNotification: &'static NSNotificationName); + +extern_static!(NSUbiquitousUserDefaultsDidChangeAccountsNotification: &'static NSNotificationName); + +extern_static!( + NSUbiquitousUserDefaultsCompletedInitialSyncNotification: &'static NSNotificationName +); + +extern_static!(NSUserDefaultsDidChangeNotification: &'static NSNotificationName); + +extern_static!(NSWeekDayNameArray: &'static NSString); + +extern_static!(NSShortWeekDayNameArray: &'static NSString); + +extern_static!(NSMonthNameArray: &'static NSString); + +extern_static!(NSShortMonthNameArray: &'static NSString); + +extern_static!(NSTimeFormatString: &'static NSString); + +extern_static!(NSDateFormatString: &'static NSString); + +extern_static!(NSTimeDateFormatString: &'static NSString); + +extern_static!(NSShortTimeDateFormatString: &'static NSString); + +extern_static!(NSCurrencySymbol: &'static NSString); + +extern_static!(NSDecimalSeparator: &'static NSString); + +extern_static!(NSThousandsSeparator: &'static NSString); + +extern_static!(NSDecimalDigits: &'static NSString); + +extern_static!(NSAMPMDesignation: &'static NSString); + +extern_static!(NSHourNameDesignations: &'static NSString); + +extern_static!(NSYearMonthWeekDesignations: &'static NSString); + +extern_static!(NSEarlierTimeDesignations: &'static NSString); + +extern_static!(NSLaterTimeDesignations: &'static NSString); + +extern_static!(NSThisDayDesignations: &'static NSString); + +extern_static!(NSNextDayDesignations: &'static NSString); + +extern_static!(NSNextNextDayDesignations: &'static NSString); + +extern_static!(NSPriorDayDesignations: &'static NSString); + +extern_static!(NSDateTimeOrdering: &'static NSString); + +extern_static!(NSInternationalCurrencyString: &'static NSString); + +extern_static!(NSShortDateFormatString: &'static NSString); + +extern_static!(NSPositiveCurrencyFormatString: &'static NSString); + +extern_static!(NSNegativeCurrencyFormatString: &'static NSString); diff --git a/crates/icrate/src/generated/Foundation/NSUserNotification.rs b/crates/icrate/src/generated/Foundation/NSUserNotification.rs new file mode 100644 index 000000000..9fa2a152e --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSUserNotification.rs @@ -0,0 +1,255 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSUserNotificationActivationType { + NSUserNotificationActivationTypeNone = 0, + NSUserNotificationActivationTypeContentsClicked = 1, + NSUserNotificationActivationTypeActionButtonClicked = 2, + NSUserNotificationActivationTypeReplied = 3, + NSUserNotificationActivationTypeAdditionalActionClicked = 4, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUserNotification; + + unsafe impl ClassType for NSUserNotification { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSUserNotification { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Option>; + + #[method(setTitle:)] + pub unsafe fn setTitle(&self, title: Option<&NSString>); + + #[method_id(@__retain_semantics Other subtitle)] + pub unsafe fn subtitle(&self) -> Option>; + + #[method(setSubtitle:)] + pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>); + + #[method_id(@__retain_semantics Other informativeText)] + pub unsafe fn informativeText(&self) -> Option>; + + #[method(setInformativeText:)] + pub unsafe fn setInformativeText(&self, informativeText: Option<&NSString>); + + #[method_id(@__retain_semantics Other actionButtonTitle)] + pub unsafe fn actionButtonTitle(&self) -> Id; + + #[method(setActionButtonTitle:)] + pub unsafe fn setActionButtonTitle(&self, actionButtonTitle: &NSString); + + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option, Shared>>; + + #[method(setUserInfo:)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>); + + #[method_id(@__retain_semantics Other deliveryDate)] + pub unsafe fn deliveryDate(&self) -> Option>; + + #[method(setDeliveryDate:)] + pub unsafe fn setDeliveryDate(&self, deliveryDate: Option<&NSDate>); + + #[method_id(@__retain_semantics Other deliveryTimeZone)] + pub unsafe fn deliveryTimeZone(&self) -> Option>; + + #[method(setDeliveryTimeZone:)] + pub unsafe fn setDeliveryTimeZone(&self, deliveryTimeZone: Option<&NSTimeZone>); + + #[method_id(@__retain_semantics Other deliveryRepeatInterval)] + pub unsafe fn deliveryRepeatInterval(&self) -> Option>; + + #[method(setDeliveryRepeatInterval:)] + pub unsafe fn setDeliveryRepeatInterval( + &self, + deliveryRepeatInterval: Option<&NSDateComponents>, + ); + + #[method_id(@__retain_semantics Other actualDeliveryDate)] + pub unsafe fn actualDeliveryDate(&self) -> Option>; + + #[method(isPresented)] + pub unsafe fn isPresented(&self) -> bool; + + #[method(isRemote)] + pub unsafe fn isRemote(&self) -> bool; + + #[method_id(@__retain_semantics Other soundName)] + pub unsafe fn soundName(&self) -> Option>; + + #[method(setSoundName:)] + pub unsafe fn setSoundName(&self, soundName: Option<&NSString>); + + #[method(hasActionButton)] + pub unsafe fn hasActionButton(&self) -> bool; + + #[method(setHasActionButton:)] + pub unsafe fn setHasActionButton(&self, hasActionButton: bool); + + #[method(activationType)] + pub unsafe fn activationType(&self) -> NSUserNotificationActivationType; + + #[method_id(@__retain_semantics Other otherButtonTitle)] + pub unsafe fn otherButtonTitle(&self) -> Id; + + #[method(setOtherButtonTitle:)] + pub unsafe fn setOtherButtonTitle(&self, otherButtonTitle: &NSString); + + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Option>; + + #[method(setIdentifier:)] + pub unsafe fn setIdentifier(&self, identifier: Option<&NSString>); + + #[method(hasReplyButton)] + pub unsafe fn hasReplyButton(&self) -> bool; + + #[method(setHasReplyButton:)] + pub unsafe fn setHasReplyButton(&self, hasReplyButton: bool); + + #[method_id(@__retain_semantics Other responsePlaceholder)] + pub unsafe fn responsePlaceholder(&self) -> Option>; + + #[method(setResponsePlaceholder:)] + pub unsafe fn setResponsePlaceholder(&self, responsePlaceholder: Option<&NSString>); + + #[method_id(@__retain_semantics Other response)] + pub unsafe fn response(&self) -> Option>; + + #[method_id(@__retain_semantics Other additionalActions)] + pub unsafe fn additionalActions( + &self, + ) -> Option, Shared>>; + + #[method(setAdditionalActions:)] + pub unsafe fn setAdditionalActions( + &self, + additionalActions: Option<&NSArray>, + ); + + #[method_id(@__retain_semantics Other additionalActivationAction)] + pub unsafe fn additionalActivationAction( + &self, + ) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSUserNotificationAction; + + unsafe impl ClassType for NSUserNotificationAction { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSUserNotificationAction { + #[method_id(@__retain_semantics Other actionWithIdentifier:title:)] + pub unsafe fn actionWithIdentifier_title( + identifier: Option<&NSString>, + title: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Other identifier)] + pub unsafe fn identifier(&self) -> Option>; + + #[method_id(@__retain_semantics Other title)] + pub unsafe fn title(&self) -> Option>; + } +); + +extern_static!(NSUserNotificationDefaultSoundName: &'static NSString); + +extern_class!( + #[derive(Debug)] + pub struct NSUserNotificationCenter; + + unsafe impl ClassType for NSUserNotificationCenter { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSUserNotificationCenter { + #[method_id(@__retain_semantics Other defaultUserNotificationCenter)] + pub unsafe fn defaultUserNotificationCenter() -> Id; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSUserNotificationCenterDelegate>); + + #[method_id(@__retain_semantics Other scheduledNotifications)] + pub unsafe fn scheduledNotifications(&self) -> Id, Shared>; + + #[method(setScheduledNotifications:)] + pub unsafe fn setScheduledNotifications( + &self, + scheduledNotifications: &NSArray, + ); + + #[method(scheduleNotification:)] + pub unsafe fn scheduleNotification(&self, notification: &NSUserNotification); + + #[method(removeScheduledNotification:)] + pub unsafe fn removeScheduledNotification(&self, notification: &NSUserNotification); + + #[method_id(@__retain_semantics Other deliveredNotifications)] + pub unsafe fn deliveredNotifications(&self) -> Id, Shared>; + + #[method(deliverNotification:)] + pub unsafe fn deliverNotification(&self, notification: &NSUserNotification); + + #[method(removeDeliveredNotification:)] + pub unsafe fn removeDeliveredNotification(&self, notification: &NSUserNotification); + + #[method(removeAllDeliveredNotifications)] + pub unsafe fn removeAllDeliveredNotifications(&self); + } +); + +extern_protocol!( + pub struct NSUserNotificationCenterDelegate; + + unsafe impl NSUserNotificationCenterDelegate { + #[optional] + #[method(userNotificationCenter:didDeliverNotification:)] + pub unsafe fn userNotificationCenter_didDeliverNotification( + &self, + center: &NSUserNotificationCenter, + notification: &NSUserNotification, + ); + + #[optional] + #[method(userNotificationCenter:didActivateNotification:)] + pub unsafe fn userNotificationCenter_didActivateNotification( + &self, + center: &NSUserNotificationCenter, + notification: &NSUserNotification, + ); + + #[optional] + #[method(userNotificationCenter:shouldPresentNotification:)] + pub unsafe fn userNotificationCenter_shouldPresentNotification( + &self, + center: &NSUserNotificationCenter, + notification: &NSUserNotification, + ) -> bool; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSUserScriptTask.rs b/crates/icrate/src/generated/Foundation/NSUserScriptTask.rs new file mode 100644 index 000000000..b6b2a2748 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSUserScriptTask.rs @@ -0,0 +1,125 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSUserScriptTaskCompletionHandler = *mut Block<(*mut NSError,), ()>; + +extern_class!( + #[derive(Debug)] + pub struct NSUserScriptTask; + + unsafe impl ClassType for NSUserScriptTask { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSUserScriptTask { + #[method_id(@__retain_semantics Init initWithURL:error:)] + pub unsafe fn initWithURL_error( + this: Option>, + url: &NSURL, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other scriptURL)] + pub unsafe fn scriptURL(&self) -> Id; + + #[method(executeWithCompletionHandler:)] + pub unsafe fn executeWithCompletionHandler( + &self, + handler: NSUserScriptTaskCompletionHandler, + ); + } +); + +pub type NSUserUnixTaskCompletionHandler = *mut Block<(*mut NSError,), ()>; + +extern_class!( + #[derive(Debug)] + pub struct NSUserUnixTask; + + unsafe impl ClassType for NSUserUnixTask { + type Super = NSUserScriptTask; + } +); + +extern_methods!( + unsafe impl NSUserUnixTask { + #[method_id(@__retain_semantics Other standardInput)] + pub unsafe fn standardInput(&self) -> Option>; + + #[method(setStandardInput:)] + pub unsafe fn setStandardInput(&self, standardInput: Option<&NSFileHandle>); + + #[method_id(@__retain_semantics Other standardOutput)] + pub unsafe fn standardOutput(&self) -> Option>; + + #[method(setStandardOutput:)] + pub unsafe fn setStandardOutput(&self, standardOutput: Option<&NSFileHandle>); + + #[method_id(@__retain_semantics Other standardError)] + pub unsafe fn standardError(&self) -> Option>; + + #[method(setStandardError:)] + pub unsafe fn setStandardError(&self, standardError: Option<&NSFileHandle>); + + #[method(executeWithArguments:completionHandler:)] + pub unsafe fn executeWithArguments_completionHandler( + &self, + arguments: Option<&NSArray>, + handler: NSUserUnixTaskCompletionHandler, + ); + } +); + +pub type NSUserAppleScriptTaskCompletionHandler = + *mut Block<(*mut NSAppleEventDescriptor, *mut NSError), ()>; + +extern_class!( + #[derive(Debug)] + pub struct NSUserAppleScriptTask; + + unsafe impl ClassType for NSUserAppleScriptTask { + type Super = NSUserScriptTask; + } +); + +extern_methods!( + unsafe impl NSUserAppleScriptTask { + #[method(executeWithAppleEvent:completionHandler:)] + pub unsafe fn executeWithAppleEvent_completionHandler( + &self, + event: Option<&NSAppleEventDescriptor>, + handler: NSUserAppleScriptTaskCompletionHandler, + ); + } +); + +pub type NSUserAutomatorTaskCompletionHandler = *mut Block<(*mut Object, *mut NSError), ()>; + +extern_class!( + #[derive(Debug)] + pub struct NSUserAutomatorTask; + + unsafe impl ClassType for NSUserAutomatorTask { + type Super = NSUserScriptTask; + } +); + +extern_methods!( + unsafe impl NSUserAutomatorTask { + #[method_id(@__retain_semantics Other variables)] + pub unsafe fn variables(&self) -> Option, Shared>>; + + #[method(setVariables:)] + pub unsafe fn setVariables(&self, variables: Option<&NSDictionary>); + + #[method(executeWithInput:completionHandler:)] + pub unsafe fn executeWithInput_completionHandler( + &self, + input: Option<&NSSecureCoding>, + handler: NSUserAutomatorTaskCompletionHandler, + ); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSValue.rs b/crates/icrate/src/generated/Foundation/NSValue.rs new file mode 100644 index 000000000..e2e4442c5 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSValue.rs @@ -0,0 +1,298 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSValue; + + unsafe impl ClassType for NSValue { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSValue { + #[method(getValue:size:)] + pub unsafe fn getValue_size(&self, value: NonNull, size: NSUInteger); + + #[method(objCType)] + pub unsafe fn objCType(&self) -> NonNull; + + #[method_id(@__retain_semantics Init initWithBytes:objCType:)] + pub unsafe fn initWithBytes_objCType( + this: Option>, + value: NonNull, + type_: NonNull, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + } +); + +extern_methods!( + /// NSValueCreation + unsafe impl NSValue { + #[method_id(@__retain_semantics Other valueWithBytes:objCType:)] + pub unsafe fn valueWithBytes_objCType( + value: NonNull, + type_: NonNull, + ) -> Id; + + #[method_id(@__retain_semantics Other value:withObjCType:)] + pub unsafe fn value_withObjCType( + value: NonNull, + type_: NonNull, + ) -> Id; + } +); + +extern_methods!( + /// NSValueExtensionMethods + unsafe impl NSValue { + #[method_id(@__retain_semantics Other valueWithNonretainedObject:)] + pub unsafe fn valueWithNonretainedObject(anObject: Option<&Object>) -> Id; + + #[method_id(@__retain_semantics Other nonretainedObjectValue)] + pub unsafe fn nonretainedObjectValue(&self) -> Option>; + + #[method_id(@__retain_semantics Other valueWithPointer:)] + pub unsafe fn valueWithPointer(pointer: *mut c_void) -> Id; + + #[method(pointerValue)] + pub unsafe fn pointerValue(&self) -> *mut c_void; + + #[method(isEqualToValue:)] + pub unsafe fn isEqualToValue(&self, value: &NSValue) -> bool; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSNumber; + + unsafe impl ClassType for NSNumber { + type Super = NSValue; + } +); + +extern_methods!( + unsafe impl NSNumber { + #[method_id(@__retain_semantics Init initWithCoder:)] + pub unsafe fn initWithCoder( + this: Option>, + coder: &NSCoder, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithChar:)] + pub unsafe fn initWithChar( + this: Option>, + value: c_char, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithUnsignedChar:)] + pub unsafe fn initWithUnsignedChar( + this: Option>, + value: c_uchar, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithShort:)] + pub unsafe fn initWithShort( + this: Option>, + value: c_short, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithUnsignedShort:)] + pub unsafe fn initWithUnsignedShort( + this: Option>, + value: c_ushort, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithInt:)] + pub unsafe fn initWithInt( + this: Option>, + value: c_int, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithUnsignedInt:)] + pub unsafe fn initWithUnsignedInt( + this: Option>, + value: c_uint, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithLong:)] + pub unsafe fn initWithLong( + this: Option>, + value: c_long, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithUnsignedLong:)] + pub unsafe fn initWithUnsignedLong( + this: Option>, + value: c_ulong, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithLongLong:)] + pub unsafe fn initWithLongLong( + this: Option>, + value: c_longlong, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithUnsignedLongLong:)] + pub unsafe fn initWithUnsignedLongLong( + this: Option>, + value: c_ulonglong, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithFloat:)] + pub unsafe fn initWithFloat( + this: Option>, + value: c_float, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithDouble:)] + pub unsafe fn initWithDouble( + this: Option>, + value: c_double, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithBool:)] + pub unsafe fn initWithBool( + this: Option>, + value: bool, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithInteger:)] + pub unsafe fn initWithInteger( + this: Option>, + value: NSInteger, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithUnsignedInteger:)] + pub unsafe fn initWithUnsignedInteger( + this: Option>, + value: NSUInteger, + ) -> Id; + + #[method(charValue)] + pub unsafe fn charValue(&self) -> c_char; + + #[method(unsignedCharValue)] + pub unsafe fn unsignedCharValue(&self) -> c_uchar; + + #[method(shortValue)] + pub unsafe fn shortValue(&self) -> c_short; + + #[method(unsignedShortValue)] + pub unsafe fn unsignedShortValue(&self) -> c_ushort; + + #[method(intValue)] + pub unsafe fn intValue(&self) -> c_int; + + #[method(unsignedIntValue)] + pub unsafe fn unsignedIntValue(&self) -> c_uint; + + #[method(longValue)] + pub unsafe fn longValue(&self) -> c_long; + + #[method(unsignedLongValue)] + pub unsafe fn unsignedLongValue(&self) -> c_ulong; + + #[method(longLongValue)] + pub unsafe fn longLongValue(&self) -> c_longlong; + + #[method(unsignedLongLongValue)] + pub unsafe fn unsignedLongLongValue(&self) -> c_ulonglong; + + #[method(floatValue)] + pub unsafe fn floatValue(&self) -> c_float; + + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + + #[method(boolValue)] + pub unsafe fn boolValue(&self) -> bool; + + #[method(integerValue)] + pub unsafe fn integerValue(&self) -> NSInteger; + + #[method(unsignedIntegerValue)] + pub unsafe fn unsignedIntegerValue(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other stringValue)] + pub unsafe fn stringValue(&self) -> Id; + + #[method(compare:)] + pub unsafe fn compare(&self, otherNumber: &NSNumber) -> NSComparisonResult; + + #[method(isEqualToNumber:)] + pub unsafe fn isEqualToNumber(&self, number: &NSNumber) -> bool; + + #[method_id(@__retain_semantics Other descriptionWithLocale:)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + } +); + +extern_methods!( + /// NSNumberCreation + unsafe impl NSNumber { + #[method_id(@__retain_semantics Other numberWithChar:)] + pub unsafe fn numberWithChar(value: c_char) -> Id; + + #[method_id(@__retain_semantics Other numberWithUnsignedChar:)] + pub unsafe fn numberWithUnsignedChar(value: c_uchar) -> Id; + + #[method_id(@__retain_semantics Other numberWithShort:)] + pub unsafe fn numberWithShort(value: c_short) -> Id; + + #[method_id(@__retain_semantics Other numberWithUnsignedShort:)] + pub unsafe fn numberWithUnsignedShort(value: c_ushort) -> Id; + + #[method_id(@__retain_semantics Other numberWithInt:)] + pub unsafe fn numberWithInt(value: c_int) -> Id; + + #[method_id(@__retain_semantics Other numberWithUnsignedInt:)] + pub unsafe fn numberWithUnsignedInt(value: c_uint) -> Id; + + #[method_id(@__retain_semantics Other numberWithLong:)] + pub unsafe fn numberWithLong(value: c_long) -> Id; + + #[method_id(@__retain_semantics Other numberWithUnsignedLong:)] + pub unsafe fn numberWithUnsignedLong(value: c_ulong) -> Id; + + #[method_id(@__retain_semantics Other numberWithLongLong:)] + pub unsafe fn numberWithLongLong(value: c_longlong) -> Id; + + #[method_id(@__retain_semantics Other numberWithUnsignedLongLong:)] + pub unsafe fn numberWithUnsignedLongLong(value: c_ulonglong) -> Id; + + #[method_id(@__retain_semantics Other numberWithFloat:)] + pub unsafe fn numberWithFloat(value: c_float) -> Id; + + #[method_id(@__retain_semantics Other numberWithDouble:)] + pub unsafe fn numberWithDouble(value: c_double) -> Id; + + #[method_id(@__retain_semantics Other numberWithBool:)] + pub unsafe fn numberWithBool(value: bool) -> Id; + + #[method_id(@__retain_semantics Other numberWithInteger:)] + pub unsafe fn numberWithInteger(value: NSInteger) -> Id; + + #[method_id(@__retain_semantics Other numberWithUnsignedInteger:)] + pub unsafe fn numberWithUnsignedInteger(value: NSUInteger) -> Id; + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSValue { + #[method(getValue:)] + pub unsafe fn getValue(&self, value: NonNull); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSValueTransformer.rs b/crates/icrate/src/generated/Foundation/NSValueTransformer.rs new file mode 100644 index 000000000..5ae5c3e06 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSValueTransformer.rs @@ -0,0 +1,77 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +pub type NSValueTransformerName = NSString; + +extern_static!(NSNegateBooleanTransformerName: &'static NSValueTransformerName); + +extern_static!(NSIsNilTransformerName: &'static NSValueTransformerName); + +extern_static!(NSIsNotNilTransformerName: &'static NSValueTransformerName); + +extern_static!(NSUnarchiveFromDataTransformerName: &'static NSValueTransformerName); + +extern_static!(NSKeyedUnarchiveFromDataTransformerName: &'static NSValueTransformerName); + +extern_static!(NSSecureUnarchiveFromDataTransformerName: &'static NSValueTransformerName); + +extern_class!( + #[derive(Debug)] + pub struct NSValueTransformer; + + unsafe impl ClassType for NSValueTransformer { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSValueTransformer { + #[method(setValueTransformer:forName:)] + pub unsafe fn setValueTransformer_forName( + transformer: Option<&NSValueTransformer>, + name: &NSValueTransformerName, + ); + + #[method_id(@__retain_semantics Other valueTransformerForName:)] + pub unsafe fn valueTransformerForName( + name: &NSValueTransformerName, + ) -> Option>; + + #[method_id(@__retain_semantics Other valueTransformerNames)] + pub unsafe fn valueTransformerNames() -> Id, Shared>; + + #[method(transformedValueClass)] + pub unsafe fn transformedValueClass() -> &'static Class; + + #[method(allowsReverseTransformation)] + pub unsafe fn allowsReverseTransformation() -> bool; + + #[method_id(@__retain_semantics Other transformedValue:)] + pub unsafe fn transformedValue(&self, value: Option<&Object>) + -> Option>; + + #[method_id(@__retain_semantics Other reverseTransformedValue:)] + pub unsafe fn reverseTransformedValue( + &self, + value: Option<&Object>, + ) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSSecureUnarchiveFromDataTransformer; + + unsafe impl ClassType for NSSecureUnarchiveFromDataTransformer { + type Super = NSValueTransformer; + } +); + +extern_methods!( + unsafe impl NSSecureUnarchiveFromDataTransformer { + #[method_id(@__retain_semantics Other allowedTopLevelClasses)] + pub unsafe fn allowedTopLevelClasses() -> Id, Shared>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSXMLDTD.rs b/crates/icrate/src/generated/Foundation/NSXMLDTD.rs new file mode 100644 index 000000000..a165bd7bf --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSXMLDTD.rs @@ -0,0 +1,105 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSXMLDTD; + + unsafe impl ClassType for NSXMLDTD { + type Super = NSXMLNode; + } +); + +extern_methods!( + unsafe impl NSXMLDTD { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithKind:options:)] + pub unsafe fn initWithKind_options( + this: Option>, + kind: NSXMLNodeKind, + options: NSXMLNodeOptions, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:options:error:)] + pub unsafe fn initWithContentsOfURL_options_error( + this: Option>, + url: &NSURL, + mask: NSXMLNodeOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithData:options:error:)] + pub unsafe fn initWithData_options_error( + this: Option>, + data: &NSData, + mask: NSXMLNodeOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other publicID)] + pub unsafe fn publicID(&self) -> Option>; + + #[method(setPublicID:)] + pub unsafe fn setPublicID(&self, publicID: Option<&NSString>); + + #[method_id(@__retain_semantics Other systemID)] + pub unsafe fn systemID(&self) -> Option>; + + #[method(setSystemID:)] + pub unsafe fn setSystemID(&self, systemID: Option<&NSString>); + + #[method(insertChild:atIndex:)] + pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger); + + #[method(insertChildren:atIndex:)] + pub unsafe fn insertChildren_atIndex( + &self, + children: &NSArray, + index: NSUInteger, + ); + + #[method(removeChildAtIndex:)] + pub unsafe fn removeChildAtIndex(&self, index: NSUInteger); + + #[method(setChildren:)] + pub unsafe fn setChildren(&self, children: Option<&NSArray>); + + #[method(addChild:)] + pub unsafe fn addChild(&self, child: &NSXMLNode); + + #[method(replaceChildAtIndex:withNode:)] + pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode); + + #[method_id(@__retain_semantics Other entityDeclarationForName:)] + pub unsafe fn entityDeclarationForName( + &self, + name: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other notationDeclarationForName:)] + pub unsafe fn notationDeclarationForName( + &self, + name: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other elementDeclarationForName:)] + pub unsafe fn elementDeclarationForName( + &self, + name: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other attributeDeclarationForName:elementName:)] + pub unsafe fn attributeDeclarationForName_elementName( + &self, + name: &NSString, + elementName: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other predefinedEntityDeclarationForName:)] + pub unsafe fn predefinedEntityDeclarationForName( + name: &NSString, + ) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSXMLDTDNode.rs b/crates/icrate/src/generated/Foundation/NSXMLDTDNode.rs new file mode 100644 index 000000000..c4fd96cda --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSXMLDTDNode.rs @@ -0,0 +1,86 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSXMLDTDNodeKind { + NSXMLEntityGeneralKind = 1, + NSXMLEntityParsedKind = 2, + NSXMLEntityUnparsedKind = 3, + NSXMLEntityParameterKind = 4, + NSXMLEntityPredefined = 5, + NSXMLAttributeCDATAKind = 6, + NSXMLAttributeIDKind = 7, + NSXMLAttributeIDRefKind = 8, + NSXMLAttributeIDRefsKind = 9, + NSXMLAttributeEntityKind = 10, + NSXMLAttributeEntitiesKind = 11, + NSXMLAttributeNMTokenKind = 12, + NSXMLAttributeNMTokensKind = 13, + NSXMLAttributeEnumerationKind = 14, + NSXMLAttributeNotationKind = 15, + NSXMLElementDeclarationUndefinedKind = 16, + NSXMLElementDeclarationEmptyKind = 17, + NSXMLElementDeclarationAnyKind = 18, + NSXMLElementDeclarationMixedKind = 19, + NSXMLElementDeclarationElementKind = 20, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSXMLDTDNode; + + unsafe impl ClassType for NSXMLDTDNode { + type Super = NSXMLNode; + } +); + +extern_methods!( + unsafe impl NSXMLDTDNode { + #[method_id(@__retain_semantics Init initWithXMLString:)] + pub unsafe fn initWithXMLString( + this: Option>, + string: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithKind:options:)] + pub unsafe fn initWithKind_options( + this: Option>, + kind: NSXMLNodeKind, + options: NSXMLNodeOptions, + ) -> Id; + + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method(DTDKind)] + pub unsafe fn DTDKind(&self) -> NSXMLDTDNodeKind; + + #[method(setDTDKind:)] + pub unsafe fn setDTDKind(&self, DTDKind: NSXMLDTDNodeKind); + + #[method(isExternal)] + pub unsafe fn isExternal(&self) -> bool; + + #[method_id(@__retain_semantics Other publicID)] + pub unsafe fn publicID(&self) -> Option>; + + #[method(setPublicID:)] + pub unsafe fn setPublicID(&self, publicID: Option<&NSString>); + + #[method_id(@__retain_semantics Other systemID)] + pub unsafe fn systemID(&self) -> Option>; + + #[method(setSystemID:)] + pub unsafe fn setSystemID(&self, systemID: Option<&NSString>); + + #[method_id(@__retain_semantics Other notationName)] + pub unsafe fn notationName(&self) -> Option>; + + #[method(setNotationName:)] + pub unsafe fn setNotationName(&self, notationName: Option<&NSString>); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSXMLDocument.rs b/crates/icrate/src/generated/Foundation/NSXMLDocument.rs new file mode 100644 index 000000000..a94886dd7 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSXMLDocument.rs @@ -0,0 +1,154 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSXMLDocumentContentKind { + NSXMLDocumentXMLKind = 0, + NSXMLDocumentXHTMLKind = 1, + NSXMLDocumentHTMLKind = 2, + NSXMLDocumentTextKind = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSXMLDocument; + + unsafe impl ClassType for NSXMLDocument { + type Super = NSXMLNode; + } +); + +extern_methods!( + unsafe impl NSXMLDocument { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithXMLString:options:error:)] + pub unsafe fn initWithXMLString_options_error( + this: Option>, + string: &NSString, + mask: NSXMLNodeOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithContentsOfURL:options:error:)] + pub unsafe fn initWithContentsOfURL_options_error( + this: Option>, + url: &NSURL, + mask: NSXMLNodeOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithData:options:error:)] + pub unsafe fn initWithData_options_error( + this: Option>, + data: &NSData, + mask: NSXMLNodeOptions, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithRootElement:)] + pub unsafe fn initWithRootElement( + this: Option>, + element: Option<&NSXMLElement>, + ) -> Id; + + #[method(replacementClassForClass:)] + pub unsafe fn replacementClassForClass(cls: &Class) -> &'static Class; + + #[method_id(@__retain_semantics Other characterEncoding)] + pub unsafe fn characterEncoding(&self) -> Option>; + + #[method(setCharacterEncoding:)] + pub unsafe fn setCharacterEncoding(&self, characterEncoding: Option<&NSString>); + + #[method_id(@__retain_semantics Other version)] + pub unsafe fn version(&self) -> Option>; + + #[method(setVersion:)] + pub unsafe fn setVersion(&self, version: Option<&NSString>); + + #[method(isStandalone)] + pub unsafe fn isStandalone(&self) -> bool; + + #[method(setStandalone:)] + pub unsafe fn setStandalone(&self, standalone: bool); + + #[method(documentContentKind)] + pub unsafe fn documentContentKind(&self) -> NSXMLDocumentContentKind; + + #[method(setDocumentContentKind:)] + pub unsafe fn setDocumentContentKind(&self, documentContentKind: NSXMLDocumentContentKind); + + #[method_id(@__retain_semantics Other MIMEType)] + pub unsafe fn MIMEType(&self) -> Option>; + + #[method(setMIMEType:)] + pub unsafe fn setMIMEType(&self, MIMEType: Option<&NSString>); + + #[method_id(@__retain_semantics Other DTD)] + pub unsafe fn DTD(&self) -> Option>; + + #[method(setDTD:)] + pub unsafe fn setDTD(&self, DTD: Option<&NSXMLDTD>); + + #[method(setRootElement:)] + pub unsafe fn setRootElement(&self, root: &NSXMLElement); + + #[method_id(@__retain_semantics Other rootElement)] + pub unsafe fn rootElement(&self) -> Option>; + + #[method(insertChild:atIndex:)] + pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger); + + #[method(insertChildren:atIndex:)] + pub unsafe fn insertChildren_atIndex( + &self, + children: &NSArray, + index: NSUInteger, + ); + + #[method(removeChildAtIndex:)] + pub unsafe fn removeChildAtIndex(&self, index: NSUInteger); + + #[method(setChildren:)] + pub unsafe fn setChildren(&self, children: Option<&NSArray>); + + #[method(addChild:)] + pub unsafe fn addChild(&self, child: &NSXMLNode); + + #[method(replaceChildAtIndex:withNode:)] + pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode); + + #[method_id(@__retain_semantics Other XMLData)] + pub unsafe fn XMLData(&self) -> Id; + + #[method_id(@__retain_semantics Other XMLDataWithOptions:)] + pub unsafe fn XMLDataWithOptions(&self, options: NSXMLNodeOptions) -> Id; + + #[method_id(@__retain_semantics Other objectByApplyingXSLT:arguments:error:)] + pub unsafe fn objectByApplyingXSLT_arguments_error( + &self, + xslt: &NSData, + arguments: Option<&NSDictionary>, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other objectByApplyingXSLTString:arguments:error:)] + pub unsafe fn objectByApplyingXSLTString_arguments_error( + &self, + xslt: &NSString, + arguments: Option<&NSDictionary>, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other objectByApplyingXSLTAtURL:arguments:error:)] + pub unsafe fn objectByApplyingXSLTAtURL_arguments_error( + &self, + xsltURL: &NSURL, + argument: Option<&NSDictionary>, + ) -> Result, Id>; + + #[method(validateAndReturnError:)] + pub unsafe fn validateAndReturnError(&self) -> Result<(), Id>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSXMLElement.rs b/crates/icrate/src/generated/Foundation/NSXMLElement.rs new file mode 100644 index 000000000..4a35b9447 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSXMLElement.rs @@ -0,0 +1,148 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_class!( + #[derive(Debug)] + pub struct NSXMLElement; + + unsafe impl ClassType for NSXMLElement { + type Super = NSXMLNode; + } +); + +extern_methods!( + unsafe impl NSXMLElement { + #[method_id(@__retain_semantics Init initWithName:)] + pub unsafe fn initWithName( + this: Option>, + name: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithName:URI:)] + pub unsafe fn initWithName_URI( + this: Option>, + name: &NSString, + URI: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithName:stringValue:)] + pub unsafe fn initWithName_stringValue( + this: Option>, + name: &NSString, + string: Option<&NSString>, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithXMLString:error:)] + pub unsafe fn initWithXMLString_error( + this: Option>, + string: &NSString, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Init initWithKind:options:)] + pub unsafe fn initWithKind_options( + this: Option>, + kind: NSXMLNodeKind, + options: NSXMLNodeOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other elementsForName:)] + pub unsafe fn elementsForName(&self, name: &NSString) -> Id, Shared>; + + #[method_id(@__retain_semantics Other elementsForLocalName:URI:)] + pub unsafe fn elementsForLocalName_URI( + &self, + localName: &NSString, + URI: Option<&NSString>, + ) -> Id, Shared>; + + #[method(addAttribute:)] + pub unsafe fn addAttribute(&self, attribute: &NSXMLNode); + + #[method(removeAttributeForName:)] + pub unsafe fn removeAttributeForName(&self, name: &NSString); + + #[method_id(@__retain_semantics Other attributes)] + pub unsafe fn attributes(&self) -> Option, Shared>>; + + #[method(setAttributes:)] + pub unsafe fn setAttributes(&self, attributes: Option<&NSArray>); + + #[method(setAttributesWithDictionary:)] + pub unsafe fn setAttributesWithDictionary( + &self, + attributes: &NSDictionary, + ); + + #[method_id(@__retain_semantics Other attributeForName:)] + pub unsafe fn attributeForName(&self, name: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other attributeForLocalName:URI:)] + pub unsafe fn attributeForLocalName_URI( + &self, + localName: &NSString, + URI: Option<&NSString>, + ) -> Option>; + + #[method(addNamespace:)] + pub unsafe fn addNamespace(&self, aNamespace: &NSXMLNode); + + #[method(removeNamespaceForPrefix:)] + pub unsafe fn removeNamespaceForPrefix(&self, name: &NSString); + + #[method_id(@__retain_semantics Other namespaces)] + pub unsafe fn namespaces(&self) -> Option, Shared>>; + + #[method(setNamespaces:)] + pub unsafe fn setNamespaces(&self, namespaces: Option<&NSArray>); + + #[method_id(@__retain_semantics Other namespaceForPrefix:)] + pub unsafe fn namespaceForPrefix(&self, name: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other resolveNamespaceForName:)] + pub unsafe fn resolveNamespaceForName( + &self, + name: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other resolvePrefixForNamespaceURI:)] + pub unsafe fn resolvePrefixForNamespaceURI( + &self, + namespaceURI: &NSString, + ) -> Option>; + + #[method(insertChild:atIndex:)] + pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger); + + #[method(insertChildren:atIndex:)] + pub unsafe fn insertChildren_atIndex( + &self, + children: &NSArray, + index: NSUInteger, + ); + + #[method(removeChildAtIndex:)] + pub unsafe fn removeChildAtIndex(&self, index: NSUInteger); + + #[method(setChildren:)] + pub unsafe fn setChildren(&self, children: Option<&NSArray>); + + #[method(addChild:)] + pub unsafe fn addChild(&self, child: &NSXMLNode); + + #[method(replaceChildAtIndex:withNode:)] + pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode); + + #[method(normalizeAdjacentTextNodesPreservingCDATA:)] + pub unsafe fn normalizeAdjacentTextNodesPreservingCDATA(&self, preserve: bool); + } +); + +extern_methods!( + /// NSDeprecated + unsafe impl NSXMLElement { + #[method(setAttributesAsDictionary:)] + pub unsafe fn setAttributesAsDictionary(&self, attributes: &NSDictionary); + } +); diff --git a/crates/icrate/src/generated/Foundation/NSXMLNode.rs b/crates/icrate/src/generated/Foundation/NSXMLNode.rs new file mode 100644 index 000000000..c0c3d9d69 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSXMLNode.rs @@ -0,0 +1,234 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSXMLNodeKind { + NSXMLInvalidKind = 0, + NSXMLDocumentKind = 1, + NSXMLElementKind = 2, + NSXMLAttributeKind = 3, + NSXMLNamespaceKind = 4, + NSXMLProcessingInstructionKind = 5, + NSXMLCommentKind = 6, + NSXMLTextKind = 7, + NSXMLDTDKind = 8, + NSXMLEntityDeclarationKind = 9, + NSXMLAttributeDeclarationKind = 10, + NSXMLElementDeclarationKind = 11, + NSXMLNotationDeclarationKind = 12, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSXMLNode; + + unsafe impl ClassType for NSXMLNode { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSXMLNode { + #[method_id(@__retain_semantics Init init)] + pub unsafe fn init(this: Option>) -> Id; + + #[method_id(@__retain_semantics Init initWithKind:)] + pub unsafe fn initWithKind( + this: Option>, + kind: NSXMLNodeKind, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithKind:options:)] + pub unsafe fn initWithKind_options( + this: Option>, + kind: NSXMLNodeKind, + options: NSXMLNodeOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other document)] + pub unsafe fn document() -> Id; + + #[method_id(@__retain_semantics Other documentWithRootElement:)] + pub unsafe fn documentWithRootElement(element: &NSXMLElement) -> Id; + + #[method_id(@__retain_semantics Other elementWithName:)] + pub unsafe fn elementWithName(name: &NSString) -> Id; + + #[method_id(@__retain_semantics Other elementWithName:URI:)] + pub unsafe fn elementWithName_URI(name: &NSString, URI: &NSString) -> Id; + + #[method_id(@__retain_semantics Other elementWithName:stringValue:)] + pub unsafe fn elementWithName_stringValue( + name: &NSString, + string: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other elementWithName:children:attributes:)] + pub unsafe fn elementWithName_children_attributes( + name: &NSString, + children: Option<&NSArray>, + attributes: Option<&NSArray>, + ) -> Id; + + #[method_id(@__retain_semantics Other attributeWithName:stringValue:)] + pub unsafe fn attributeWithName_stringValue( + name: &NSString, + stringValue: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other attributeWithName:URI:stringValue:)] + pub unsafe fn attributeWithName_URI_stringValue( + name: &NSString, + URI: &NSString, + stringValue: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other namespaceWithName:stringValue:)] + pub unsafe fn namespaceWithName_stringValue( + name: &NSString, + stringValue: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other processingInstructionWithName:stringValue:)] + pub unsafe fn processingInstructionWithName_stringValue( + name: &NSString, + stringValue: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other commentWithStringValue:)] + pub unsafe fn commentWithStringValue(stringValue: &NSString) -> Id; + + #[method_id(@__retain_semantics Other textWithStringValue:)] + pub unsafe fn textWithStringValue(stringValue: &NSString) -> Id; + + #[method_id(@__retain_semantics Other DTDNodeWithXMLString:)] + pub unsafe fn DTDNodeWithXMLString(string: &NSString) -> Option>; + + #[method(kind)] + pub unsafe fn kind(&self) -> NSXMLNodeKind; + + #[method_id(@__retain_semantics Other name)] + pub unsafe fn name(&self) -> Option>; + + #[method(setName:)] + pub unsafe fn setName(&self, name: Option<&NSString>); + + #[method_id(@__retain_semantics Other objectValue)] + pub unsafe fn objectValue(&self) -> Option>; + + #[method(setObjectValue:)] + pub unsafe fn setObjectValue(&self, objectValue: Option<&Object>); + + #[method_id(@__retain_semantics Other stringValue)] + pub unsafe fn stringValue(&self) -> Option>; + + #[method(setStringValue:)] + pub unsafe fn setStringValue(&self, stringValue: Option<&NSString>); + + #[method(setStringValue:resolvingEntities:)] + pub unsafe fn setStringValue_resolvingEntities(&self, string: &NSString, resolve: bool); + + #[method(index)] + pub unsafe fn index(&self) -> NSUInteger; + + #[method(level)] + pub unsafe fn level(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other rootDocument)] + pub unsafe fn rootDocument(&self) -> Option>; + + #[method_id(@__retain_semantics Other parent)] + pub unsafe fn parent(&self) -> Option>; + + #[method(childCount)] + pub unsafe fn childCount(&self) -> NSUInteger; + + #[method_id(@__retain_semantics Other children)] + pub unsafe fn children(&self) -> Option, Shared>>; + + #[method_id(@__retain_semantics Other childAtIndex:)] + pub unsafe fn childAtIndex(&self, index: NSUInteger) -> Option>; + + #[method_id(@__retain_semantics Other previousSibling)] + pub unsafe fn previousSibling(&self) -> Option>; + + #[method_id(@__retain_semantics Other nextSibling)] + pub unsafe fn nextSibling(&self) -> Option>; + + #[method_id(@__retain_semantics Other previousNode)] + pub unsafe fn previousNode(&self) -> Option>; + + #[method_id(@__retain_semantics Other nextNode)] + pub unsafe fn nextNode(&self) -> Option>; + + #[method(detach)] + pub unsafe fn detach(&self); + + #[method_id(@__retain_semantics Other XPath)] + pub unsafe fn XPath(&self) -> Option>; + + #[method_id(@__retain_semantics Other localName)] + pub unsafe fn localName(&self) -> Option>; + + #[method_id(@__retain_semantics Other prefix)] + pub unsafe fn prefix(&self) -> Option>; + + #[method_id(@__retain_semantics Other URI)] + pub unsafe fn URI(&self) -> Option>; + + #[method(setURI:)] + pub unsafe fn setURI(&self, URI: Option<&NSString>); + + #[method_id(@__retain_semantics Other localNameForName:)] + pub unsafe fn localNameForName(name: &NSString) -> Id; + + #[method_id(@__retain_semantics Other prefixForName:)] + pub unsafe fn prefixForName(name: &NSString) -> Option>; + + #[method_id(@__retain_semantics Other predefinedNamespaceForPrefix:)] + pub unsafe fn predefinedNamespaceForPrefix( + name: &NSString, + ) -> Option>; + + #[method_id(@__retain_semantics Other description)] + pub unsafe fn description(&self) -> Id; + + #[method_id(@__retain_semantics Other XMLString)] + pub unsafe fn XMLString(&self) -> Id; + + #[method_id(@__retain_semantics Other XMLStringWithOptions:)] + pub unsafe fn XMLStringWithOptions( + &self, + options: NSXMLNodeOptions, + ) -> Id; + + #[method_id(@__retain_semantics Other canonicalXMLStringPreservingComments:)] + pub unsafe fn canonicalXMLStringPreservingComments( + &self, + comments: bool, + ) -> Id; + + #[method_id(@__retain_semantics Other nodesForXPath:error:)] + pub unsafe fn nodesForXPath_error( + &self, + xpath: &NSString, + ) -> Result, Shared>, Id>; + + #[method_id(@__retain_semantics Other objectsForXQuery:constants:error:)] + pub unsafe fn objectsForXQuery_constants_error( + &self, + xquery: &NSString, + constants: Option<&NSDictionary>, + ) -> Result, Id>; + + #[method_id(@__retain_semantics Other objectsForXQuery:error:)] + pub unsafe fn objectsForXQuery_error( + &self, + xquery: &NSString, + ) -> Result, Id>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSXMLNodeOptions.rs b/crates/icrate/src/generated/Foundation/NSXMLNodeOptions.rs new file mode 100644 index 000000000..d38456dd8 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSXMLNodeOptions.rs @@ -0,0 +1,48 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSXMLNodeOptions { + NSXMLNodeOptionsNone = 0, + NSXMLNodeIsCDATA = 1 << 0, + NSXMLNodeExpandEmptyElement = 1 << 1, + NSXMLNodeCompactEmptyElement = 1 << 2, + NSXMLNodeUseSingleQuotes = 1 << 3, + NSXMLNodeUseDoubleQuotes = 1 << 4, + NSXMLNodeNeverEscapeContents = 1 << 5, + NSXMLDocumentTidyHTML = 1 << 9, + NSXMLDocumentTidyXML = 1 << 10, + NSXMLDocumentValidate = 1 << 13, + NSXMLNodeLoadExternalEntitiesAlways = 1 << 14, + NSXMLNodeLoadExternalEntitiesSameOriginOnly = 1 << 15, + NSXMLNodeLoadExternalEntitiesNever = 1 << 19, + NSXMLDocumentXInclude = 1 << 16, + NSXMLNodePrettyPrint = 1 << 17, + NSXMLDocumentIncludeContentTypeDeclaration = 1 << 18, + NSXMLNodePreserveNamespaceOrder = 1 << 20, + NSXMLNodePreserveAttributeOrder = 1 << 21, + NSXMLNodePreserveEntities = 1 << 22, + NSXMLNodePreservePrefixes = 1 << 23, + NSXMLNodePreserveCDATA = 1 << 24, + NSXMLNodePreserveWhitespace = 1 << 25, + NSXMLNodePreserveDTD = 1 << 26, + NSXMLNodePreserveCharacterReferences = 1 << 27, + NSXMLNodePromoteSignificantWhitespace = 1 << 28, + NSXMLNodePreserveEmptyElements = NSXMLNodeExpandEmptyElement | NSXMLNodeCompactEmptyElement, + NSXMLNodePreserveQuotes = NSXMLNodeUseSingleQuotes | NSXMLNodeUseDoubleQuotes, + NSXMLNodePreserveAll = NSXMLNodePreserveNamespaceOrder + | NSXMLNodePreserveAttributeOrder + | NSXMLNodePreserveEntities + | NSXMLNodePreservePrefixes + | NSXMLNodePreserveCDATA + | NSXMLNodePreserveEmptyElements + | NSXMLNodePreserveQuotes + | NSXMLNodePreserveWhitespace + | NSXMLNodePreserveDTD + | NSXMLNodePreserveCharacterReferences + | 0xFFF00000, + } +); diff --git a/crates/icrate/src/generated/Foundation/NSXMLParser.rs b/crates/icrate/src/generated/Foundation/NSXMLParser.rs new file mode 100644 index 000000000..0b93134c2 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSXMLParser.rs @@ -0,0 +1,374 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +ns_enum!( + #[underlying(NSUInteger)] + pub enum NSXMLParserExternalEntityResolvingPolicy { + NSXMLParserResolveExternalEntitiesNever = 0, + NSXMLParserResolveExternalEntitiesNoNetwork = 1, + NSXMLParserResolveExternalEntitiesSameOriginOnly = 2, + NSXMLParserResolveExternalEntitiesAlways = 3, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSXMLParser; + + unsafe impl ClassType for NSXMLParser { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSXMLParser { + #[method_id(@__retain_semantics Init initWithContentsOfURL:)] + pub unsafe fn initWithContentsOfURL( + this: Option>, + url: &NSURL, + ) -> Option>; + + #[method_id(@__retain_semantics Init initWithData:)] + pub unsafe fn initWithData( + this: Option>, + data: &NSData, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithStream:)] + pub unsafe fn initWithStream( + this: Option>, + stream: &NSInputStream, + ) -> Id; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSXMLParserDelegate>); + + #[method(shouldProcessNamespaces)] + pub unsafe fn shouldProcessNamespaces(&self) -> bool; + + #[method(setShouldProcessNamespaces:)] + pub unsafe fn setShouldProcessNamespaces(&self, shouldProcessNamespaces: bool); + + #[method(shouldReportNamespacePrefixes)] + pub unsafe fn shouldReportNamespacePrefixes(&self) -> bool; + + #[method(setShouldReportNamespacePrefixes:)] + pub unsafe fn setShouldReportNamespacePrefixes(&self, shouldReportNamespacePrefixes: bool); + + #[method(externalEntityResolvingPolicy)] + pub unsafe fn externalEntityResolvingPolicy( + &self, + ) -> NSXMLParserExternalEntityResolvingPolicy; + + #[method(setExternalEntityResolvingPolicy:)] + pub unsafe fn setExternalEntityResolvingPolicy( + &self, + externalEntityResolvingPolicy: NSXMLParserExternalEntityResolvingPolicy, + ); + + #[method_id(@__retain_semantics Other allowedExternalEntityURLs)] + pub unsafe fn allowedExternalEntityURLs(&self) -> Option, Shared>>; + + #[method(setAllowedExternalEntityURLs:)] + pub unsafe fn setAllowedExternalEntityURLs( + &self, + allowedExternalEntityURLs: Option<&NSSet>, + ); + + #[method(parse)] + pub unsafe fn parse(&self) -> bool; + + #[method(abortParsing)] + pub unsafe fn abortParsing(&self); + + #[method_id(@__retain_semantics Other parserError)] + pub unsafe fn parserError(&self) -> Option>; + + #[method(shouldResolveExternalEntities)] + pub unsafe fn shouldResolveExternalEntities(&self) -> bool; + + #[method(setShouldResolveExternalEntities:)] + pub unsafe fn setShouldResolveExternalEntities(&self, shouldResolveExternalEntities: bool); + } +); + +extern_methods!( + /// NSXMLParserLocatorAdditions + unsafe impl NSXMLParser { + #[method_id(@__retain_semantics Other publicID)] + pub unsafe fn publicID(&self) -> Option>; + + #[method_id(@__retain_semantics Other systemID)] + pub unsafe fn systemID(&self) -> Option>; + + #[method(lineNumber)] + pub unsafe fn lineNumber(&self) -> NSInteger; + + #[method(columnNumber)] + pub unsafe fn columnNumber(&self) -> NSInteger; + } +); + +extern_protocol!( + pub struct NSXMLParserDelegate; + + unsafe impl NSXMLParserDelegate { + #[optional] + #[method(parserDidStartDocument:)] + pub unsafe fn parserDidStartDocument(&self, parser: &NSXMLParser); + + #[optional] + #[method(parserDidEndDocument:)] + pub unsafe fn parserDidEndDocument(&self, parser: &NSXMLParser); + + #[optional] + #[method(parser:foundNotationDeclarationWithName:publicID:systemID:)] + pub unsafe fn parser_foundNotationDeclarationWithName_publicID_systemID( + &self, + parser: &NSXMLParser, + name: &NSString, + publicID: Option<&NSString>, + systemID: Option<&NSString>, + ); + + #[optional] + #[method(parser:foundUnparsedEntityDeclarationWithName:publicID:systemID:notationName:)] + pub unsafe fn parser_foundUnparsedEntityDeclarationWithName_publicID_systemID_notationName( + &self, + parser: &NSXMLParser, + name: &NSString, + publicID: Option<&NSString>, + systemID: Option<&NSString>, + notationName: Option<&NSString>, + ); + + #[optional] + #[method(parser:foundAttributeDeclarationWithName:forElement:type:defaultValue:)] + pub unsafe fn parser_foundAttributeDeclarationWithName_forElement_type_defaultValue( + &self, + parser: &NSXMLParser, + attributeName: &NSString, + elementName: &NSString, + type_: Option<&NSString>, + defaultValue: Option<&NSString>, + ); + + #[optional] + #[method(parser:foundElementDeclarationWithName:model:)] + pub unsafe fn parser_foundElementDeclarationWithName_model( + &self, + parser: &NSXMLParser, + elementName: &NSString, + model: &NSString, + ); + + #[optional] + #[method(parser:foundInternalEntityDeclarationWithName:value:)] + pub unsafe fn parser_foundInternalEntityDeclarationWithName_value( + &self, + parser: &NSXMLParser, + name: &NSString, + value: Option<&NSString>, + ); + + #[optional] + #[method(parser:foundExternalEntityDeclarationWithName:publicID:systemID:)] + pub unsafe fn parser_foundExternalEntityDeclarationWithName_publicID_systemID( + &self, + parser: &NSXMLParser, + name: &NSString, + publicID: Option<&NSString>, + systemID: Option<&NSString>, + ); + + #[optional] + #[method(parser:didStartElement:namespaceURI:qualifiedName:attributes:)] + pub unsafe fn parser_didStartElement_namespaceURI_qualifiedName_attributes( + &self, + parser: &NSXMLParser, + elementName: &NSString, + namespaceURI: Option<&NSString>, + qName: Option<&NSString>, + attributeDict: &NSDictionary, + ); + + #[optional] + #[method(parser:didEndElement:namespaceURI:qualifiedName:)] + pub unsafe fn parser_didEndElement_namespaceURI_qualifiedName( + &self, + parser: &NSXMLParser, + elementName: &NSString, + namespaceURI: Option<&NSString>, + qName: Option<&NSString>, + ); + + #[optional] + #[method(parser:didStartMappingPrefix:toURI:)] + pub unsafe fn parser_didStartMappingPrefix_toURI( + &self, + parser: &NSXMLParser, + prefix: &NSString, + namespaceURI: &NSString, + ); + + #[optional] + #[method(parser:didEndMappingPrefix:)] + pub unsafe fn parser_didEndMappingPrefix(&self, parser: &NSXMLParser, prefix: &NSString); + + #[optional] + #[method(parser:foundCharacters:)] + pub unsafe fn parser_foundCharacters(&self, parser: &NSXMLParser, string: &NSString); + + #[optional] + #[method(parser:foundIgnorableWhitespace:)] + pub unsafe fn parser_foundIgnorableWhitespace( + &self, + parser: &NSXMLParser, + whitespaceString: &NSString, + ); + + #[optional] + #[method(parser:foundProcessingInstructionWithTarget:data:)] + pub unsafe fn parser_foundProcessingInstructionWithTarget_data( + &self, + parser: &NSXMLParser, + target: &NSString, + data: Option<&NSString>, + ); + + #[optional] + #[method(parser:foundComment:)] + pub unsafe fn parser_foundComment(&self, parser: &NSXMLParser, comment: &NSString); + + #[optional] + #[method(parser:foundCDATA:)] + pub unsafe fn parser_foundCDATA(&self, parser: &NSXMLParser, CDATABlock: &NSData); + + #[optional] + #[method_id(@__retain_semantics Other parser:resolveExternalEntityName:systemID:)] + pub unsafe fn parser_resolveExternalEntityName_systemID( + &self, + parser: &NSXMLParser, + name: &NSString, + systemID: Option<&NSString>, + ) -> Option>; + + #[optional] + #[method(parser:parseErrorOccurred:)] + pub unsafe fn parser_parseErrorOccurred(&self, parser: &NSXMLParser, parseError: &NSError); + + #[optional] + #[method(parser:validationErrorOccurred:)] + pub unsafe fn parser_validationErrorOccurred( + &self, + parser: &NSXMLParser, + validationError: &NSError, + ); + } +); + +extern_static!(NSXMLParserErrorDomain: &'static NSErrorDomain); + +ns_enum!( + #[underlying(NSInteger)] + pub enum NSXMLParserError { + NSXMLParserInternalError = 1, + NSXMLParserOutOfMemoryError = 2, + NSXMLParserDocumentStartError = 3, + NSXMLParserEmptyDocumentError = 4, + NSXMLParserPrematureDocumentEndError = 5, + NSXMLParserInvalidHexCharacterRefError = 6, + NSXMLParserInvalidDecimalCharacterRefError = 7, + NSXMLParserInvalidCharacterRefError = 8, + NSXMLParserInvalidCharacterError = 9, + NSXMLParserCharacterRefAtEOFError = 10, + NSXMLParserCharacterRefInPrologError = 11, + NSXMLParserCharacterRefInEpilogError = 12, + NSXMLParserCharacterRefInDTDError = 13, + NSXMLParserEntityRefAtEOFError = 14, + NSXMLParserEntityRefInPrologError = 15, + NSXMLParserEntityRefInEpilogError = 16, + NSXMLParserEntityRefInDTDError = 17, + NSXMLParserParsedEntityRefAtEOFError = 18, + NSXMLParserParsedEntityRefInPrologError = 19, + NSXMLParserParsedEntityRefInEpilogError = 20, + NSXMLParserParsedEntityRefInInternalSubsetError = 21, + NSXMLParserEntityReferenceWithoutNameError = 22, + NSXMLParserEntityReferenceMissingSemiError = 23, + NSXMLParserParsedEntityRefNoNameError = 24, + NSXMLParserParsedEntityRefMissingSemiError = 25, + NSXMLParserUndeclaredEntityError = 26, + NSXMLParserUnparsedEntityError = 28, + NSXMLParserEntityIsExternalError = 29, + NSXMLParserEntityIsParameterError = 30, + NSXMLParserUnknownEncodingError = 31, + NSXMLParserEncodingNotSupportedError = 32, + NSXMLParserStringNotStartedError = 33, + NSXMLParserStringNotClosedError = 34, + NSXMLParserNamespaceDeclarationError = 35, + NSXMLParserEntityNotStartedError = 36, + NSXMLParserEntityNotFinishedError = 37, + NSXMLParserLessThanSymbolInAttributeError = 38, + NSXMLParserAttributeNotStartedError = 39, + NSXMLParserAttributeNotFinishedError = 40, + NSXMLParserAttributeHasNoValueError = 41, + NSXMLParserAttributeRedefinedError = 42, + NSXMLParserLiteralNotStartedError = 43, + NSXMLParserLiteralNotFinishedError = 44, + NSXMLParserCommentNotFinishedError = 45, + NSXMLParserProcessingInstructionNotStartedError = 46, + NSXMLParserProcessingInstructionNotFinishedError = 47, + NSXMLParserNotationNotStartedError = 48, + NSXMLParserNotationNotFinishedError = 49, + NSXMLParserAttributeListNotStartedError = 50, + NSXMLParserAttributeListNotFinishedError = 51, + NSXMLParserMixedContentDeclNotStartedError = 52, + NSXMLParserMixedContentDeclNotFinishedError = 53, + NSXMLParserElementContentDeclNotStartedError = 54, + NSXMLParserElementContentDeclNotFinishedError = 55, + NSXMLParserXMLDeclNotStartedError = 56, + NSXMLParserXMLDeclNotFinishedError = 57, + NSXMLParserConditionalSectionNotStartedError = 58, + NSXMLParserConditionalSectionNotFinishedError = 59, + NSXMLParserExternalSubsetNotFinishedError = 60, + NSXMLParserDOCTYPEDeclNotFinishedError = 61, + NSXMLParserMisplacedCDATAEndStringError = 62, + NSXMLParserCDATANotFinishedError = 63, + NSXMLParserMisplacedXMLDeclarationError = 64, + NSXMLParserSpaceRequiredError = 65, + NSXMLParserSeparatorRequiredError = 66, + NSXMLParserNMTOKENRequiredError = 67, + NSXMLParserNAMERequiredError = 68, + NSXMLParserPCDATARequiredError = 69, + NSXMLParserURIRequiredError = 70, + NSXMLParserPublicIdentifierRequiredError = 71, + NSXMLParserLTRequiredError = 72, + NSXMLParserGTRequiredError = 73, + NSXMLParserLTSlashRequiredError = 74, + NSXMLParserEqualExpectedError = 75, + NSXMLParserTagNameMismatchError = 76, + NSXMLParserUnfinishedTagError = 77, + NSXMLParserStandaloneValueError = 78, + NSXMLParserInvalidEncodingNameError = 79, + NSXMLParserCommentContainsDoubleHyphenError = 80, + NSXMLParserInvalidEncodingError = 81, + NSXMLParserExternalStandaloneEntityError = 82, + NSXMLParserInvalidConditionalSectionError = 83, + NSXMLParserEntityValueRequiredError = 84, + NSXMLParserNotWellBalancedError = 85, + NSXMLParserExtraContentError = 86, + NSXMLParserInvalidCharacterInEntityError = 87, + NSXMLParserParsedEntityRefInInternalError = 88, + NSXMLParserEntityRefLoopError = 89, + NSXMLParserEntityBoundaryError = 90, + NSXMLParserInvalidURIError = 91, + NSXMLParserURIFragmentError = 92, + NSXMLParserNoDTDError = 94, + NSXMLParserDelegateAbortedParseError = 512, + } +); diff --git a/crates/icrate/src/generated/Foundation/NSXPCConnection.rs b/crates/icrate/src/generated/Foundation/NSXPCConnection.rs new file mode 100644 index 000000000..6e8fd9f9b --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSXPCConnection.rs @@ -0,0 +1,282 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_protocol!( + pub struct NSXPCProxyCreating; + + unsafe impl NSXPCProxyCreating { + #[method_id(@__retain_semantics Other remoteObjectProxy)] + pub unsafe fn remoteObjectProxy(&self) -> Id; + + #[method_id(@__retain_semantics Other remoteObjectProxyWithErrorHandler:)] + pub unsafe fn remoteObjectProxyWithErrorHandler( + &self, + handler: &Block<(NonNull,), ()>, + ) -> Id; + + #[optional] + #[method_id(@__retain_semantics Other synchronousRemoteObjectProxyWithErrorHandler:)] + pub unsafe fn synchronousRemoteObjectProxyWithErrorHandler( + &self, + handler: &Block<(NonNull,), ()>, + ) -> Id; + } +); + +ns_options!( + #[underlying(NSUInteger)] + pub enum NSXPCConnectionOptions { + NSXPCConnectionPrivileged = 1 << 12, + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSXPCConnection; + + unsafe impl ClassType for NSXPCConnection { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSXPCConnection { + #[method_id(@__retain_semantics Init initWithServiceName:)] + pub unsafe fn initWithServiceName( + this: Option>, + serviceName: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other serviceName)] + pub unsafe fn serviceName(&self) -> Option>; + + #[method_id(@__retain_semantics Init initWithMachServiceName:options:)] + pub unsafe fn initWithMachServiceName_options( + this: Option>, + name: &NSString, + options: NSXPCConnectionOptions, + ) -> Id; + + #[method_id(@__retain_semantics Init initWithListenerEndpoint:)] + pub unsafe fn initWithListenerEndpoint( + this: Option>, + endpoint: &NSXPCListenerEndpoint, + ) -> Id; + + #[method_id(@__retain_semantics Other endpoint)] + pub unsafe fn endpoint(&self) -> Id; + + #[method_id(@__retain_semantics Other exportedInterface)] + pub unsafe fn exportedInterface(&self) -> Option>; + + #[method(setExportedInterface:)] + pub unsafe fn setExportedInterface(&self, exportedInterface: Option<&NSXPCInterface>); + + #[method_id(@__retain_semantics Other exportedObject)] + pub unsafe fn exportedObject(&self) -> Option>; + + #[method(setExportedObject:)] + pub unsafe fn setExportedObject(&self, exportedObject: Option<&Object>); + + #[method_id(@__retain_semantics Other remoteObjectInterface)] + pub unsafe fn remoteObjectInterface(&self) -> Option>; + + #[method(setRemoteObjectInterface:)] + pub unsafe fn setRemoteObjectInterface( + &self, + remoteObjectInterface: Option<&NSXPCInterface>, + ); + + #[method_id(@__retain_semantics Other remoteObjectProxy)] + pub unsafe fn remoteObjectProxy(&self) -> Id; + + #[method_id(@__retain_semantics Other remoteObjectProxyWithErrorHandler:)] + pub unsafe fn remoteObjectProxyWithErrorHandler( + &self, + handler: &Block<(NonNull,), ()>, + ) -> Id; + + #[method_id(@__retain_semantics Other synchronousRemoteObjectProxyWithErrorHandler:)] + pub unsafe fn synchronousRemoteObjectProxyWithErrorHandler( + &self, + handler: &Block<(NonNull,), ()>, + ) -> Id; + + #[method(interruptionHandler)] + pub unsafe fn interruptionHandler(&self) -> *mut Block<(), ()>; + + #[method(setInterruptionHandler:)] + pub unsafe fn setInterruptionHandler(&self, interruptionHandler: Option<&Block<(), ()>>); + + #[method(invalidationHandler)] + pub unsafe fn invalidationHandler(&self) -> *mut Block<(), ()>; + + #[method(setInvalidationHandler:)] + pub unsafe fn setInvalidationHandler(&self, invalidationHandler: Option<&Block<(), ()>>); + + #[method(resume)] + pub unsafe fn resume(&self); + + #[method(suspend)] + pub unsafe fn suspend(&self); + + #[method(invalidate)] + pub unsafe fn invalidate(&self); + + #[method_id(@__retain_semantics Other currentConnection)] + pub unsafe fn currentConnection() -> Option>; + + #[method(scheduleSendBarrierBlock:)] + pub unsafe fn scheduleSendBarrierBlock(&self, block: &Block<(), ()>); + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSXPCListener; + + unsafe impl ClassType for NSXPCListener { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSXPCListener { + #[method_id(@__retain_semantics Other serviceListener)] + pub unsafe fn serviceListener() -> Id; + + #[method_id(@__retain_semantics Other anonymousListener)] + pub unsafe fn anonymousListener() -> Id; + + #[method_id(@__retain_semantics Init initWithMachServiceName:)] + pub unsafe fn initWithMachServiceName( + this: Option>, + name: &NSString, + ) -> Id; + + #[method_id(@__retain_semantics Other delegate)] + pub unsafe fn delegate(&self) -> Option>; + + #[method(setDelegate:)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSXPCListenerDelegate>); + + #[method_id(@__retain_semantics Other endpoint)] + pub unsafe fn endpoint(&self) -> Id; + + #[method(resume)] + pub unsafe fn resume(&self); + + #[method(suspend)] + pub unsafe fn suspend(&self); + + #[method(invalidate)] + pub unsafe fn invalidate(&self); + } +); + +extern_protocol!( + pub struct NSXPCListenerDelegate; + + unsafe impl NSXPCListenerDelegate { + #[optional] + #[method(listener:shouldAcceptNewConnection:)] + pub unsafe fn listener_shouldAcceptNewConnection( + &self, + listener: &NSXPCListener, + newConnection: &NSXPCConnection, + ) -> bool; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSXPCInterface; + + unsafe impl ClassType for NSXPCInterface { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSXPCInterface { + #[method_id(@__retain_semantics Other interfaceWithProtocol:)] + pub unsafe fn interfaceWithProtocol(protocol: &Protocol) -> Id; + + #[method_id(@__retain_semantics Other protocol)] + pub unsafe fn protocol(&self) -> Id; + + #[method(setProtocol:)] + pub unsafe fn setProtocol(&self, protocol: &Protocol); + + #[method(setClasses:forSelector:argumentIndex:ofReply:)] + pub unsafe fn setClasses_forSelector_argumentIndex_ofReply( + &self, + classes: &NSSet, + sel: Sel, + arg: NSUInteger, + ofReply: bool, + ); + + #[method_id(@__retain_semantics Other classesForSelector:argumentIndex:ofReply:)] + pub unsafe fn classesForSelector_argumentIndex_ofReply( + &self, + sel: Sel, + arg: NSUInteger, + ofReply: bool, + ) -> Id, Shared>; + + #[method(setInterface:forSelector:argumentIndex:ofReply:)] + pub unsafe fn setInterface_forSelector_argumentIndex_ofReply( + &self, + ifc: &NSXPCInterface, + sel: Sel, + arg: NSUInteger, + ofReply: bool, + ); + + #[method_id(@__retain_semantics Other interfaceForSelector:argumentIndex:ofReply:)] + pub unsafe fn interfaceForSelector_argumentIndex_ofReply( + &self, + sel: Sel, + arg: NSUInteger, + ofReply: bool, + ) -> Option>; + } +); + +extern_class!( + #[derive(Debug)] + pub struct NSXPCListenerEndpoint; + + unsafe impl ClassType for NSXPCListenerEndpoint { + type Super = NSObject; + } +); + +extern_methods!( + unsafe impl NSXPCListenerEndpoint {} +); + +extern_class!( + #[derive(Debug)] + pub struct NSXPCCoder; + + unsafe impl ClassType for NSXPCCoder { + type Super = NSCoder; + } +); + +extern_methods!( + unsafe impl NSXPCCoder { + #[method_id(@__retain_semantics Other userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + + #[method(setUserInfo:)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSObject>); + + #[method_id(@__retain_semantics Other connection)] + pub unsafe fn connection(&self) -> Option>; + } +); diff --git a/crates/icrate/src/generated/Foundation/NSZone.rs b/crates/icrate/src/generated/Foundation/NSZone.rs new file mode 100644 index 000000000..c63eee97f --- /dev/null +++ b/crates/icrate/src/generated/Foundation/NSZone.rs @@ -0,0 +1,124 @@ +//! This file has been automatically generated by `objc2`'s `header-translator`. +//! DO NOT EDIT +use crate::common::*; +use crate::Foundation::*; + +extern_fn!( + pub unsafe fn NSDefaultMallocZone() -> NonNull; +); + +extern_fn!( + pub unsafe fn NSCreateZone( + startSize: NSUInteger, + granularity: NSUInteger, + canFree: Bool, + ) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSRecycleZone(zone: NonNull); +); + +extern_fn!( + pub unsafe fn NSSetZoneName(zone: *mut NSZone, name: &NSString); +); + +extern_fn!( + pub unsafe fn NSZoneName(zone: *mut NSZone) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSZoneFromPointer(ptr: NonNull) -> *mut NSZone; +); + +extern_fn!( + pub unsafe fn NSZoneMalloc(zone: *mut NSZone, size: NSUInteger) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSZoneCalloc( + zone: *mut NSZone, + numElems: NSUInteger, + byteSize: NSUInteger, + ) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSZoneRealloc( + zone: *mut NSZone, + ptr: *mut c_void, + size: NSUInteger, + ) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSZoneFree(zone: *mut NSZone, ptr: NonNull); +); + +ns_enum!( + #[underlying(NSUInteger)] + pub enum { + NSScannedOption = 1<<0, + NSCollectorDisabledOption = 1<<1, + } +); + +extern_fn!( + pub unsafe fn NSAllocateCollectable(size: NSUInteger, options: NSUInteger) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSReallocateCollectable( + ptr: *mut c_void, + size: NSUInteger, + options: NSUInteger, + ) -> NonNull; +); + +inline_fn!( + pub unsafe fn NSMakeCollectable(cf: CFTypeRef) -> *mut Object { + todo!() + } +); + +inline_fn!( + pub unsafe fn NSMakeCollectable(cf: CFTypeRef) -> *mut Object { + todo!() + } +); + +extern_fn!( + pub unsafe fn NSPageSize() -> NSUInteger; +); + +extern_fn!( + pub unsafe fn NSLogPageSize() -> NSUInteger; +); + +extern_fn!( + pub unsafe fn NSRoundUpToMultipleOfPageSize(bytes: NSUInteger) -> NSUInteger; +); + +extern_fn!( + pub unsafe fn NSRoundDownToMultipleOfPageSize(bytes: NSUInteger) -> NSUInteger; +); + +extern_fn!( + pub unsafe fn NSAllocateMemoryPages(bytes: NSUInteger) -> NonNull; +); + +extern_fn!( + pub unsafe fn NSDeallocateMemoryPages(ptr: NonNull, bytes: NSUInteger); +); + +extern_fn!( + pub unsafe fn NSCopyMemoryPages( + source: NonNull, + dest: NonNull, + bytes: NSUInteger, + ); +); + +extern_fn!( + pub unsafe fn NSRealMemoryAvailable() -> NSUInteger; +); diff --git a/crates/icrate/src/generated/Foundation/mod.rs b/crates/icrate/src/generated/Foundation/mod.rs new file mode 100644 index 000000000..983dde972 --- /dev/null +++ b/crates/icrate/src/generated/Foundation/mod.rs @@ -0,0 +1,1560 @@ +#[path = "FoundationErrors.rs"] +mod __FoundationErrors; +#[path = "FoundationLegacySwiftCompatibility.rs"] +mod __FoundationLegacySwiftCompatibility; +#[path = "NSAffineTransform.rs"] +mod __NSAffineTransform; +#[path = "NSAppleEventDescriptor.rs"] +mod __NSAppleEventDescriptor; +#[path = "NSAppleEventManager.rs"] +mod __NSAppleEventManager; +#[path = "NSAppleScript.rs"] +mod __NSAppleScript; +#[path = "NSArchiver.rs"] +mod __NSArchiver; +#[path = "NSArray.rs"] +mod __NSArray; +#[path = "NSAttributedString.rs"] +mod __NSAttributedString; +#[path = "NSAutoreleasePool.rs"] +mod __NSAutoreleasePool; +#[path = "NSBackgroundActivityScheduler.rs"] +mod __NSBackgroundActivityScheduler; +#[path = "NSBundle.rs"] +mod __NSBundle; +#[path = "NSByteCountFormatter.rs"] +mod __NSByteCountFormatter; +#[path = "NSByteOrder.rs"] +mod __NSByteOrder; +#[path = "NSCache.rs"] +mod __NSCache; +#[path = "NSCalendar.rs"] +mod __NSCalendar; +#[path = "NSCalendarDate.rs"] +mod __NSCalendarDate; +#[path = "NSCharacterSet.rs"] +mod __NSCharacterSet; +#[path = "NSClassDescription.rs"] +mod __NSClassDescription; +#[path = "NSCoder.rs"] +mod __NSCoder; +#[path = "NSComparisonPredicate.rs"] +mod __NSComparisonPredicate; +#[path = "NSCompoundPredicate.rs"] +mod __NSCompoundPredicate; +#[path = "NSConnection.rs"] +mod __NSConnection; +#[path = "NSData.rs"] +mod __NSData; +#[path = "NSDate.rs"] +mod __NSDate; +#[path = "NSDateComponentsFormatter.rs"] +mod __NSDateComponentsFormatter; +#[path = "NSDateFormatter.rs"] +mod __NSDateFormatter; +#[path = "NSDateInterval.rs"] +mod __NSDateInterval; +#[path = "NSDateIntervalFormatter.rs"] +mod __NSDateIntervalFormatter; +#[path = "NSDecimal.rs"] +mod __NSDecimal; +#[path = "NSDecimalNumber.rs"] +mod __NSDecimalNumber; +#[path = "NSDictionary.rs"] +mod __NSDictionary; +#[path = "NSDistantObject.rs"] +mod __NSDistantObject; +#[path = "NSDistributedLock.rs"] +mod __NSDistributedLock; +#[path = "NSDistributedNotificationCenter.rs"] +mod __NSDistributedNotificationCenter; +#[path = "NSEnergyFormatter.rs"] +mod __NSEnergyFormatter; +#[path = "NSEnumerator.rs"] +mod __NSEnumerator; +#[path = "NSError.rs"] +mod __NSError; +#[path = "NSException.rs"] +mod __NSException; +#[path = "NSExpression.rs"] +mod __NSExpression; +#[path = "NSExtensionContext.rs"] +mod __NSExtensionContext; +#[path = "NSExtensionItem.rs"] +mod __NSExtensionItem; +#[path = "NSExtensionRequestHandling.rs"] +mod __NSExtensionRequestHandling; +#[path = "NSFileCoordinator.rs"] +mod __NSFileCoordinator; +#[path = "NSFileHandle.rs"] +mod __NSFileHandle; +#[path = "NSFileManager.rs"] +mod __NSFileManager; +#[path = "NSFilePresenter.rs"] +mod __NSFilePresenter; +#[path = "NSFileVersion.rs"] +mod __NSFileVersion; +#[path = "NSFileWrapper.rs"] +mod __NSFileWrapper; +#[path = "NSFormatter.rs"] +mod __NSFormatter; +#[path = "NSGarbageCollector.rs"] +mod __NSGarbageCollector; +#[path = "NSGeometry.rs"] +mod __NSGeometry; +#[path = "NSHFSFileTypes.rs"] +mod __NSHFSFileTypes; +#[path = "NSHTTPCookie.rs"] +mod __NSHTTPCookie; +#[path = "NSHTTPCookieStorage.rs"] +mod __NSHTTPCookieStorage; +#[path = "NSHashTable.rs"] +mod __NSHashTable; +#[path = "NSHost.rs"] +mod __NSHost; +#[path = "NSISO8601DateFormatter.rs"] +mod __NSISO8601DateFormatter; +#[path = "NSIndexPath.rs"] +mod __NSIndexPath; +#[path = "NSIndexSet.rs"] +mod __NSIndexSet; +#[path = "NSInflectionRule.rs"] +mod __NSInflectionRule; +#[path = "NSInvocation.rs"] +mod __NSInvocation; +#[path = "NSItemProvider.rs"] +mod __NSItemProvider; +#[path = "NSJSONSerialization.rs"] +mod __NSJSONSerialization; +#[path = "NSKeyValueCoding.rs"] +mod __NSKeyValueCoding; +#[path = "NSKeyValueObserving.rs"] +mod __NSKeyValueObserving; +#[path = "NSKeyedArchiver.rs"] +mod __NSKeyedArchiver; +#[path = "NSLengthFormatter.rs"] +mod __NSLengthFormatter; +#[path = "NSLinguisticTagger.rs"] +mod __NSLinguisticTagger; +#[path = "NSListFormatter.rs"] +mod __NSListFormatter; +#[path = "NSLocale.rs"] +mod __NSLocale; +#[path = "NSLock.rs"] +mod __NSLock; +#[path = "NSMapTable.rs"] +mod __NSMapTable; +#[path = "NSMassFormatter.rs"] +mod __NSMassFormatter; +#[path = "NSMeasurement.rs"] +mod __NSMeasurement; +#[path = "NSMeasurementFormatter.rs"] +mod __NSMeasurementFormatter; +#[path = "NSMetadata.rs"] +mod __NSMetadata; +#[path = "NSMetadataAttributes.rs"] +mod __NSMetadataAttributes; +#[path = "NSMethodSignature.rs"] +mod __NSMethodSignature; +#[path = "NSMorphology.rs"] +mod __NSMorphology; +#[path = "NSNetServices.rs"] +mod __NSNetServices; +#[path = "NSNotification.rs"] +mod __NSNotification; +#[path = "NSNotificationQueue.rs"] +mod __NSNotificationQueue; +#[path = "NSNull.rs"] +mod __NSNull; +#[path = "NSNumberFormatter.rs"] +mod __NSNumberFormatter; +#[path = "NSObjCRuntime.rs"] +mod __NSObjCRuntime; +#[path = "NSObject.rs"] +mod __NSObject; +#[path = "NSObjectScripting.rs"] +mod __NSObjectScripting; +#[path = "NSOperation.rs"] +mod __NSOperation; +#[path = "NSOrderedCollectionChange.rs"] +mod __NSOrderedCollectionChange; +#[path = "NSOrderedCollectionDifference.rs"] +mod __NSOrderedCollectionDifference; +#[path = "NSOrderedSet.rs"] +mod __NSOrderedSet; +#[path = "NSOrthography.rs"] +mod __NSOrthography; +#[path = "NSPathUtilities.rs"] +mod __NSPathUtilities; +#[path = "NSPersonNameComponents.rs"] +mod __NSPersonNameComponents; +#[path = "NSPersonNameComponentsFormatter.rs"] +mod __NSPersonNameComponentsFormatter; +#[path = "NSPointerArray.rs"] +mod __NSPointerArray; +#[path = "NSPointerFunctions.rs"] +mod __NSPointerFunctions; +#[path = "NSPort.rs"] +mod __NSPort; +#[path = "NSPortCoder.rs"] +mod __NSPortCoder; +#[path = "NSPortMessage.rs"] +mod __NSPortMessage; +#[path = "NSPortNameServer.rs"] +mod __NSPortNameServer; +#[path = "NSPredicate.rs"] +mod __NSPredicate; +#[path = "NSProcessInfo.rs"] +mod __NSProcessInfo; +#[path = "NSProgress.rs"] +mod __NSProgress; +#[path = "NSPropertyList.rs"] +mod __NSPropertyList; +#[path = "NSProtocolChecker.rs"] +mod __NSProtocolChecker; +#[path = "NSProxy.rs"] +mod __NSProxy; +#[path = "NSRange.rs"] +mod __NSRange; +#[path = "NSRegularExpression.rs"] +mod __NSRegularExpression; +#[path = "NSRelativeDateTimeFormatter.rs"] +mod __NSRelativeDateTimeFormatter; +#[path = "NSRunLoop.rs"] +mod __NSRunLoop; +#[path = "NSScanner.rs"] +mod __NSScanner; +#[path = "NSScriptClassDescription.rs"] +mod __NSScriptClassDescription; +#[path = "NSScriptCoercionHandler.rs"] +mod __NSScriptCoercionHandler; +#[path = "NSScriptCommand.rs"] +mod __NSScriptCommand; +#[path = "NSScriptCommandDescription.rs"] +mod __NSScriptCommandDescription; +#[path = "NSScriptExecutionContext.rs"] +mod __NSScriptExecutionContext; +#[path = "NSScriptKeyValueCoding.rs"] +mod __NSScriptKeyValueCoding; +#[path = "NSScriptObjectSpecifiers.rs"] +mod __NSScriptObjectSpecifiers; +#[path = "NSScriptStandardSuiteCommands.rs"] +mod __NSScriptStandardSuiteCommands; +#[path = "NSScriptSuiteRegistry.rs"] +mod __NSScriptSuiteRegistry; +#[path = "NSScriptWhoseTests.rs"] +mod __NSScriptWhoseTests; +#[path = "NSSet.rs"] +mod __NSSet; +#[path = "NSSortDescriptor.rs"] +mod __NSSortDescriptor; +#[path = "NSSpellServer.rs"] +mod __NSSpellServer; +#[path = "NSStream.rs"] +mod __NSStream; +#[path = "NSString.rs"] +mod __NSString; +#[path = "NSTask.rs"] +mod __NSTask; +#[path = "NSTextCheckingResult.rs"] +mod __NSTextCheckingResult; +#[path = "NSThread.rs"] +mod __NSThread; +#[path = "NSTimeZone.rs"] +mod __NSTimeZone; +#[path = "NSTimer.rs"] +mod __NSTimer; +#[path = "NSURL.rs"] +mod __NSURL; +#[path = "NSURLAuthenticationChallenge.rs"] +mod __NSURLAuthenticationChallenge; +#[path = "NSURLCache.rs"] +mod __NSURLCache; +#[path = "NSURLConnection.rs"] +mod __NSURLConnection; +#[path = "NSURLCredential.rs"] +mod __NSURLCredential; +#[path = "NSURLCredentialStorage.rs"] +mod __NSURLCredentialStorage; +#[path = "NSURLDownload.rs"] +mod __NSURLDownload; +#[path = "NSURLError.rs"] +mod __NSURLError; +#[path = "NSURLHandle.rs"] +mod __NSURLHandle; +#[path = "NSURLProtectionSpace.rs"] +mod __NSURLProtectionSpace; +#[path = "NSURLProtocol.rs"] +mod __NSURLProtocol; +#[path = "NSURLRequest.rs"] +mod __NSURLRequest; +#[path = "NSURLResponse.rs"] +mod __NSURLResponse; +#[path = "NSURLSession.rs"] +mod __NSURLSession; +#[path = "NSUUID.rs"] +mod __NSUUID; +#[path = "NSUbiquitousKeyValueStore.rs"] +mod __NSUbiquitousKeyValueStore; +#[path = "NSUndoManager.rs"] +mod __NSUndoManager; +#[path = "NSUnit.rs"] +mod __NSUnit; +#[path = "NSUserActivity.rs"] +mod __NSUserActivity; +#[path = "NSUserDefaults.rs"] +mod __NSUserDefaults; +#[path = "NSUserNotification.rs"] +mod __NSUserNotification; +#[path = "NSUserScriptTask.rs"] +mod __NSUserScriptTask; +#[path = "NSValue.rs"] +mod __NSValue; +#[path = "NSValueTransformer.rs"] +mod __NSValueTransformer; +#[path = "NSXMLDTD.rs"] +mod __NSXMLDTD; +#[path = "NSXMLDTDNode.rs"] +mod __NSXMLDTDNode; +#[path = "NSXMLDocument.rs"] +mod __NSXMLDocument; +#[path = "NSXMLElement.rs"] +mod __NSXMLElement; +#[path = "NSXMLNode.rs"] +mod __NSXMLNode; +#[path = "NSXMLNodeOptions.rs"] +mod __NSXMLNodeOptions; +#[path = "NSXMLParser.rs"] +mod __NSXMLParser; +#[path = "NSXPCConnection.rs"] +mod __NSXPCConnection; +#[path = "NSZone.rs"] +mod __NSZone; + +pub use self::__FoundationErrors::{ + NSBundleErrorMaximum, NSBundleErrorMinimum, NSBundleOnDemandResourceExceededMaximumSizeError, + NSBundleOnDemandResourceInvalidTagError, NSBundleOnDemandResourceOutOfSpaceError, + NSCloudSharingConflictError, NSCloudSharingErrorMaximum, NSCloudSharingErrorMinimum, + NSCloudSharingNetworkFailureError, NSCloudSharingNoPermissionError, NSCloudSharingOtherError, + NSCloudSharingQuotaExceededError, NSCloudSharingTooManyParticipantsError, NSCoderErrorMaximum, + NSCoderErrorMinimum, NSCoderInvalidValueError, NSCoderReadCorruptError, + NSCoderValueNotFoundError, NSCompressionErrorMaximum, NSCompressionErrorMinimum, + NSCompressionFailedError, NSDecompressionFailedError, NSExecutableArchitectureMismatchError, + NSExecutableErrorMaximum, NSExecutableErrorMinimum, NSExecutableLinkError, + NSExecutableLoadError, NSExecutableNotLoadableError, NSExecutableRuntimeMismatchError, + NSFeatureUnsupportedError, NSFileErrorMaximum, NSFileErrorMinimum, NSFileLockingError, + NSFileManagerUnmountBusyError, NSFileManagerUnmountUnknownError, NSFileNoSuchFileError, + NSFileReadCorruptFileError, NSFileReadInapplicableStringEncodingError, + NSFileReadInvalidFileNameError, NSFileReadNoPermissionError, NSFileReadNoSuchFileError, + NSFileReadTooLargeError, NSFileReadUnknownError, NSFileReadUnknownStringEncodingError, + NSFileReadUnsupportedSchemeError, NSFileWriteFileExistsError, + NSFileWriteInapplicableStringEncodingError, NSFileWriteInvalidFileNameError, + NSFileWriteNoPermissionError, NSFileWriteOutOfSpaceError, NSFileWriteUnknownError, + NSFileWriteUnsupportedSchemeError, NSFileWriteVolumeReadOnlyError, NSFormattingError, + NSFormattingErrorMaximum, NSFormattingErrorMinimum, NSKeyValueValidationError, + NSPropertyListErrorMaximum, NSPropertyListErrorMinimum, NSPropertyListReadCorruptError, + NSPropertyListReadStreamError, NSPropertyListReadUnknownVersionError, + NSPropertyListWriteInvalidError, NSPropertyListWriteStreamError, NSUbiquitousFileErrorMaximum, + NSUbiquitousFileErrorMinimum, NSUbiquitousFileNotUploadedDueToQuotaError, + NSUbiquitousFileUbiquityServerNotAvailable, NSUbiquitousFileUnavailableError, + NSUserActivityConnectionUnavailableError, NSUserActivityErrorMaximum, + NSUserActivityErrorMinimum, NSUserActivityHandoffFailedError, + NSUserActivityHandoffUserInfoTooLargeError, NSUserActivityRemoteApplicationTimedOutError, + NSUserCancelledError, NSValidationErrorMaximum, NSValidationErrorMinimum, + NSXPCConnectionErrorMaximum, NSXPCConnectionErrorMinimum, NSXPCConnectionInterrupted, + NSXPCConnectionInvalid, NSXPCConnectionReplyInvalid, +}; +pub use self::__NSAffineTransform::{NSAffineTransform, NSAffineTransformStruct}; +pub use self::__NSAppleEventDescriptor::{ + NSAppleEventDescriptor, NSAppleEventSendAlwaysInteract, NSAppleEventSendCanInteract, + NSAppleEventSendCanSwitchLayer, NSAppleEventSendDefaultOptions, NSAppleEventSendDontAnnotate, + NSAppleEventSendDontExecute, NSAppleEventSendDontRecord, NSAppleEventSendNeverInteract, + NSAppleEventSendNoReply, NSAppleEventSendOptions, NSAppleEventSendQueueReply, + NSAppleEventSendWaitForReply, +}; +pub use self::__NSAppleEventManager::{ + NSAppleEventManager, NSAppleEventManagerSuspensionID, + NSAppleEventManagerWillProcessFirstEventNotification, NSAppleEventTimeOutDefault, + NSAppleEventTimeOutNone, +}; +pub use self::__NSAppleScript::{ + NSAppleScript, NSAppleScriptErrorAppName, NSAppleScriptErrorBriefMessage, + NSAppleScriptErrorMessage, NSAppleScriptErrorNumber, NSAppleScriptErrorRange, +}; +pub use self::__NSArchiver::{NSArchiver, NSUnarchiver}; +pub use self::__NSArray::{ + NSArray, NSBinarySearchingFirstEqual, NSBinarySearchingInsertionIndex, + NSBinarySearchingLastEqual, NSBinarySearchingOptions, NSMutableArray, +}; +pub use self::__NSAttributedString::{ + NSAlternateDescriptionAttributeName, NSAttributedString, + NSAttributedStringEnumerationLongestEffectiveRangeNotRequired, + NSAttributedStringEnumerationOptions, NSAttributedStringEnumerationReverse, + NSAttributedStringFormattingApplyReplacementIndexAttribute, + NSAttributedStringFormattingInsertArgumentAttributesWithoutMerging, + NSAttributedStringFormattingOptions, NSAttributedStringKey, + NSAttributedStringMarkdownInterpretedSyntax, NSAttributedStringMarkdownInterpretedSyntaxFull, + NSAttributedStringMarkdownInterpretedSyntaxInlineOnly, + NSAttributedStringMarkdownInterpretedSyntaxInlineOnlyPreservingWhitespace, + NSAttributedStringMarkdownParsingFailurePolicy, + NSAttributedStringMarkdownParsingFailureReturnError, + NSAttributedStringMarkdownParsingFailureReturnPartiallyParsedIfPossible, + NSAttributedStringMarkdownParsingOptions, NSImageURLAttributeName, + NSInflectionAlternativeAttributeName, NSInflectionRuleAttributeName, + NSInlinePresentationIntent, NSInlinePresentationIntentAttributeName, + NSInlinePresentationIntentBlockHTML, NSInlinePresentationIntentCode, + NSInlinePresentationIntentEmphasized, NSInlinePresentationIntentInlineHTML, + NSInlinePresentationIntentLineBreak, NSInlinePresentationIntentSoftBreak, + NSInlinePresentationIntentStrikethrough, NSInlinePresentationIntentStronglyEmphasized, + NSLanguageIdentifierAttributeName, NSMorphologyAttributeName, NSMutableAttributedString, + NSPresentationIntent, NSPresentationIntentAttributeName, NSPresentationIntentKind, + NSPresentationIntentKindBlockQuote, NSPresentationIntentKindCodeBlock, + NSPresentationIntentKindHeader, NSPresentationIntentKindListItem, + NSPresentationIntentKindOrderedList, NSPresentationIntentKindParagraph, + NSPresentationIntentKindTable, NSPresentationIntentKindTableCell, + NSPresentationIntentKindTableHeaderRow, NSPresentationIntentKindTableRow, + NSPresentationIntentKindThematicBreak, NSPresentationIntentKindUnorderedList, + NSPresentationIntentTableColumnAlignment, NSPresentationIntentTableColumnAlignmentCenter, + NSPresentationIntentTableColumnAlignmentLeft, NSPresentationIntentTableColumnAlignmentRight, + NSReplacementIndexAttributeName, +}; +pub use self::__NSAutoreleasePool::NSAutoreleasePool; +pub use self::__NSBackgroundActivityScheduler::{ + NSBackgroundActivityCompletionHandler, NSBackgroundActivityResult, + NSBackgroundActivityResultDeferred, NSBackgroundActivityResultFinished, + NSBackgroundActivityScheduler, +}; +pub use self::__NSBundle::{ + NSBundle, NSBundleDidLoadNotification, NSBundleExecutableArchitectureARM64, + NSBundleExecutableArchitectureI386, NSBundleExecutableArchitecturePPC, + NSBundleExecutableArchitecturePPC64, NSBundleExecutableArchitectureX86_64, + NSBundleResourceRequest, NSBundleResourceRequestLoadingPriorityUrgent, + NSBundleResourceRequestLowDiskSpaceNotification, NSLoadedClasses, +}; +pub use self::__NSByteCountFormatter::{ + NSByteCountFormatter, NSByteCountFormatterCountStyle, NSByteCountFormatterCountStyleBinary, + NSByteCountFormatterCountStyleDecimal, NSByteCountFormatterCountStyleFile, + NSByteCountFormatterCountStyleMemory, NSByteCountFormatterUnits, NSByteCountFormatterUseAll, + NSByteCountFormatterUseBytes, NSByteCountFormatterUseDefault, NSByteCountFormatterUseEB, + NSByteCountFormatterUseGB, NSByteCountFormatterUseKB, NSByteCountFormatterUseMB, + NSByteCountFormatterUsePB, NSByteCountFormatterUseTB, NSByteCountFormatterUseYBOrHigher, + NSByteCountFormatterUseZB, +}; +pub use self::__NSByteOrder::{NSSwappedDouble, NSSwappedFloat}; +pub use self::__NSCache::{NSCache, NSCacheDelegate}; +pub use self::__NSCalendar::{ + NSCalendar, NSCalendarCalendarUnit, NSCalendarDayChangedNotification, NSCalendarIdentifier, + NSCalendarIdentifierBuddhist, NSCalendarIdentifierChinese, NSCalendarIdentifierCoptic, + NSCalendarIdentifierEthiopicAmeteAlem, NSCalendarIdentifierEthiopicAmeteMihret, + NSCalendarIdentifierGregorian, NSCalendarIdentifierHebrew, NSCalendarIdentifierISO8601, + NSCalendarIdentifierIndian, NSCalendarIdentifierIslamic, NSCalendarIdentifierIslamicCivil, + NSCalendarIdentifierIslamicTabular, NSCalendarIdentifierIslamicUmmAlQura, + NSCalendarIdentifierJapanese, NSCalendarIdentifierPersian, NSCalendarIdentifierRepublicOfChina, + NSCalendarMatchFirst, NSCalendarMatchLast, NSCalendarMatchNextTime, + NSCalendarMatchNextTimePreservingSmallerUnits, + NSCalendarMatchPreviousTimePreservingSmallerUnits, NSCalendarMatchStrictly, NSCalendarOptions, + NSCalendarSearchBackwards, NSCalendarUnit, NSCalendarUnitCalendar, NSCalendarUnitDay, + NSCalendarUnitEra, NSCalendarUnitHour, NSCalendarUnitMinute, NSCalendarUnitMonth, + NSCalendarUnitNanosecond, NSCalendarUnitQuarter, NSCalendarUnitSecond, NSCalendarUnitTimeZone, + NSCalendarUnitWeekOfMonth, NSCalendarUnitWeekOfYear, NSCalendarUnitWeekday, + NSCalendarUnitWeekdayOrdinal, NSCalendarUnitYear, NSCalendarUnitYearForWeekOfYear, + NSCalendarWrapComponents, NSDateComponentUndefined, NSDateComponents, NSDayCalendarUnit, + NSEraCalendarUnit, NSHourCalendarUnit, NSMinuteCalendarUnit, NSMonthCalendarUnit, + NSQuarterCalendarUnit, NSSecondCalendarUnit, NSTimeZoneCalendarUnit, NSUndefinedDateComponent, + NSWeekCalendarUnit, NSWeekOfMonthCalendarUnit, NSWeekOfYearCalendarUnit, NSWeekdayCalendarUnit, + NSWeekdayOrdinalCalendarUnit, NSYearCalendarUnit, NSYearForWeekOfYearCalendarUnit, +}; +pub use self::__NSCalendarDate::NSCalendarDate; +pub use self::__NSCharacterSet::{ + NSCharacterSet, NSMutableCharacterSet, NSOpenStepUnicodeReservedBase, +}; +pub use self::__NSClassDescription::{ + NSClassDescription, NSClassDescriptionNeededForClassNotification, +}; +pub use self::__NSCoder::{ + NSCoder, NSDecodingFailurePolicy, NSDecodingFailurePolicyRaiseException, + NSDecodingFailurePolicySetErrorAndReturn, NXReadNSObjectFromCoder, +}; +pub use self::__NSComparisonPredicate::{ + NSAllPredicateModifier, NSAnyPredicateModifier, NSBeginsWithPredicateOperatorType, + NSBetweenPredicateOperatorType, NSCaseInsensitivePredicateOption, NSComparisonPredicate, + NSComparisonPredicateModifier, NSComparisonPredicateOptions, NSContainsPredicateOperatorType, + NSCustomSelectorPredicateOperatorType, NSDiacriticInsensitivePredicateOption, + NSDirectPredicateModifier, NSEndsWithPredicateOperatorType, NSEqualToPredicateOperatorType, + NSGreaterThanOrEqualToPredicateOperatorType, NSGreaterThanPredicateOperatorType, + NSInPredicateOperatorType, NSLessThanOrEqualToPredicateOperatorType, + NSLessThanPredicateOperatorType, NSLikePredicateOperatorType, NSMatchesPredicateOperatorType, + NSNormalizedPredicateOption, NSNotEqualToPredicateOperatorType, NSPredicateOperatorType, +}; +pub use self::__NSCompoundPredicate::{ + NSAndPredicateType, NSCompoundPredicate, NSCompoundPredicateType, NSNotPredicateType, + NSOrPredicateType, +}; +pub use self::__NSConnection::{ + NSConnection, NSConnectionDelegate, NSConnectionDidDieNotification, + NSConnectionDidInitializeNotification, NSConnectionReplyMode, NSDistantObjectRequest, + NSFailedAuthenticationException, +}; +pub use self::__NSData::{ + NSAtomicWrite, NSData, NSDataBase64DecodingIgnoreUnknownCharacters, + NSDataBase64DecodingOptions, NSDataBase64Encoding64CharacterLineLength, + NSDataBase64Encoding76CharacterLineLength, NSDataBase64EncodingEndLineWithCarriageReturn, + NSDataBase64EncodingEndLineWithLineFeed, NSDataBase64EncodingOptions, + NSDataCompressionAlgorithm, NSDataCompressionAlgorithmLZ4, NSDataCompressionAlgorithmLZFSE, + NSDataCompressionAlgorithmLZMA, NSDataCompressionAlgorithmZlib, NSDataReadingMapped, + NSDataReadingMappedAlways, NSDataReadingMappedIfSafe, NSDataReadingOptions, + NSDataReadingUncached, NSDataSearchAnchored, NSDataSearchBackwards, NSDataSearchOptions, + NSDataWritingAtomic, NSDataWritingFileProtectionComplete, + NSDataWritingFileProtectionCompleteUnlessOpen, + NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication, + NSDataWritingFileProtectionMask, NSDataWritingFileProtectionNone, NSDataWritingOptions, + NSDataWritingWithoutOverwriting, NSMappedRead, NSMutableData, NSPurgeableData, NSUncachedRead, +}; +pub use self::__NSDate::{NSDate, NSSystemClockDidChangeNotification, NSTimeInterval}; +pub use self::__NSDateComponentsFormatter::{ + NSDateComponentsFormatter, NSDateComponentsFormatterUnitsStyle, + NSDateComponentsFormatterUnitsStyleAbbreviated, NSDateComponentsFormatterUnitsStyleBrief, + NSDateComponentsFormatterUnitsStyleFull, NSDateComponentsFormatterUnitsStylePositional, + NSDateComponentsFormatterUnitsStyleShort, NSDateComponentsFormatterUnitsStyleSpellOut, + NSDateComponentsFormatterZeroFormattingBehavior, + NSDateComponentsFormatterZeroFormattingBehaviorDefault, + NSDateComponentsFormatterZeroFormattingBehaviorDropAll, + NSDateComponentsFormatterZeroFormattingBehaviorDropLeading, + NSDateComponentsFormatterZeroFormattingBehaviorDropMiddle, + NSDateComponentsFormatterZeroFormattingBehaviorDropTrailing, + NSDateComponentsFormatterZeroFormattingBehaviorNone, + NSDateComponentsFormatterZeroFormattingBehaviorPad, +}; +pub use self::__NSDateFormatter::{ + NSDateFormatter, NSDateFormatterBehavior, NSDateFormatterBehavior10_0, + NSDateFormatterBehavior10_4, NSDateFormatterBehaviorDefault, NSDateFormatterFullStyle, + NSDateFormatterLongStyle, NSDateFormatterMediumStyle, NSDateFormatterNoStyle, + NSDateFormatterShortStyle, NSDateFormatterStyle, +}; +pub use self::__NSDateInterval::NSDateInterval; +pub use self::__NSDateIntervalFormatter::{ + NSDateIntervalFormatter, NSDateIntervalFormatterFullStyle, NSDateIntervalFormatterLongStyle, + NSDateIntervalFormatterMediumStyle, NSDateIntervalFormatterNoStyle, + NSDateIntervalFormatterShortStyle, NSDateIntervalFormatterStyle, +}; +pub use self::__NSDecimal::{ + NSCalculationDivideByZero, NSCalculationError, NSCalculationLossOfPrecision, + NSCalculationNoError, NSCalculationOverflow, NSCalculationUnderflow, NSDecimalAdd, + NSDecimalCompact, NSDecimalCompare, NSDecimalCopy, NSDecimalDivide, NSDecimalMultiply, + NSDecimalMultiplyByPowerOf10, NSDecimalNormalize, NSDecimalPower, NSDecimalRound, + NSDecimalString, NSDecimalSubtract, NSRoundBankers, NSRoundDown, NSRoundPlain, NSRoundUp, + NSRoundingMode, +}; +pub use self::__NSDecimalNumber::{ + NSDecimalNumber, NSDecimalNumberBehaviors, NSDecimalNumberDivideByZeroException, + NSDecimalNumberExactnessException, NSDecimalNumberHandler, NSDecimalNumberOverflowException, + NSDecimalNumberUnderflowException, +}; +pub use self::__NSDictionary::{NSDictionary, NSMutableDictionary}; +pub use self::__NSDistantObject::NSDistantObject; +pub use self::__NSDistributedLock::NSDistributedLock; +pub use self::__NSDistributedNotificationCenter::{ + NSDistributedNotificationCenter, NSDistributedNotificationCenterType, + NSDistributedNotificationDeliverImmediately, NSDistributedNotificationOptions, + NSDistributedNotificationPostToAllSessions, NSLocalNotificationCenterType, + NSNotificationDeliverImmediately, NSNotificationPostToAllSessions, + NSNotificationSuspensionBehavior, NSNotificationSuspensionBehaviorCoalesce, + NSNotificationSuspensionBehaviorDeliverImmediately, NSNotificationSuspensionBehaviorDrop, + NSNotificationSuspensionBehaviorHold, +}; +pub use self::__NSEnergyFormatter::{ + NSEnergyFormatter, NSEnergyFormatterUnit, NSEnergyFormatterUnitCalorie, + NSEnergyFormatterUnitJoule, NSEnergyFormatterUnitKilocalorie, NSEnergyFormatterUnitKilojoule, +}; +pub use self::__NSEnumerator::{NSEnumerator, NSFastEnumeration, NSFastEnumerationState}; +pub use self::__NSError::{ + NSCocoaErrorDomain, NSDebugDescriptionErrorKey, NSError, NSErrorDomain, NSErrorUserInfoKey, + NSFilePathErrorKey, NSHelpAnchorErrorKey, NSLocalizedDescriptionKey, + NSLocalizedFailureErrorKey, NSLocalizedFailureReasonErrorKey, + NSLocalizedRecoveryOptionsErrorKey, NSLocalizedRecoverySuggestionErrorKey, NSMachErrorDomain, + NSMultipleUnderlyingErrorsKey, NSOSStatusErrorDomain, NSPOSIXErrorDomain, + NSRecoveryAttempterErrorKey, NSStringEncodingErrorKey, NSURLErrorKey, NSUnderlyingErrorKey, +}; +pub use self::__NSException::{ + NSAssertionHandler, NSAssertionHandlerKey, NSDestinationInvalidException, NSException, + NSGenericException, NSGetUncaughtExceptionHandler, NSInconsistentArchiveException, + NSInternalInconsistencyException, NSInvalidArgumentException, NSInvalidReceivePortException, + NSInvalidSendPortException, NSMallocException, NSObjectInaccessibleException, + NSObjectNotAvailableException, NSOldStyleException, NSPortReceiveException, + NSPortSendException, NSPortTimeoutException, NSRangeException, NSSetUncaughtExceptionHandler, + NSUncaughtExceptionHandler, +}; +pub use self::__NSExpression::{ + NSAggregateExpressionType, NSAnyKeyExpressionType, NSBlockExpressionType, + NSConditionalExpressionType, NSConstantValueExpressionType, NSEvaluatedObjectExpressionType, + NSExpression, NSExpressionType, NSFunctionExpressionType, NSIntersectSetExpressionType, + NSKeyPathExpressionType, NSMinusSetExpressionType, NSSubqueryExpressionType, + NSUnionSetExpressionType, NSVariableExpressionType, +}; +pub use self::__NSExtensionContext::{ + NSExtensionContext, NSExtensionHostDidBecomeActiveNotification, + NSExtensionHostDidEnterBackgroundNotification, NSExtensionHostWillEnterForegroundNotification, + NSExtensionHostWillResignActiveNotification, NSExtensionItemsAndErrorsKey, +}; +pub use self::__NSExtensionItem::{ + NSExtensionItem, NSExtensionItemAttachmentsKey, NSExtensionItemAttributedContentTextKey, + NSExtensionItemAttributedTitleKey, +}; +pub use self::__NSExtensionRequestHandling::NSExtensionRequestHandling; +pub use self::__NSFileCoordinator::{ + NSFileAccessIntent, NSFileCoordinator, NSFileCoordinatorReadingForUploading, + NSFileCoordinatorReadingImmediatelyAvailableMetadataOnly, NSFileCoordinatorReadingOptions, + NSFileCoordinatorReadingResolvesSymbolicLink, NSFileCoordinatorReadingWithoutChanges, + NSFileCoordinatorWritingContentIndependentMetadataOnly, NSFileCoordinatorWritingForDeleting, + NSFileCoordinatorWritingForMerging, NSFileCoordinatorWritingForMoving, + NSFileCoordinatorWritingForReplacing, NSFileCoordinatorWritingOptions, +}; +pub use self::__NSFileHandle::{ + NSFileHandle, NSFileHandleConnectionAcceptedNotification, + NSFileHandleDataAvailableNotification, NSFileHandleNotificationDataItem, + NSFileHandleNotificationFileHandleItem, NSFileHandleNotificationMonitorModes, + NSFileHandleOperationException, NSFileHandleReadCompletionNotification, + NSFileHandleReadToEndOfFileCompletionNotification, NSPipe, +}; +pub use self::__NSFileManager::{ + NSDirectoryEnumerationIncludesDirectoriesPostOrder, NSDirectoryEnumerationOptions, + NSDirectoryEnumerationProducesRelativePathURLs, NSDirectoryEnumerationSkipsHiddenFiles, + NSDirectoryEnumerationSkipsPackageDescendants, + NSDirectoryEnumerationSkipsSubdirectoryDescendants, NSDirectoryEnumerator, NSFileAppendOnly, + NSFileAttributeKey, NSFileAttributeType, NSFileBusy, NSFileCreationDate, + NSFileDeviceIdentifier, NSFileExtensionHidden, NSFileGroupOwnerAccountID, + NSFileGroupOwnerAccountName, NSFileHFSCreatorCode, NSFileHFSTypeCode, NSFileImmutable, + NSFileManager, NSFileManagerDelegate, NSFileManagerItemReplacementOptions, + NSFileManagerItemReplacementUsingNewMetadataOnly, + NSFileManagerItemReplacementWithoutDeletingBackupItem, + NSFileManagerUnmountAllPartitionsAndEjectDisk, + NSFileManagerUnmountDissentingProcessIdentifierErrorKey, NSFileManagerUnmountOptions, + NSFileManagerUnmountWithoutUI, NSFileModificationDate, NSFileOwnerAccountID, + NSFileOwnerAccountName, NSFilePosixPermissions, NSFileProtectionComplete, + NSFileProtectionCompleteUnlessOpen, NSFileProtectionCompleteUntilFirstUserAuthentication, + NSFileProtectionKey, NSFileProtectionNone, NSFileProtectionType, NSFileProviderService, + NSFileProviderServiceName, NSFileReferenceCount, NSFileSize, NSFileSystemFileNumber, + NSFileSystemFreeNodes, NSFileSystemFreeSize, NSFileSystemNodes, NSFileSystemNumber, + NSFileSystemSize, NSFileType, NSFileTypeBlockSpecial, NSFileTypeCharacterSpecial, + NSFileTypeDirectory, NSFileTypeRegular, NSFileTypeSocket, NSFileTypeSymbolicLink, + NSFileTypeUnknown, NSURLRelationship, NSURLRelationshipContains, NSURLRelationshipOther, + NSURLRelationshipSame, NSUbiquityIdentityDidChangeNotification, NSVolumeEnumerationOptions, + NSVolumeEnumerationProduceFileReferenceURLs, NSVolumeEnumerationSkipHiddenVolumes, +}; +pub use self::__NSFilePresenter::NSFilePresenter; +pub use self::__NSFileVersion::{ + NSFileVersion, NSFileVersionAddingByMoving, NSFileVersionAddingOptions, + NSFileVersionReplacingByMoving, NSFileVersionReplacingOptions, +}; +pub use self::__NSFileWrapper::{ + NSFileWrapper, NSFileWrapperReadingImmediate, NSFileWrapperReadingOptions, + NSFileWrapperReadingWithoutMapping, NSFileWrapperWritingAtomic, NSFileWrapperWritingOptions, + NSFileWrapperWritingWithNameUpdating, +}; +pub use self::__NSFormatter::{ + NSFormatter, NSFormattingContext, NSFormattingContextBeginningOfSentence, + NSFormattingContextDynamic, NSFormattingContextListItem, NSFormattingContextMiddleOfSentence, + NSFormattingContextStandalone, NSFormattingContextUnknown, NSFormattingUnitStyle, + NSFormattingUnitStyleLong, NSFormattingUnitStyleMedium, NSFormattingUnitStyleShort, +}; +pub use self::__NSGarbageCollector::NSGarbageCollector; +pub use self::__NSGeometry::{ + NSAlignAllEdgesInward, NSAlignAllEdgesNearest, NSAlignAllEdgesOutward, NSAlignHeightInward, + NSAlignHeightNearest, NSAlignHeightOutward, NSAlignMaxXInward, NSAlignMaxXNearest, + NSAlignMaxXOutward, NSAlignMaxYInward, NSAlignMaxYNearest, NSAlignMaxYOutward, + NSAlignMinXInward, NSAlignMinXNearest, NSAlignMinXOutward, NSAlignMinYInward, + NSAlignMinYNearest, NSAlignMinYOutward, NSAlignRectFlipped, NSAlignWidthInward, + NSAlignWidthNearest, NSAlignWidthOutward, NSAlignmentOptions, NSContainsRect, NSDivideRect, + NSEdgeInsets, NSEdgeInsetsEqual, NSEdgeInsetsZero, NSEqualPoints, NSEqualRects, NSEqualSizes, + NSInsetRect, NSIntegralRect, NSIntegralRectWithOptions, NSIntersectionRect, NSIntersectsRect, + NSIsEmptyRect, NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMouseInRect, NSOffsetRect, + NSPoint, NSPointArray, NSPointFromString, NSPointInRect, NSPointPointer, NSRect, NSRectArray, + NSRectEdge, NSRectEdgeMaxX, NSRectEdgeMaxY, NSRectEdgeMinX, NSRectEdgeMinY, NSRectFromString, + NSRectPointer, NSSize, NSSizeArray, NSSizeFromString, NSSizePointer, NSStringFromPoint, + NSStringFromRect, NSStringFromSize, NSUnionRect, NSZeroPoint, NSZeroRect, NSZeroSize, +}; +pub use self::__NSHFSFileTypes::{ + NSFileTypeForHFSTypeCode, NSHFSTypeCodeFromFileType, NSHFSTypeOfFile, +}; +pub use self::__NSHTTPCookie::{ + NSHTTPCookie, NSHTTPCookieComment, NSHTTPCookieCommentURL, NSHTTPCookieDiscard, + NSHTTPCookieDomain, NSHTTPCookieExpires, NSHTTPCookieMaximumAge, NSHTTPCookieName, + NSHTTPCookieOriginURL, NSHTTPCookiePath, NSHTTPCookiePort, NSHTTPCookiePropertyKey, + NSHTTPCookieSameSiteLax, NSHTTPCookieSameSitePolicy, NSHTTPCookieSameSiteStrict, + NSHTTPCookieSecure, NSHTTPCookieStringPolicy, NSHTTPCookieValue, NSHTTPCookieVersion, +}; +pub use self::__NSHTTPCookieStorage::{ + NSHTTPCookieAcceptPolicy, NSHTTPCookieAcceptPolicyAlways, NSHTTPCookieAcceptPolicyNever, + NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain, + NSHTTPCookieManagerAcceptPolicyChangedNotification, + NSHTTPCookieManagerCookiesChangedNotification, NSHTTPCookieStorage, +}; +pub use self::__NSHashTable::{ + NSAllHashTableObjects, NSCompareHashTables, NSCopyHashTableWithZone, NSCountHashTable, + NSCreateHashTable, NSCreateHashTableWithZone, NSEndHashTableEnumeration, NSEnumerateHashTable, + NSFreeHashTable, NSHashEnumerator, NSHashGet, NSHashInsert, NSHashInsertIfAbsent, + NSHashInsertKnownAbsent, NSHashRemove, NSHashTable, NSHashTableCallBacks, NSHashTableCopyIn, + NSHashTableObjectPointerPersonality, NSHashTableOptions, NSHashTableStrongMemory, + NSHashTableWeakMemory, NSHashTableZeroingWeakMemory, NSIntHashCallBacks, + NSIntegerHashCallBacks, NSNextHashEnumeratorItem, NSNonOwnedPointerHashCallBacks, + NSNonRetainedObjectHashCallBacks, NSObjectHashCallBacks, NSOwnedObjectIdentityHashCallBacks, + NSOwnedPointerHashCallBacks, NSPointerToStructHashCallBacks, NSResetHashTable, + NSStringFromHashTable, +}; +pub use self::__NSHost::NSHost; +pub use self::__NSISO8601DateFormatter::{ + NSISO8601DateFormatOptions, NSISO8601DateFormatWithColonSeparatorInTime, + NSISO8601DateFormatWithColonSeparatorInTimeZone, NSISO8601DateFormatWithDashSeparatorInDate, + NSISO8601DateFormatWithDay, NSISO8601DateFormatWithFractionalSeconds, + NSISO8601DateFormatWithFullDate, NSISO8601DateFormatWithFullTime, + NSISO8601DateFormatWithInternetDateTime, NSISO8601DateFormatWithMonth, + NSISO8601DateFormatWithSpaceBetweenDateAndTime, NSISO8601DateFormatWithTime, + NSISO8601DateFormatWithTimeZone, NSISO8601DateFormatWithWeekOfYear, + NSISO8601DateFormatWithYear, NSISO8601DateFormatter, +}; +pub use self::__NSIndexPath::NSIndexPath; +pub use self::__NSIndexSet::{NSIndexSet, NSMutableIndexSet}; +pub use self::__NSInflectionRule::{NSInflectionRule, NSInflectionRuleExplicit}; +pub use self::__NSInvocation::NSInvocation; +pub use self::__NSItemProvider::{ + NSExtensionJavaScriptFinalizeArgumentKey, NSExtensionJavaScriptPreprocessingResultsKey, + NSItemProvider, NSItemProviderCompletionHandler, NSItemProviderErrorCode, + NSItemProviderErrorDomain, NSItemProviderFileOptionOpenInPlace, NSItemProviderFileOptions, + NSItemProviderItemUnavailableError, NSItemProviderLoadHandler, + NSItemProviderPreferredImageSizeKey, NSItemProviderReading, + NSItemProviderRepresentationVisibility, NSItemProviderRepresentationVisibilityAll, + NSItemProviderRepresentationVisibilityGroup, NSItemProviderRepresentationVisibilityOwnProcess, + NSItemProviderRepresentationVisibilityTeam, NSItemProviderUnavailableCoercionError, + NSItemProviderUnexpectedValueClassError, NSItemProviderUnknownError, NSItemProviderWriting, +}; +pub use self::__NSJSONSerialization::{ + NSJSONReadingAllowFragments, NSJSONReadingFragmentsAllowed, NSJSONReadingJSON5Allowed, + NSJSONReadingMutableContainers, NSJSONReadingMutableLeaves, NSJSONReadingOptions, + NSJSONReadingTopLevelDictionaryAssumed, NSJSONSerialization, NSJSONWritingFragmentsAllowed, + NSJSONWritingOptions, NSJSONWritingPrettyPrinted, NSJSONWritingSortedKeys, + NSJSONWritingWithoutEscapingSlashes, +}; +pub use self::__NSKeyValueCoding::{ + NSAverageKeyValueOperator, NSCountKeyValueOperator, NSDistinctUnionOfArraysKeyValueOperator, + NSDistinctUnionOfObjectsKeyValueOperator, NSDistinctUnionOfSetsKeyValueOperator, + NSKeyValueOperator, NSMaximumKeyValueOperator, NSMinimumKeyValueOperator, + NSSumKeyValueOperator, NSUndefinedKeyException, NSUnionOfArraysKeyValueOperator, + NSUnionOfObjectsKeyValueOperator, NSUnionOfSetsKeyValueOperator, +}; +pub use self::__NSKeyValueObserving::{ + NSKeyValueChange, NSKeyValueChangeIndexesKey, NSKeyValueChangeInsertion, NSKeyValueChangeKey, + NSKeyValueChangeKindKey, NSKeyValueChangeNewKey, NSKeyValueChangeNotificationIsPriorKey, + NSKeyValueChangeOldKey, NSKeyValueChangeRemoval, NSKeyValueChangeReplacement, + NSKeyValueChangeSetting, NSKeyValueIntersectSetMutation, NSKeyValueMinusSetMutation, + NSKeyValueObservingOptionInitial, NSKeyValueObservingOptionNew, NSKeyValueObservingOptionOld, + NSKeyValueObservingOptionPrior, NSKeyValueObservingOptions, NSKeyValueSetMutationKind, + NSKeyValueSetSetMutation, NSKeyValueUnionSetMutation, +}; +pub use self::__NSKeyedArchiver::{ + NSInvalidArchiveOperationException, NSInvalidUnarchiveOperationException, + NSKeyedArchiveRootObjectKey, NSKeyedArchiver, NSKeyedArchiverDelegate, NSKeyedUnarchiver, + NSKeyedUnarchiverDelegate, +}; +pub use self::__NSLengthFormatter::{ + NSLengthFormatter, NSLengthFormatterUnit, NSLengthFormatterUnitCentimeter, + NSLengthFormatterUnitFoot, NSLengthFormatterUnitInch, NSLengthFormatterUnitKilometer, + NSLengthFormatterUnitMeter, NSLengthFormatterUnitMile, NSLengthFormatterUnitMillimeter, + NSLengthFormatterUnitYard, +}; +pub use self::__NSLinguisticTagger::{ + NSLinguisticTag, NSLinguisticTagAdjective, NSLinguisticTagAdverb, NSLinguisticTagClassifier, + NSLinguisticTagCloseParenthesis, NSLinguisticTagCloseQuote, NSLinguisticTagConjunction, + NSLinguisticTagDash, NSLinguisticTagDeterminer, NSLinguisticTagIdiom, + NSLinguisticTagInterjection, NSLinguisticTagNoun, NSLinguisticTagNumber, + NSLinguisticTagOpenParenthesis, NSLinguisticTagOpenQuote, NSLinguisticTagOrganizationName, + NSLinguisticTagOther, NSLinguisticTagOtherPunctuation, NSLinguisticTagOtherWhitespace, + NSLinguisticTagOtherWord, NSLinguisticTagParagraphBreak, NSLinguisticTagParticle, + NSLinguisticTagPersonalName, NSLinguisticTagPlaceName, NSLinguisticTagPreposition, + NSLinguisticTagPronoun, NSLinguisticTagPunctuation, NSLinguisticTagScheme, + NSLinguisticTagSchemeLanguage, NSLinguisticTagSchemeLemma, NSLinguisticTagSchemeLexicalClass, + NSLinguisticTagSchemeNameType, NSLinguisticTagSchemeNameTypeOrLexicalClass, + NSLinguisticTagSchemeScript, NSLinguisticTagSchemeTokenType, NSLinguisticTagSentenceTerminator, + NSLinguisticTagVerb, NSLinguisticTagWhitespace, NSLinguisticTagWord, NSLinguisticTagWordJoiner, + NSLinguisticTagger, NSLinguisticTaggerJoinNames, NSLinguisticTaggerOmitOther, + NSLinguisticTaggerOmitPunctuation, NSLinguisticTaggerOmitWhitespace, + NSLinguisticTaggerOmitWords, NSLinguisticTaggerOptions, NSLinguisticTaggerUnit, + NSLinguisticTaggerUnitDocument, NSLinguisticTaggerUnitParagraph, + NSLinguisticTaggerUnitSentence, NSLinguisticTaggerUnitWord, +}; +pub use self::__NSListFormatter::NSListFormatter; +pub use self::__NSLocale::{ + NSBuddhistCalendar, NSChineseCalendar, NSCurrentLocaleDidChangeNotification, + NSGregorianCalendar, NSHebrewCalendar, NSISO8601Calendar, NSIndianCalendar, NSIslamicCalendar, + NSIslamicCivilCalendar, NSJapaneseCalendar, NSLocale, + NSLocaleAlternateQuotationBeginDelimiterKey, NSLocaleAlternateQuotationEndDelimiterKey, + NSLocaleCalendar, NSLocaleCollationIdentifier, NSLocaleCollatorIdentifier, NSLocaleCountryCode, + NSLocaleCurrencyCode, NSLocaleCurrencySymbol, NSLocaleDecimalSeparator, + NSLocaleExemplarCharacterSet, NSLocaleGroupingSeparator, NSLocaleIdentifier, NSLocaleKey, + NSLocaleLanguageCode, NSLocaleLanguageDirection, NSLocaleLanguageDirectionBottomToTop, + NSLocaleLanguageDirectionLeftToRight, NSLocaleLanguageDirectionRightToLeft, + NSLocaleLanguageDirectionTopToBottom, NSLocaleLanguageDirectionUnknown, + NSLocaleMeasurementSystem, NSLocaleQuotationBeginDelimiterKey, + NSLocaleQuotationEndDelimiterKey, NSLocaleScriptCode, NSLocaleUsesMetricSystem, + NSLocaleVariantCode, NSPersianCalendar, NSRepublicOfChinaCalendar, +}; +pub use self::__NSLock::{NSCondition, NSConditionLock, NSLock, NSLocking, NSRecursiveLock}; +pub use self::__NSMapTable::{ + NSAllMapTableKeys, NSAllMapTableValues, NSCompareMapTables, NSCopyMapTableWithZone, + NSCountMapTable, NSCreateMapTable, NSCreateMapTableWithZone, NSEndMapTableEnumeration, + NSEnumerateMapTable, NSFreeMapTable, NSIntMapKeyCallBacks, NSIntMapValueCallBacks, + NSIntegerMapKeyCallBacks, NSIntegerMapValueCallBacks, NSMapEnumerator, NSMapGet, NSMapInsert, + NSMapInsertIfAbsent, NSMapInsertKnownAbsent, NSMapMember, NSMapRemove, NSMapTable, + NSMapTableCopyIn, NSMapTableKeyCallBacks, NSMapTableObjectPointerPersonality, + NSMapTableOptions, NSMapTableStrongMemory, NSMapTableValueCallBacks, NSMapTableWeakMemory, + NSMapTableZeroingWeakMemory, NSNextMapEnumeratorPair, NSNonOwnedPointerMapKeyCallBacks, + NSNonOwnedPointerMapValueCallBacks, NSNonOwnedPointerOrNullMapKeyCallBacks, + NSNonRetainedObjectMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, + NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, NSOwnedPointerMapKeyCallBacks, + NSOwnedPointerMapValueCallBacks, NSResetMapTable, NSStringFromMapTable, +}; +pub use self::__NSMassFormatter::{ + NSMassFormatter, NSMassFormatterUnit, NSMassFormatterUnitGram, NSMassFormatterUnitKilogram, + NSMassFormatterUnitOunce, NSMassFormatterUnitPound, NSMassFormatterUnitStone, +}; +pub use self::__NSMeasurement::NSMeasurement; +pub use self::__NSMeasurementFormatter::{ + NSMeasurementFormatter, NSMeasurementFormatterUnitOptions, + NSMeasurementFormatterUnitOptionsNaturalScale, NSMeasurementFormatterUnitOptionsProvidedUnit, + NSMeasurementFormatterUnitOptionsTemperatureWithoutUnit, +}; +pub use self::__NSMetadata::{ + NSMetadataItem, NSMetadataQuery, NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope, + NSMetadataQueryAttributeValueTuple, NSMetadataQueryDelegate, + NSMetadataQueryDidFinishGatheringNotification, NSMetadataQueryDidStartGatheringNotification, + NSMetadataQueryDidUpdateNotification, NSMetadataQueryGatheringProgressNotification, + NSMetadataQueryIndexedLocalComputerScope, NSMetadataQueryIndexedNetworkScope, + NSMetadataQueryLocalComputerScope, NSMetadataQueryNetworkScope, + NSMetadataQueryResultContentRelevanceAttribute, NSMetadataQueryResultGroup, + NSMetadataQueryUbiquitousDataScope, NSMetadataQueryUbiquitousDocumentsScope, + NSMetadataQueryUpdateAddedItemsKey, NSMetadataQueryUpdateChangedItemsKey, + NSMetadataQueryUpdateRemovedItemsKey, NSMetadataQueryUserHomeScope, +}; +pub use self::__NSMetadataAttributes::{ + NSMetadataItemAcquisitionMakeKey, NSMetadataItemAcquisitionModelKey, NSMetadataItemAlbumKey, + NSMetadataItemAltitudeKey, NSMetadataItemApertureKey, NSMetadataItemAppleLoopDescriptorsKey, + NSMetadataItemAppleLoopsKeyFilterTypeKey, NSMetadataItemAppleLoopsLoopModeKey, + NSMetadataItemAppleLoopsRootKeyKey, NSMetadataItemApplicationCategoriesKey, + NSMetadataItemAttributeChangeDateKey, NSMetadataItemAudiencesKey, + NSMetadataItemAudioBitRateKey, NSMetadataItemAudioChannelCountKey, + NSMetadataItemAudioEncodingApplicationKey, NSMetadataItemAudioSampleRateKey, + NSMetadataItemAudioTrackNumberKey, NSMetadataItemAuthorAddressesKey, + NSMetadataItemAuthorEmailAddressesKey, NSMetadataItemAuthorsKey, + NSMetadataItemBitsPerSampleKey, NSMetadataItemCFBundleIdentifierKey, + NSMetadataItemCameraOwnerKey, NSMetadataItemCityKey, NSMetadataItemCodecsKey, + NSMetadataItemColorSpaceKey, NSMetadataItemCommentKey, NSMetadataItemComposerKey, + NSMetadataItemContactKeywordsKey, NSMetadataItemContentCreationDateKey, + NSMetadataItemContentModificationDateKey, NSMetadataItemContentTypeKey, + NSMetadataItemContentTypeTreeKey, NSMetadataItemContributorsKey, NSMetadataItemCopyrightKey, + NSMetadataItemCountryKey, NSMetadataItemCoverageKey, NSMetadataItemCreatorKey, + NSMetadataItemDateAddedKey, NSMetadataItemDeliveryTypeKey, NSMetadataItemDescriptionKey, + NSMetadataItemDirectorKey, NSMetadataItemDisplayNameKey, NSMetadataItemDownloadedDateKey, + NSMetadataItemDueDateKey, NSMetadataItemDurationSecondsKey, NSMetadataItemEXIFGPSVersionKey, + NSMetadataItemEXIFVersionKey, NSMetadataItemEditorsKey, NSMetadataItemEmailAddressesKey, + NSMetadataItemEncodingApplicationsKey, NSMetadataItemExecutableArchitecturesKey, + NSMetadataItemExecutablePlatformKey, NSMetadataItemExposureModeKey, + NSMetadataItemExposureProgramKey, NSMetadataItemExposureTimeSecondsKey, + NSMetadataItemExposureTimeStringKey, NSMetadataItemFNumberKey, + NSMetadataItemFSContentChangeDateKey, NSMetadataItemFSCreationDateKey, NSMetadataItemFSNameKey, + NSMetadataItemFSSizeKey, NSMetadataItemFinderCommentKey, NSMetadataItemFlashOnOffKey, + NSMetadataItemFocalLength35mmKey, NSMetadataItemFocalLengthKey, NSMetadataItemFontsKey, + NSMetadataItemGPSAreaInformationKey, NSMetadataItemGPSDOPKey, NSMetadataItemGPSDateStampKey, + NSMetadataItemGPSDestBearingKey, NSMetadataItemGPSDestDistanceKey, + NSMetadataItemGPSDestLatitudeKey, NSMetadataItemGPSDestLongitudeKey, + NSMetadataItemGPSDifferentalKey, NSMetadataItemGPSMapDatumKey, NSMetadataItemGPSMeasureModeKey, + NSMetadataItemGPSProcessingMethodKey, NSMetadataItemGPSStatusKey, NSMetadataItemGPSTrackKey, + NSMetadataItemGenreKey, NSMetadataItemHasAlphaChannelKey, NSMetadataItemHeadlineKey, + NSMetadataItemISOSpeedKey, NSMetadataItemIdentifierKey, NSMetadataItemImageDirectionKey, + NSMetadataItemInformationKey, NSMetadataItemInstantMessageAddressesKey, + NSMetadataItemInstructionsKey, NSMetadataItemIsApplicationManagedKey, + NSMetadataItemIsGeneralMIDISequenceKey, NSMetadataItemIsLikelyJunkKey, + NSMetadataItemIsUbiquitousKey, NSMetadataItemKeySignatureKey, NSMetadataItemKeywordsKey, + NSMetadataItemKindKey, NSMetadataItemLanguagesKey, NSMetadataItemLastUsedDateKey, + NSMetadataItemLatitudeKey, NSMetadataItemLayerNamesKey, NSMetadataItemLensModelKey, + NSMetadataItemLongitudeKey, NSMetadataItemLyricistKey, NSMetadataItemMaxApertureKey, + NSMetadataItemMediaTypesKey, NSMetadataItemMeteringModeKey, NSMetadataItemMusicalGenreKey, + NSMetadataItemMusicalInstrumentCategoryKey, NSMetadataItemMusicalInstrumentNameKey, + NSMetadataItemNamedLocationKey, NSMetadataItemNumberOfPagesKey, NSMetadataItemOrganizationsKey, + NSMetadataItemOrientationKey, NSMetadataItemOriginalFormatKey, NSMetadataItemOriginalSourceKey, + NSMetadataItemPageHeightKey, NSMetadataItemPageWidthKey, NSMetadataItemParticipantsKey, + NSMetadataItemPathKey, NSMetadataItemPerformersKey, NSMetadataItemPhoneNumbersKey, + NSMetadataItemPixelCountKey, NSMetadataItemPixelHeightKey, NSMetadataItemPixelWidthKey, + NSMetadataItemProducerKey, NSMetadataItemProfileNameKey, NSMetadataItemProjectsKey, + NSMetadataItemPublishersKey, NSMetadataItemRecipientAddressesKey, + NSMetadataItemRecipientEmailAddressesKey, NSMetadataItemRecipientsKey, + NSMetadataItemRecordingDateKey, NSMetadataItemRecordingYearKey, NSMetadataItemRedEyeOnOffKey, + NSMetadataItemResolutionHeightDPIKey, NSMetadataItemResolutionWidthDPIKey, + NSMetadataItemRightsKey, NSMetadataItemSecurityMethodKey, NSMetadataItemSpeedKey, + NSMetadataItemStarRatingKey, NSMetadataItemStateOrProvinceKey, NSMetadataItemStreamableKey, + NSMetadataItemSubjectKey, NSMetadataItemTempoKey, NSMetadataItemTextContentKey, + NSMetadataItemThemeKey, NSMetadataItemTimeSignatureKey, NSMetadataItemTimestampKey, + NSMetadataItemTitleKey, NSMetadataItemTotalBitRateKey, NSMetadataItemURLKey, + NSMetadataItemVersionKey, NSMetadataItemVideoBitRateKey, NSMetadataItemWhereFromsKey, + NSMetadataItemWhiteBalanceKey, NSMetadataUbiquitousItemContainerDisplayNameKey, + NSMetadataUbiquitousItemDownloadRequestedKey, NSMetadataUbiquitousItemDownloadingErrorKey, + NSMetadataUbiquitousItemDownloadingStatusCurrent, + NSMetadataUbiquitousItemDownloadingStatusDownloaded, + NSMetadataUbiquitousItemDownloadingStatusKey, + NSMetadataUbiquitousItemDownloadingStatusNotDownloaded, + NSMetadataUbiquitousItemHasUnresolvedConflictsKey, NSMetadataUbiquitousItemIsDownloadedKey, + NSMetadataUbiquitousItemIsDownloadingKey, NSMetadataUbiquitousItemIsExternalDocumentKey, + NSMetadataUbiquitousItemIsSharedKey, NSMetadataUbiquitousItemIsUploadedKey, + NSMetadataUbiquitousItemIsUploadingKey, NSMetadataUbiquitousItemPercentDownloadedKey, + NSMetadataUbiquitousItemPercentUploadedKey, NSMetadataUbiquitousItemURLInLocalContainerKey, + NSMetadataUbiquitousItemUploadingErrorKey, + NSMetadataUbiquitousSharedItemCurrentUserPermissionsKey, + NSMetadataUbiquitousSharedItemCurrentUserRoleKey, + NSMetadataUbiquitousSharedItemMostRecentEditorNameComponentsKey, + NSMetadataUbiquitousSharedItemOwnerNameComponentsKey, + NSMetadataUbiquitousSharedItemPermissionsReadOnly, + NSMetadataUbiquitousSharedItemPermissionsReadWrite, NSMetadataUbiquitousSharedItemRoleOwner, + NSMetadataUbiquitousSharedItemRoleParticipant, +}; +pub use self::__NSMethodSignature::NSMethodSignature; +pub use self::__NSMorphology::{ + NSGrammaticalGender, NSGrammaticalGenderFeminine, NSGrammaticalGenderMasculine, + NSGrammaticalGenderNeuter, NSGrammaticalGenderNotSet, NSGrammaticalNumber, + NSGrammaticalNumberNotSet, NSGrammaticalNumberPlural, NSGrammaticalNumberPluralFew, + NSGrammaticalNumberPluralMany, NSGrammaticalNumberPluralTwo, NSGrammaticalNumberSingular, + NSGrammaticalNumberZero, NSGrammaticalPartOfSpeech, NSGrammaticalPartOfSpeechAbbreviation, + NSGrammaticalPartOfSpeechAdjective, NSGrammaticalPartOfSpeechAdposition, + NSGrammaticalPartOfSpeechAdverb, NSGrammaticalPartOfSpeechConjunction, + NSGrammaticalPartOfSpeechDeterminer, NSGrammaticalPartOfSpeechInterjection, + NSGrammaticalPartOfSpeechLetter, NSGrammaticalPartOfSpeechNotSet, + NSGrammaticalPartOfSpeechNoun, NSGrammaticalPartOfSpeechNumeral, + NSGrammaticalPartOfSpeechParticle, NSGrammaticalPartOfSpeechPreposition, + NSGrammaticalPartOfSpeechPronoun, NSGrammaticalPartOfSpeechVerb, NSMorphology, + NSMorphologyCustomPronoun, +}; +pub use self::__NSNetServices::{ + NSNetService, NSNetServiceBrowser, NSNetServiceBrowserDelegate, NSNetServiceDelegate, + NSNetServiceListenForConnections, NSNetServiceNoAutoRename, NSNetServiceOptions, + NSNetServicesActivityInProgress, NSNetServicesBadArgumentError, NSNetServicesCancelledError, + NSNetServicesCollisionError, NSNetServicesError, NSNetServicesErrorCode, + NSNetServicesErrorDomain, NSNetServicesInvalidError, + NSNetServicesMissingRequiredConfigurationError, NSNetServicesNotFoundError, + NSNetServicesTimeoutError, NSNetServicesUnknownError, +}; +pub use self::__NSNotification::{NSNotification, NSNotificationCenter, NSNotificationName}; +pub use self::__NSNotificationQueue::{ + NSNotificationCoalescing, NSNotificationCoalescingOnName, NSNotificationCoalescingOnSender, + NSNotificationNoCoalescing, NSNotificationQueue, NSPostASAP, NSPostNow, NSPostWhenIdle, + NSPostingStyle, +}; +pub use self::__NSNull::NSNull; +pub use self::__NSNumberFormatter::{ + NSNumberFormatter, NSNumberFormatterBehavior, NSNumberFormatterBehavior10_0, + NSNumberFormatterBehavior10_4, NSNumberFormatterBehaviorDefault, + NSNumberFormatterCurrencyAccountingStyle, NSNumberFormatterCurrencyISOCodeStyle, + NSNumberFormatterCurrencyPluralStyle, NSNumberFormatterCurrencyStyle, + NSNumberFormatterDecimalStyle, NSNumberFormatterNoStyle, NSNumberFormatterOrdinalStyle, + NSNumberFormatterPadAfterPrefix, NSNumberFormatterPadAfterSuffix, + NSNumberFormatterPadBeforePrefix, NSNumberFormatterPadBeforeSuffix, + NSNumberFormatterPadPosition, NSNumberFormatterPercentStyle, NSNumberFormatterRoundCeiling, + NSNumberFormatterRoundDown, NSNumberFormatterRoundFloor, NSNumberFormatterRoundHalfDown, + NSNumberFormatterRoundHalfEven, NSNumberFormatterRoundHalfUp, NSNumberFormatterRoundUp, + NSNumberFormatterRoundingMode, NSNumberFormatterScientificStyle, + NSNumberFormatterSpellOutStyle, NSNumberFormatterStyle, +}; +pub use self::__NSObjCRuntime::{ + NSClassFromString, NSComparator, NSComparisonResult, NSEnumerationConcurrent, + NSEnumerationOptions, NSEnumerationReverse, NSExceptionName, NSFoundationVersionNumber, + NSGetSizeAndAlignment, NSOrderedAscending, NSOrderedDescending, NSOrderedSame, + NSProtocolFromString, NSQualityOfService, NSQualityOfServiceBackground, + NSQualityOfServiceDefault, NSQualityOfServiceUserInitiated, NSQualityOfServiceUserInteractive, + NSQualityOfServiceUtility, NSRunLoopMode, NSSelectorFromString, NSSortConcurrent, + NSSortOptions, NSSortStable, NSStringFromClass, NSStringFromProtocol, NSStringFromSelector, +}; +pub use self::__NSObject::{ + NSAllocateObject, NSCoding, NSCopyObject, NSCopying, NSDeallocateObject, + NSDecrementExtraRefCountWasZero, NSDiscardableContent, NSExtraRefCount, + NSIncrementExtraRefCount, NSMutableCopying, NSSecureCoding, NSShouldRetainWithZone, +}; +pub use self::__NSOperation::{ + NSBlockOperation, NSInvocationOperation, NSInvocationOperationCancelledException, + NSInvocationOperationVoidResultException, NSOperation, NSOperationQueue, + NSOperationQueueDefaultMaxConcurrentOperationCount, NSOperationQueuePriority, + NSOperationQueuePriorityHigh, NSOperationQueuePriorityLow, NSOperationQueuePriorityNormal, + NSOperationQueuePriorityVeryHigh, NSOperationQueuePriorityVeryLow, +}; +pub use self::__NSOrderedCollectionChange::{ + NSCollectionChangeInsert, NSCollectionChangeRemove, NSCollectionChangeType, + NSOrderedCollectionChange, +}; +pub use self::__NSOrderedCollectionDifference::{ + NSOrderedCollectionDifference, NSOrderedCollectionDifferenceCalculationInferMoves, + NSOrderedCollectionDifferenceCalculationOmitInsertedObjects, + NSOrderedCollectionDifferenceCalculationOmitRemovedObjects, + NSOrderedCollectionDifferenceCalculationOptions, +}; +pub use self::__NSOrderedSet::{NSMutableOrderedSet, NSOrderedSet}; +pub use self::__NSOrthography::NSOrthography; +pub use self::__NSPathUtilities::{ + NSAdminApplicationDirectory, NSAllApplicationsDirectory, NSAllDomainsMask, + NSAllLibrariesDirectory, NSApplicationDirectory, NSApplicationScriptsDirectory, + NSApplicationSupportDirectory, NSAutosavedInformationDirectory, NSCachesDirectory, + NSCoreServiceDirectory, NSDemoApplicationDirectory, NSDesktopDirectory, + NSDeveloperApplicationDirectory, NSDeveloperDirectory, NSDocumentDirectory, + NSDocumentationDirectory, NSDownloadsDirectory, NSFullUserName, NSHomeDirectory, + NSHomeDirectoryForUser, NSInputMethodsDirectory, NSItemReplacementDirectory, + NSLibraryDirectory, NSLocalDomainMask, NSMoviesDirectory, NSMusicDirectory, + NSNetworkDomainMask, NSOpenStepRootDirectory, NSPicturesDirectory, NSPreferencePanesDirectory, + NSPrinterDescriptionDirectory, NSSearchPathDirectory, NSSearchPathDomainMask, + NSSearchPathForDirectoriesInDomains, NSSharedPublicDirectory, NSSystemDomainMask, + NSTemporaryDirectory, NSTrashDirectory, NSUserDirectory, NSUserDomainMask, NSUserName, +}; +pub use self::__NSPersonNameComponents::NSPersonNameComponents; +pub use self::__NSPersonNameComponentsFormatter::{ + NSPersonNameComponentDelimiter, NSPersonNameComponentFamilyName, + NSPersonNameComponentGivenName, NSPersonNameComponentKey, NSPersonNameComponentMiddleName, + NSPersonNameComponentNickname, NSPersonNameComponentPrefix, NSPersonNameComponentSuffix, + NSPersonNameComponentsFormatter, NSPersonNameComponentsFormatterOptions, + NSPersonNameComponentsFormatterPhonetic, NSPersonNameComponentsFormatterStyle, + NSPersonNameComponentsFormatterStyleAbbreviated, NSPersonNameComponentsFormatterStyleDefault, + NSPersonNameComponentsFormatterStyleLong, NSPersonNameComponentsFormatterStyleMedium, + NSPersonNameComponentsFormatterStyleShort, +}; +pub use self::__NSPointerArray::NSPointerArray; +pub use self::__NSPointerFunctions::{ + NSPointerFunctions, NSPointerFunctionsCStringPersonality, NSPointerFunctionsCopyIn, + NSPointerFunctionsIntegerPersonality, NSPointerFunctionsMachVirtualMemory, + NSPointerFunctionsMallocMemory, NSPointerFunctionsObjectPersonality, + NSPointerFunctionsObjectPointerPersonality, NSPointerFunctionsOpaqueMemory, + NSPointerFunctionsOpaquePersonality, NSPointerFunctionsOptions, NSPointerFunctionsStrongMemory, + NSPointerFunctionsStructPersonality, NSPointerFunctionsWeakMemory, + NSPointerFunctionsZeroingWeakMemory, +}; +pub use self::__NSPort::{ + NSMachPort, NSMachPortDeallocateNone, NSMachPortDeallocateReceiveRight, + NSMachPortDeallocateSendRight, NSMachPortDelegate, NSMachPortOptions, NSMessagePort, NSPort, + NSPortDelegate, NSPortDidBecomeInvalidNotification, NSSocketNativeHandle, NSSocketPort, +}; +pub use self::__NSPortCoder::NSPortCoder; +pub use self::__NSPortMessage::NSPortMessage; +pub use self::__NSPortNameServer::{ + NSMachBootstrapServer, NSMessagePortNameServer, NSPortNameServer, NSSocketPortNameServer, +}; +pub use self::__NSPredicate::NSPredicate; +pub use self::__NSProcessInfo::{ + NSActivityAutomaticTerminationDisabled, NSActivityBackground, + NSActivityIdleDisplaySleepDisabled, NSActivityIdleSystemSleepDisabled, + NSActivityLatencyCritical, NSActivityOptions, NSActivitySuddenTerminationDisabled, + NSActivityUserInitiated, NSActivityUserInitiatedAllowingIdleSystemSleep, NSHPUXOperatingSystem, + NSMACHOperatingSystem, NSOSF1OperatingSystem, NSOperatingSystemVersion, NSProcessInfo, + NSProcessInfoPowerStateDidChangeNotification, NSProcessInfoThermalState, + NSProcessInfoThermalStateCritical, NSProcessInfoThermalStateDidChangeNotification, + NSProcessInfoThermalStateFair, NSProcessInfoThermalStateNominal, + NSProcessInfoThermalStateSerious, NSSolarisOperatingSystem, NSSunOSOperatingSystem, + NSWindows95OperatingSystem, NSWindowsNTOperatingSystem, +}; +pub use self::__NSProgress::{ + NSProgress, NSProgressEstimatedTimeRemainingKey, NSProgressFileAnimationImageKey, + NSProgressFileAnimationImageOriginalRectKey, NSProgressFileCompletedCountKey, + NSProgressFileIconKey, NSProgressFileOperationKind, NSProgressFileOperationKindCopying, + NSProgressFileOperationKindDecompressingAfterDownloading, + NSProgressFileOperationKindDownloading, NSProgressFileOperationKindDuplicating, + NSProgressFileOperationKindKey, NSProgressFileOperationKindReceiving, + NSProgressFileOperationKindUploading, NSProgressFileTotalCountKey, NSProgressFileURLKey, + NSProgressKind, NSProgressKindFile, NSProgressPublishingHandler, NSProgressReporting, + NSProgressThroughputKey, NSProgressUnpublishingHandler, NSProgressUserInfoKey, +}; +pub use self::__NSPropertyList::{ + NSPropertyListBinaryFormat_v1_0, NSPropertyListFormat, NSPropertyListImmutable, + NSPropertyListMutabilityOptions, NSPropertyListMutableContainers, + NSPropertyListMutableContainersAndLeaves, NSPropertyListOpenStepFormat, + NSPropertyListReadOptions, NSPropertyListSerialization, NSPropertyListWriteOptions, + NSPropertyListXMLFormat_v1_0, +}; +pub use self::__NSProtocolChecker::NSProtocolChecker; +pub use self::__NSRange::{ + NSIntersectionRange, NSRange, NSRangeFromString, NSRangePointer, NSStringFromRange, + NSUnionRange, +}; +pub use self::__NSRegularExpression::{ + NSDataDetector, NSMatchingAnchored, NSMatchingCompleted, NSMatchingFlags, NSMatchingHitEnd, + NSMatchingInternalError, NSMatchingOptions, NSMatchingProgress, NSMatchingReportCompletion, + NSMatchingReportProgress, NSMatchingRequiredEnd, NSMatchingWithTransparentBounds, + NSMatchingWithoutAnchoringBounds, NSRegularExpression, + NSRegularExpressionAllowCommentsAndWhitespace, NSRegularExpressionAnchorsMatchLines, + NSRegularExpressionCaseInsensitive, NSRegularExpressionDotMatchesLineSeparators, + NSRegularExpressionIgnoreMetacharacters, NSRegularExpressionOptions, + NSRegularExpressionUseUnicodeWordBoundaries, NSRegularExpressionUseUnixLineSeparators, +}; +pub use self::__NSRelativeDateTimeFormatter::{ + NSRelativeDateTimeFormatter, NSRelativeDateTimeFormatterStyle, + NSRelativeDateTimeFormatterStyleNamed, NSRelativeDateTimeFormatterStyleNumeric, + NSRelativeDateTimeFormatterUnitsStyle, NSRelativeDateTimeFormatterUnitsStyleAbbreviated, + NSRelativeDateTimeFormatterUnitsStyleFull, NSRelativeDateTimeFormatterUnitsStyleShort, + NSRelativeDateTimeFormatterUnitsStyleSpellOut, +}; +pub use self::__NSRunLoop::{NSDefaultRunLoopMode, NSRunLoop, NSRunLoopCommonModes}; +pub use self::__NSScanner::NSScanner; +pub use self::__NSScriptClassDescription::NSScriptClassDescription; +pub use self::__NSScriptCoercionHandler::NSScriptCoercionHandler; +pub use self::__NSScriptCommand::{ + NSArgumentEvaluationScriptError, NSArgumentsWrongScriptError, NSCannotCreateScriptCommandError, + NSInternalScriptError, NSKeySpecifierEvaluationScriptError, NSNoScriptError, + NSOperationNotSupportedForKeyScriptError, NSReceiverEvaluationScriptError, + NSReceiversCantHandleCommandScriptError, NSRequiredArgumentsMissingScriptError, + NSScriptCommand, NSUnknownKeyScriptError, +}; +pub use self::__NSScriptCommandDescription::NSScriptCommandDescription; +pub use self::__NSScriptExecutionContext::NSScriptExecutionContext; +pub use self::__NSScriptKeyValueCoding::NSOperationNotSupportedForKeyException; +pub use self::__NSScriptObjectSpecifiers::{ + NSContainerSpecifierError, NSEverySubelement, NSIndexSpecifier, NSIndexSubelement, + NSInsertionPosition, NSInternalSpecifierError, NSInvalidIndexSpecifierError, NSMiddleSpecifier, + NSMiddleSubelement, NSNameSpecifier, NSNoSpecifierError, NSNoSubelement, + NSNoTopLevelContainersSpecifierError, NSOperationNotSupportedForKeySpecifierError, + NSPositionAfter, NSPositionBefore, NSPositionBeginning, NSPositionEnd, NSPositionReplace, + NSPositionalSpecifier, NSPropertySpecifier, NSRandomSpecifier, NSRandomSubelement, + NSRangeSpecifier, NSRelativeAfter, NSRelativeBefore, NSRelativePosition, NSRelativeSpecifier, + NSScriptObjectSpecifier, NSUniqueIDSpecifier, NSUnknownKeySpecifierError, NSWhoseSpecifier, + NSWhoseSubelementIdentifier, +}; +pub use self::__NSScriptStandardSuiteCommands::{ + NSCloneCommand, NSCloseCommand, NSCountCommand, NSCreateCommand, NSDeleteCommand, + NSExistsCommand, NSGetCommand, NSMoveCommand, NSQuitCommand, NSSaveOptions, NSSaveOptionsAsk, + NSSaveOptionsNo, NSSaveOptionsYes, NSSetCommand, +}; +pub use self::__NSScriptSuiteRegistry::NSScriptSuiteRegistry; +pub use self::__NSScriptWhoseTests::{ + NSBeginsWithComparison, NSContainsComparison, NSEndsWithComparison, NSEqualToComparison, + NSGreaterThanComparison, NSGreaterThanOrEqualToComparison, NSLessThanComparison, + NSLessThanOrEqualToComparison, NSLogicalTest, NSScriptWhoseTest, NSSpecifierTest, + NSTestComparisonOperation, +}; +pub use self::__NSSet::{NSCountedSet, NSMutableSet, NSSet}; +pub use self::__NSSortDescriptor::NSSortDescriptor; +pub use self::__NSSpellServer::{ + NSGrammarCorrections, NSGrammarRange, NSGrammarUserDescription, NSSpellServer, + NSSpellServerDelegate, +}; +pub use self::__NSStream::{ + NSInputStream, NSOutputStream, NSStream, NSStreamDataWrittenToMemoryStreamKey, + NSStreamDelegate, NSStreamEvent, NSStreamEventEndEncountered, NSStreamEventErrorOccurred, + NSStreamEventHasBytesAvailable, NSStreamEventHasSpaceAvailable, NSStreamEventNone, + NSStreamEventOpenCompleted, NSStreamFileCurrentOffsetKey, NSStreamNetworkServiceType, + NSStreamNetworkServiceTypeBackground, NSStreamNetworkServiceTypeCallSignaling, + NSStreamNetworkServiceTypeValue, NSStreamNetworkServiceTypeVideo, + NSStreamNetworkServiceTypeVoIP, NSStreamNetworkServiceTypeVoice, NSStreamPropertyKey, + NSStreamSOCKSErrorDomain, NSStreamSOCKSProxyConfiguration, NSStreamSOCKSProxyConfigurationKey, + NSStreamSOCKSProxyHostKey, NSStreamSOCKSProxyPasswordKey, NSStreamSOCKSProxyPortKey, + NSStreamSOCKSProxyUserKey, NSStreamSOCKSProxyVersion, NSStreamSOCKSProxyVersion4, + NSStreamSOCKSProxyVersion5, NSStreamSOCKSProxyVersionKey, NSStreamSocketSSLErrorDomain, + NSStreamSocketSecurityLevel, NSStreamSocketSecurityLevelKey, + NSStreamSocketSecurityLevelNegotiatedSSL, NSStreamSocketSecurityLevelNone, + NSStreamSocketSecurityLevelSSLv2, NSStreamSocketSecurityLevelSSLv3, + NSStreamSocketSecurityLevelTLSv1, NSStreamStatus, NSStreamStatusAtEnd, NSStreamStatusClosed, + NSStreamStatusError, NSStreamStatusNotOpen, NSStreamStatusOpen, NSStreamStatusOpening, + NSStreamStatusReading, NSStreamStatusWriting, +}; +pub use self::__NSString::{ + unichar, NSASCIIStringEncoding, NSAnchoredSearch, NSBackwardsSearch, NSCaseInsensitiveSearch, + NSCharacterConversionException, NSConstantString, NSDiacriticInsensitiveSearch, + NSForcedOrderingSearch, NSISO2022JPStringEncoding, NSISOLatin1StringEncoding, + NSISOLatin2StringEncoding, NSJapaneseEUCStringEncoding, NSLiteralSearch, + NSMacOSRomanStringEncoding, NSMutableString, NSNEXTSTEPStringEncoding, + NSNonLossyASCIIStringEncoding, NSNumericSearch, NSParseErrorException, + NSProprietaryStringEncoding, NSRegularExpressionSearch, NSShiftJISStringEncoding, + NSSimpleCString, NSString, NSStringCompareOptions, NSStringEncoding, + NSStringEncodingConversionAllowLossy, NSStringEncodingConversionExternalRepresentation, + NSStringEncodingConversionOptions, NSStringEncodingDetectionAllowLossyKey, + NSStringEncodingDetectionDisallowedEncodingsKey, NSStringEncodingDetectionFromWindowsKey, + NSStringEncodingDetectionLikelyLanguageKey, NSStringEncodingDetectionLossySubstitutionKey, + NSStringEncodingDetectionOptionsKey, NSStringEncodingDetectionSuggestedEncodingsKey, + NSStringEncodingDetectionUseOnlySuggestedEncodingsKey, NSStringEnumerationByCaretPositions, + NSStringEnumerationByComposedCharacterSequences, NSStringEnumerationByDeletionClusters, + NSStringEnumerationByLines, NSStringEnumerationByParagraphs, NSStringEnumerationBySentences, + NSStringEnumerationByWords, NSStringEnumerationLocalized, NSStringEnumerationOptions, + NSStringEnumerationReverse, NSStringEnumerationSubstringNotRequired, NSStringTransform, + NSStringTransformFullwidthToHalfwidth, NSStringTransformHiraganaToKatakana, + NSStringTransformLatinToArabic, NSStringTransformLatinToCyrillic, + NSStringTransformLatinToGreek, NSStringTransformLatinToHangul, NSStringTransformLatinToHebrew, + NSStringTransformLatinToHiragana, NSStringTransformLatinToKatakana, + NSStringTransformLatinToThai, NSStringTransformMandarinToLatin, + NSStringTransformStripCombiningMarks, NSStringTransformStripDiacritics, + NSStringTransformToLatin, NSStringTransformToUnicodeName, NSStringTransformToXMLHex, + NSSymbolStringEncoding, NSUTF16BigEndianStringEncoding, NSUTF16LittleEndianStringEncoding, + NSUTF16StringEncoding, NSUTF32BigEndianStringEncoding, NSUTF32LittleEndianStringEncoding, + NSUTF32StringEncoding, NSUTF8StringEncoding, NSUnicodeStringEncoding, NSWidthInsensitiveSearch, + NSWindowsCP1250StringEncoding, NSWindowsCP1251StringEncoding, NSWindowsCP1252StringEncoding, + NSWindowsCP1253StringEncoding, NSWindowsCP1254StringEncoding, +}; +pub use self::__NSTask::{ + NSTask, NSTaskDidTerminateNotification, NSTaskTerminationReason, NSTaskTerminationReasonExit, + NSTaskTerminationReasonUncaughtSignal, +}; +pub use self::__NSTextCheckingResult::{ + NSTextCheckingAirlineKey, NSTextCheckingAllCustomTypes, NSTextCheckingAllSystemTypes, + NSTextCheckingAllTypes, NSTextCheckingCityKey, NSTextCheckingCountryKey, + NSTextCheckingFlightKey, NSTextCheckingJobTitleKey, NSTextCheckingKey, NSTextCheckingNameKey, + NSTextCheckingOrganizationKey, NSTextCheckingPhoneKey, NSTextCheckingResult, + NSTextCheckingStateKey, NSTextCheckingStreetKey, NSTextCheckingType, NSTextCheckingTypeAddress, + NSTextCheckingTypeCorrection, NSTextCheckingTypeDash, NSTextCheckingTypeDate, + NSTextCheckingTypeGrammar, NSTextCheckingTypeLink, NSTextCheckingTypeOrthography, + NSTextCheckingTypePhoneNumber, NSTextCheckingTypeQuote, NSTextCheckingTypeRegularExpression, + NSTextCheckingTypeReplacement, NSTextCheckingTypeSpelling, + NSTextCheckingTypeTransitInformation, NSTextCheckingTypes, NSTextCheckingZIPKey, +}; +pub use self::__NSThread::{ + NSDidBecomeSingleThreadedNotification, NSThread, NSThreadWillExitNotification, + NSWillBecomeMultiThreadedNotification, +}; +pub use self::__NSTimeZone::{ + NSSystemTimeZoneDidChangeNotification, NSTimeZone, NSTimeZoneNameStyle, + NSTimeZoneNameStyleDaylightSaving, NSTimeZoneNameStyleGeneric, + NSTimeZoneNameStyleShortDaylightSaving, NSTimeZoneNameStyleShortGeneric, + NSTimeZoneNameStyleShortStandard, NSTimeZoneNameStyleStandard, +}; +pub use self::__NSTimer::NSTimer; +pub use self::__NSURLAuthenticationChallenge::{ + NSURLAuthenticationChallenge, NSURLAuthenticationChallengeSender, +}; +pub use self::__NSURLCache::{ + NSCachedURLResponse, NSURLCache, NSURLCacheStorageAllowed, + NSURLCacheStorageAllowedInMemoryOnly, NSURLCacheStorageNotAllowed, NSURLCacheStoragePolicy, +}; +pub use self::__NSURLConnection::{ + NSURLConnection, NSURLConnectionDataDelegate, NSURLConnectionDelegate, + NSURLConnectionDownloadDelegate, +}; +pub use self::__NSURLCredential::{ + NSURLCredential, NSURLCredentialPersistence, NSURLCredentialPersistenceForSession, + NSURLCredentialPersistenceNone, NSURLCredentialPersistencePermanent, + NSURLCredentialPersistenceSynchronizable, +}; +pub use self::__NSURLCredentialStorage::{ + NSURLCredentialStorage, NSURLCredentialStorageChangedNotification, + NSURLCredentialStorageRemoveSynchronizableCredentials, +}; +pub use self::__NSURLDownload::{NSURLDownload, NSURLDownloadDelegate}; +pub use self::__NSURLError::{ + NSErrorFailingURLStringKey, NSURLErrorAppTransportSecurityRequiresSecureConnection, + NSURLErrorBackgroundSessionInUseByAnotherProcess, + NSURLErrorBackgroundSessionRequiresSharedContainer, NSURLErrorBackgroundSessionWasDisconnected, + NSURLErrorBackgroundTaskCancelledReasonKey, NSURLErrorBadServerResponse, NSURLErrorBadURL, + NSURLErrorCallIsActive, NSURLErrorCancelled, + NSURLErrorCancelledReasonBackgroundUpdatesDisabled, + NSURLErrorCancelledReasonInsufficientSystemResources, + NSURLErrorCancelledReasonUserForceQuitApplication, NSURLErrorCannotCloseFile, + NSURLErrorCannotConnectToHost, NSURLErrorCannotCreateFile, NSURLErrorCannotDecodeContentData, + NSURLErrorCannotDecodeRawData, NSURLErrorCannotFindHost, NSURLErrorCannotLoadFromNetwork, + NSURLErrorCannotMoveFile, NSURLErrorCannotOpenFile, NSURLErrorCannotParseResponse, + NSURLErrorCannotRemoveFile, NSURLErrorCannotWriteToFile, NSURLErrorClientCertificateRejected, + NSURLErrorClientCertificateRequired, NSURLErrorDNSLookupFailed, + NSURLErrorDataLengthExceedsMaximum, NSURLErrorDataNotAllowed, NSURLErrorDomain, + NSURLErrorDownloadDecodingFailedMidStream, NSURLErrorDownloadDecodingFailedToComplete, + NSURLErrorFailingURLErrorKey, NSURLErrorFailingURLPeerTrustErrorKey, + NSURLErrorFailingURLStringErrorKey, NSURLErrorFileDoesNotExist, NSURLErrorFileIsDirectory, + NSURLErrorFileOutsideSafeArea, NSURLErrorHTTPTooManyRedirects, + NSURLErrorInternationalRoamingOff, NSURLErrorNetworkConnectionLost, + NSURLErrorNetworkUnavailableReason, NSURLErrorNetworkUnavailableReasonCellular, + NSURLErrorNetworkUnavailableReasonConstrained, NSURLErrorNetworkUnavailableReasonExpensive, + NSURLErrorNetworkUnavailableReasonKey, NSURLErrorNoPermissionsToReadFile, + NSURLErrorNotConnectedToInternet, NSURLErrorRedirectToNonExistentLocation, + NSURLErrorRequestBodyStreamExhausted, NSURLErrorResourceUnavailable, + NSURLErrorSecureConnectionFailed, NSURLErrorServerCertificateHasBadDate, + NSURLErrorServerCertificateHasUnknownRoot, NSURLErrorServerCertificateNotYetValid, + NSURLErrorServerCertificateUntrusted, NSURLErrorTimedOut, NSURLErrorUnknown, + NSURLErrorUnsupportedURL, NSURLErrorUserAuthenticationRequired, + NSURLErrorUserCancelledAuthentication, NSURLErrorZeroByteResource, +}; +pub use self::__NSURLHandle::{ + NSFTPPropertyActiveTransferModeKey, NSFTPPropertyFTPProxy, NSFTPPropertyFileOffsetKey, + NSFTPPropertyUserLoginKey, NSFTPPropertyUserPasswordKey, NSHTTPPropertyErrorPageDataKey, + NSHTTPPropertyHTTPProxy, NSHTTPPropertyRedirectionHeadersKey, + NSHTTPPropertyServerHTTPVersionKey, NSHTTPPropertyStatusCodeKey, NSHTTPPropertyStatusReasonKey, + NSURLHandle, NSURLHandleClient, NSURLHandleLoadFailed, NSURLHandleLoadInProgress, + NSURLHandleLoadSucceeded, NSURLHandleNotLoaded, NSURLHandleStatus, +}; +pub use self::__NSURLProtectionSpace::{ + NSURLAuthenticationMethodClientCertificate, NSURLAuthenticationMethodDefault, + NSURLAuthenticationMethodHTMLForm, NSURLAuthenticationMethodHTTPBasic, + NSURLAuthenticationMethodHTTPDigest, NSURLAuthenticationMethodNTLM, + NSURLAuthenticationMethodNegotiate, NSURLAuthenticationMethodServerTrust, NSURLProtectionSpace, + NSURLProtectionSpaceFTP, NSURLProtectionSpaceFTPProxy, NSURLProtectionSpaceHTTP, + NSURLProtectionSpaceHTTPProxy, NSURLProtectionSpaceHTTPS, NSURLProtectionSpaceHTTPSProxy, + NSURLProtectionSpaceSOCKSProxy, +}; +pub use self::__NSURLProtocol::{NSURLProtocol, NSURLProtocolClient}; +pub use self::__NSURLRequest::{ + NSMutableURLRequest, NSURLNetworkServiceTypeAVStreaming, NSURLNetworkServiceTypeBackground, + NSURLNetworkServiceTypeCallSignaling, NSURLNetworkServiceTypeDefault, + NSURLNetworkServiceTypeResponsiveAV, NSURLNetworkServiceTypeResponsiveData, + NSURLNetworkServiceTypeVideo, NSURLNetworkServiceTypeVoIP, NSURLNetworkServiceTypeVoice, + NSURLRequest, NSURLRequestAttribution, NSURLRequestAttributionDeveloper, + NSURLRequestAttributionUser, NSURLRequestCachePolicy, NSURLRequestNetworkServiceType, + NSURLRequestReloadIgnoringCacheData, NSURLRequestReloadIgnoringLocalAndRemoteCacheData, + NSURLRequestReloadIgnoringLocalCacheData, NSURLRequestReloadRevalidatingCacheData, + NSURLRequestReturnCacheDataDontLoad, NSURLRequestReturnCacheDataElseLoad, + NSURLRequestUseProtocolCachePolicy, +}; +pub use self::__NSURLResponse::{NSHTTPURLResponse, NSURLResponse}; +pub use self::__NSURLSession::{ + NSURLSession, NSURLSessionAuthChallengeCancelAuthenticationChallenge, + NSURLSessionAuthChallengeDisposition, NSURLSessionAuthChallengePerformDefaultHandling, + NSURLSessionAuthChallengeRejectProtectionSpace, NSURLSessionAuthChallengeUseCredential, + NSURLSessionConfiguration, NSURLSessionDataDelegate, NSURLSessionDataTask, + NSURLSessionDelayedRequestCancel, NSURLSessionDelayedRequestContinueLoading, + NSURLSessionDelayedRequestDisposition, NSURLSessionDelayedRequestUseNewRequest, + NSURLSessionDelegate, NSURLSessionDownloadDelegate, NSURLSessionDownloadTask, + NSURLSessionDownloadTaskResumeData, NSURLSessionMultipathServiceType, + NSURLSessionMultipathServiceTypeAggregate, NSURLSessionMultipathServiceTypeHandover, + NSURLSessionMultipathServiceTypeInteractive, NSURLSessionMultipathServiceTypeNone, + NSURLSessionResponseAllow, NSURLSessionResponseBecomeDownload, + NSURLSessionResponseBecomeStream, NSURLSessionResponseCancel, NSURLSessionResponseDisposition, + NSURLSessionStreamDelegate, NSURLSessionStreamTask, NSURLSessionTask, NSURLSessionTaskDelegate, + NSURLSessionTaskMetrics, NSURLSessionTaskMetricsDomainResolutionProtocol, + NSURLSessionTaskMetricsDomainResolutionProtocolHTTPS, + NSURLSessionTaskMetricsDomainResolutionProtocolTCP, + NSURLSessionTaskMetricsDomainResolutionProtocolTLS, + NSURLSessionTaskMetricsDomainResolutionProtocolUDP, + NSURLSessionTaskMetricsDomainResolutionProtocolUnknown, + NSURLSessionTaskMetricsResourceFetchType, NSURLSessionTaskMetricsResourceFetchTypeLocalCache, + NSURLSessionTaskMetricsResourceFetchTypeNetworkLoad, + NSURLSessionTaskMetricsResourceFetchTypeServerPush, + NSURLSessionTaskMetricsResourceFetchTypeUnknown, NSURLSessionTaskPriorityDefault, + NSURLSessionTaskPriorityHigh, NSURLSessionTaskPriorityLow, NSURLSessionTaskState, + NSURLSessionTaskStateCanceling, NSURLSessionTaskStateCompleted, NSURLSessionTaskStateRunning, + NSURLSessionTaskStateSuspended, NSURLSessionTaskTransactionMetrics, + NSURLSessionTransferSizeUnknown, NSURLSessionUploadTask, NSURLSessionWebSocketCloseCode, + NSURLSessionWebSocketCloseCodeAbnormalClosure, NSURLSessionWebSocketCloseCodeGoingAway, + NSURLSessionWebSocketCloseCodeInternalServerError, NSURLSessionWebSocketCloseCodeInvalid, + NSURLSessionWebSocketCloseCodeInvalidFramePayloadData, + NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing, + NSURLSessionWebSocketCloseCodeMessageTooBig, NSURLSessionWebSocketCloseCodeNoStatusReceived, + NSURLSessionWebSocketCloseCodeNormalClosure, NSURLSessionWebSocketCloseCodePolicyViolation, + NSURLSessionWebSocketCloseCodeProtocolError, NSURLSessionWebSocketCloseCodeTLSHandshakeFailure, + NSURLSessionWebSocketCloseCodeUnsupportedData, NSURLSessionWebSocketDelegate, + NSURLSessionWebSocketMessage, NSURLSessionWebSocketMessageType, + NSURLSessionWebSocketMessageTypeData, NSURLSessionWebSocketMessageTypeString, + NSURLSessionWebSocketTask, +}; +pub use self::__NSUbiquitousKeyValueStore::{ + NSUbiquitousKeyValueStore, NSUbiquitousKeyValueStoreAccountChange, + NSUbiquitousKeyValueStoreChangeReasonKey, NSUbiquitousKeyValueStoreChangedKeysKey, + NSUbiquitousKeyValueStoreDidChangeExternallyNotification, + NSUbiquitousKeyValueStoreInitialSyncChange, NSUbiquitousKeyValueStoreQuotaViolationChange, + NSUbiquitousKeyValueStoreServerChange, +}; +pub use self::__NSUndoManager::{ + NSUndoCloseGroupingRunLoopOrdering, NSUndoManager, NSUndoManagerCheckpointNotification, + NSUndoManagerDidCloseUndoGroupNotification, NSUndoManagerDidOpenUndoGroupNotification, + NSUndoManagerDidRedoChangeNotification, NSUndoManagerDidUndoChangeNotification, + NSUndoManagerGroupIsDiscardableKey, NSUndoManagerWillCloseUndoGroupNotification, + NSUndoManagerWillRedoChangeNotification, NSUndoManagerWillUndoChangeNotification, +}; +pub use self::__NSUnit::{ + NSDimension, NSUnit, NSUnitAcceleration, NSUnitAngle, NSUnitArea, NSUnitConcentrationMass, + NSUnitConverter, NSUnitConverterLinear, NSUnitDispersion, NSUnitDuration, NSUnitElectricCharge, + NSUnitElectricCurrent, NSUnitElectricPotentialDifference, NSUnitElectricResistance, + NSUnitEnergy, NSUnitFrequency, NSUnitFuelEfficiency, NSUnitIlluminance, + NSUnitInformationStorage, NSUnitLength, NSUnitMass, NSUnitPower, NSUnitPressure, NSUnitSpeed, + NSUnitTemperature, NSUnitVolume, +}; +pub use self::__NSUserActivity::{ + NSUserActivity, NSUserActivityDelegate, NSUserActivityPersistentIdentifier, + NSUserActivityTypeBrowsingWeb, +}; +pub use self::__NSUserDefaults::{ + NSAMPMDesignation, NSArgumentDomain, NSCurrencySymbol, NSDateFormatString, NSDateTimeOrdering, + NSDecimalDigits, NSDecimalSeparator, NSEarlierTimeDesignations, NSGlobalDomain, + NSHourNameDesignations, NSInternationalCurrencyString, NSLaterTimeDesignations, + NSMonthNameArray, NSNegativeCurrencyFormatString, NSNextDayDesignations, + NSNextNextDayDesignations, NSPositiveCurrencyFormatString, NSPriorDayDesignations, + NSRegistrationDomain, NSShortDateFormatString, NSShortMonthNameArray, + NSShortTimeDateFormatString, NSShortWeekDayNameArray, NSThisDayDesignations, + NSThousandsSeparator, NSTimeDateFormatString, NSTimeFormatString, + NSUbiquitousUserDefaultsCompletedInitialSyncNotification, + NSUbiquitousUserDefaultsDidChangeAccountsNotification, + NSUbiquitousUserDefaultsNoCloudAccountNotification, NSUserDefaults, + NSUserDefaultsDidChangeNotification, NSUserDefaultsSizeLimitExceededNotification, + NSWeekDayNameArray, NSYearMonthWeekDesignations, +}; +pub use self::__NSUserNotification::{ + NSUserNotification, NSUserNotificationAction, NSUserNotificationActivationType, + NSUserNotificationActivationTypeActionButtonClicked, + NSUserNotificationActivationTypeAdditionalActionClicked, + NSUserNotificationActivationTypeContentsClicked, NSUserNotificationActivationTypeNone, + NSUserNotificationActivationTypeReplied, NSUserNotificationCenter, + NSUserNotificationCenterDelegate, NSUserNotificationDefaultSoundName, +}; +pub use self::__NSUserScriptTask::{ + NSUserAppleScriptTask, NSUserAppleScriptTaskCompletionHandler, NSUserAutomatorTask, + NSUserAutomatorTaskCompletionHandler, NSUserScriptTask, NSUserScriptTaskCompletionHandler, + NSUserUnixTask, NSUserUnixTaskCompletionHandler, +}; +pub use self::__NSValue::{NSNumber, NSValue}; +pub use self::__NSValueTransformer::{ + NSIsNilTransformerName, NSIsNotNilTransformerName, NSKeyedUnarchiveFromDataTransformerName, + NSNegateBooleanTransformerName, NSSecureUnarchiveFromDataTransformer, + NSSecureUnarchiveFromDataTransformerName, NSUnarchiveFromDataTransformerName, + NSValueTransformer, NSValueTransformerName, +}; +pub use self::__NSXMLDTDNode::{ + NSXMLAttributeCDATAKind, NSXMLAttributeEntitiesKind, NSXMLAttributeEntityKind, + NSXMLAttributeEnumerationKind, NSXMLAttributeIDKind, NSXMLAttributeIDRefKind, + NSXMLAttributeIDRefsKind, NSXMLAttributeNMTokenKind, NSXMLAttributeNMTokensKind, + NSXMLAttributeNotationKind, NSXMLDTDNode, NSXMLDTDNodeKind, NSXMLElementDeclarationAnyKind, + NSXMLElementDeclarationElementKind, NSXMLElementDeclarationEmptyKind, + NSXMLElementDeclarationMixedKind, NSXMLElementDeclarationUndefinedKind, NSXMLEntityGeneralKind, + NSXMLEntityParameterKind, NSXMLEntityParsedKind, NSXMLEntityPredefined, + NSXMLEntityUnparsedKind, +}; +pub use self::__NSXMLDocument::{ + NSXMLDocument, NSXMLDocumentContentKind, NSXMLDocumentHTMLKind, NSXMLDocumentTextKind, + NSXMLDocumentXHTMLKind, NSXMLDocumentXMLKind, +}; +pub use self::__NSXMLElement::NSXMLElement; +pub use self::__NSXMLNode::{ + NSXMLAttributeDeclarationKind, NSXMLAttributeKind, NSXMLCommentKind, NSXMLDTDKind, + NSXMLDocumentKind, NSXMLElementDeclarationKind, NSXMLElementKind, NSXMLEntityDeclarationKind, + NSXMLInvalidKind, NSXMLNamespaceKind, NSXMLNode, NSXMLNodeKind, NSXMLNotationDeclarationKind, + NSXMLProcessingInstructionKind, NSXMLTextKind, +}; +pub use self::__NSXMLNodeOptions::{ + NSXMLDocumentIncludeContentTypeDeclaration, NSXMLDocumentTidyHTML, NSXMLDocumentTidyXML, + NSXMLDocumentValidate, NSXMLDocumentXInclude, NSXMLNodeCompactEmptyElement, + NSXMLNodeExpandEmptyElement, NSXMLNodeIsCDATA, NSXMLNodeLoadExternalEntitiesAlways, + NSXMLNodeLoadExternalEntitiesNever, NSXMLNodeLoadExternalEntitiesSameOriginOnly, + NSXMLNodeNeverEscapeContents, NSXMLNodeOptions, NSXMLNodeOptionsNone, NSXMLNodePreserveAll, + NSXMLNodePreserveAttributeOrder, NSXMLNodePreserveCDATA, NSXMLNodePreserveCharacterReferences, + NSXMLNodePreserveDTD, NSXMLNodePreserveEmptyElements, NSXMLNodePreserveEntities, + NSXMLNodePreserveNamespaceOrder, NSXMLNodePreservePrefixes, NSXMLNodePreserveQuotes, + NSXMLNodePreserveWhitespace, NSXMLNodePrettyPrint, NSXMLNodePromoteSignificantWhitespace, + NSXMLNodeUseDoubleQuotes, NSXMLNodeUseSingleQuotes, +}; +pub use self::__NSXMLParser::{ + NSXMLParser, NSXMLParserAttributeHasNoValueError, NSXMLParserAttributeListNotFinishedError, + NSXMLParserAttributeListNotStartedError, NSXMLParserAttributeNotFinishedError, + NSXMLParserAttributeNotStartedError, NSXMLParserAttributeRedefinedError, + NSXMLParserCDATANotFinishedError, NSXMLParserCharacterRefAtEOFError, + NSXMLParserCharacterRefInDTDError, NSXMLParserCharacterRefInEpilogError, + NSXMLParserCharacterRefInPrologError, NSXMLParserCommentContainsDoubleHyphenError, + NSXMLParserCommentNotFinishedError, NSXMLParserConditionalSectionNotFinishedError, + NSXMLParserConditionalSectionNotStartedError, NSXMLParserDOCTYPEDeclNotFinishedError, + NSXMLParserDelegate, NSXMLParserDelegateAbortedParseError, NSXMLParserDocumentStartError, + NSXMLParserElementContentDeclNotFinishedError, NSXMLParserElementContentDeclNotStartedError, + NSXMLParserEmptyDocumentError, NSXMLParserEncodingNotSupportedError, + NSXMLParserEntityBoundaryError, NSXMLParserEntityIsExternalError, + NSXMLParserEntityIsParameterError, NSXMLParserEntityNotFinishedError, + NSXMLParserEntityNotStartedError, NSXMLParserEntityRefAtEOFError, + NSXMLParserEntityRefInDTDError, NSXMLParserEntityRefInEpilogError, + NSXMLParserEntityRefInPrologError, NSXMLParserEntityRefLoopError, + NSXMLParserEntityReferenceMissingSemiError, NSXMLParserEntityReferenceWithoutNameError, + NSXMLParserEntityValueRequiredError, NSXMLParserEqualExpectedError, NSXMLParserError, + NSXMLParserErrorDomain, NSXMLParserExternalEntityResolvingPolicy, + NSXMLParserExternalStandaloneEntityError, NSXMLParserExternalSubsetNotFinishedError, + NSXMLParserExtraContentError, NSXMLParserGTRequiredError, NSXMLParserInternalError, + NSXMLParserInvalidCharacterError, NSXMLParserInvalidCharacterInEntityError, + NSXMLParserInvalidCharacterRefError, NSXMLParserInvalidConditionalSectionError, + NSXMLParserInvalidDecimalCharacterRefError, NSXMLParserInvalidEncodingError, + NSXMLParserInvalidEncodingNameError, NSXMLParserInvalidHexCharacterRefError, + NSXMLParserInvalidURIError, NSXMLParserLTRequiredError, NSXMLParserLTSlashRequiredError, + NSXMLParserLessThanSymbolInAttributeError, NSXMLParserLiteralNotFinishedError, + NSXMLParserLiteralNotStartedError, NSXMLParserMisplacedCDATAEndStringError, + NSXMLParserMisplacedXMLDeclarationError, NSXMLParserMixedContentDeclNotFinishedError, + NSXMLParserMixedContentDeclNotStartedError, NSXMLParserNAMERequiredError, + NSXMLParserNMTOKENRequiredError, NSXMLParserNamespaceDeclarationError, NSXMLParserNoDTDError, + NSXMLParserNotWellBalancedError, NSXMLParserNotationNotFinishedError, + NSXMLParserNotationNotStartedError, NSXMLParserOutOfMemoryError, + NSXMLParserPCDATARequiredError, NSXMLParserParsedEntityRefAtEOFError, + NSXMLParserParsedEntityRefInEpilogError, NSXMLParserParsedEntityRefInInternalError, + NSXMLParserParsedEntityRefInInternalSubsetError, NSXMLParserParsedEntityRefInPrologError, + NSXMLParserParsedEntityRefMissingSemiError, NSXMLParserParsedEntityRefNoNameError, + NSXMLParserPrematureDocumentEndError, NSXMLParserProcessingInstructionNotFinishedError, + NSXMLParserProcessingInstructionNotStartedError, NSXMLParserPublicIdentifierRequiredError, + NSXMLParserResolveExternalEntitiesAlways, NSXMLParserResolveExternalEntitiesNever, + NSXMLParserResolveExternalEntitiesNoNetwork, NSXMLParserResolveExternalEntitiesSameOriginOnly, + NSXMLParserSeparatorRequiredError, NSXMLParserSpaceRequiredError, + NSXMLParserStandaloneValueError, NSXMLParserStringNotClosedError, + NSXMLParserStringNotStartedError, NSXMLParserTagNameMismatchError, NSXMLParserURIFragmentError, + NSXMLParserURIRequiredError, NSXMLParserUndeclaredEntityError, NSXMLParserUnfinishedTagError, + NSXMLParserUnknownEncodingError, NSXMLParserUnparsedEntityError, + NSXMLParserXMLDeclNotFinishedError, NSXMLParserXMLDeclNotStartedError, +}; +pub use self::__NSXPCConnection::{ + NSXPCCoder, NSXPCConnection, NSXPCConnectionOptions, NSXPCConnectionPrivileged, NSXPCInterface, + NSXPCListener, NSXPCListenerDelegate, NSXPCListenerEndpoint, NSXPCProxyCreating, +}; +pub use self::__NSZone::{ + NSAllocateCollectable, NSAllocateMemoryPages, NSCollectorDisabledOption, NSCopyMemoryPages, + NSCreateZone, NSDeallocateMemoryPages, NSDefaultMallocZone, NSLogPageSize, NSPageSize, + NSRealMemoryAvailable, NSReallocateCollectable, NSRecycleZone, NSRoundDownToMultipleOfPageSize, + NSRoundUpToMultipleOfPageSize, NSScannedOption, NSSetZoneName, NSZoneCalloc, NSZoneFree, + NSZoneFromPointer, NSZoneMalloc, NSZoneName, NSZoneRealloc, +}; +pub use self::__NSURL::{ + NSFileSecurity, NSThumbnail1024x1024SizeKey, NSURLAddedToDirectoryDateKey, + NSURLApplicationIsScriptableKey, NSURLAttributeModificationDateKey, + NSURLBookmarkCreationMinimalBookmark, NSURLBookmarkCreationOptions, + NSURLBookmarkCreationPreferFileIDResolution, + NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess, + NSURLBookmarkCreationSuitableForBookmarkFile, NSURLBookmarkCreationWithSecurityScope, + NSURLBookmarkCreationWithoutImplicitSecurityScope, NSURLBookmarkFileCreationOptions, + NSURLBookmarkResolutionOptions, NSURLBookmarkResolutionWithSecurityScope, + NSURLBookmarkResolutionWithoutImplicitStartAccessing, NSURLBookmarkResolutionWithoutMounting, + NSURLBookmarkResolutionWithoutUI, NSURLCanonicalPathKey, NSURLComponents, + NSURLContentAccessDateKey, NSURLContentModificationDateKey, NSURLContentTypeKey, + NSURLCreationDateKey, NSURLCustomIconKey, NSURLDocumentIdentifierKey, NSURLEffectiveIconKey, + NSURLFileAllocatedSizeKey, NSURLFileContentIdentifierKey, NSURLFileProtectionComplete, + NSURLFileProtectionCompleteUnlessOpen, NSURLFileProtectionCompleteUntilFirstUserAuthentication, + NSURLFileProtectionKey, NSURLFileProtectionNone, NSURLFileProtectionType, + NSURLFileResourceIdentifierKey, NSURLFileResourceType, NSURLFileResourceTypeBlockSpecial, + NSURLFileResourceTypeCharacterSpecial, NSURLFileResourceTypeDirectory, + NSURLFileResourceTypeKey, NSURLFileResourceTypeNamedPipe, NSURLFileResourceTypeRegular, + NSURLFileResourceTypeSocket, NSURLFileResourceTypeSymbolicLink, NSURLFileResourceTypeUnknown, + NSURLFileScheme, NSURLFileSecurityKey, NSURLFileSizeKey, NSURLGenerationIdentifierKey, + NSURLHasHiddenExtensionKey, NSURLIsAliasFileKey, NSURLIsApplicationKey, NSURLIsDirectoryKey, + NSURLIsExcludedFromBackupKey, NSURLIsExecutableKey, NSURLIsHiddenKey, NSURLIsMountTriggerKey, + NSURLIsPackageKey, NSURLIsPurgeableKey, NSURLIsReadableKey, NSURLIsRegularFileKey, + NSURLIsSparseKey, NSURLIsSymbolicLinkKey, NSURLIsSystemImmutableKey, NSURLIsUbiquitousItemKey, + NSURLIsUserImmutableKey, NSURLIsVolumeKey, NSURLIsWritableKey, NSURLKeysOfUnsetValuesKey, + NSURLLabelColorKey, NSURLLabelNumberKey, NSURLLinkCountKey, NSURLLocalizedLabelKey, + NSURLLocalizedNameKey, NSURLLocalizedTypeDescriptionKey, NSURLMayHaveExtendedAttributesKey, + NSURLMayShareFileContentKey, NSURLNameKey, NSURLParentDirectoryURLKey, NSURLPathKey, + NSURLPreferredIOBlockSizeKey, NSURLQuarantinePropertiesKey, NSURLQueryItem, NSURLResourceKey, + NSURLTagNamesKey, NSURLThumbnailDictionaryItem, NSURLThumbnailDictionaryKey, NSURLThumbnailKey, + NSURLTotalFileAllocatedSizeKey, NSURLTotalFileSizeKey, NSURLTypeIdentifierKey, + NSURLUbiquitousItemContainerDisplayNameKey, NSURLUbiquitousItemDownloadRequestedKey, + NSURLUbiquitousItemDownloadingErrorKey, NSURLUbiquitousItemDownloadingStatus, + NSURLUbiquitousItemDownloadingStatusCurrent, NSURLUbiquitousItemDownloadingStatusDownloaded, + NSURLUbiquitousItemDownloadingStatusKey, NSURLUbiquitousItemDownloadingStatusNotDownloaded, + NSURLUbiquitousItemHasUnresolvedConflictsKey, NSURLUbiquitousItemIsDownloadedKey, + NSURLUbiquitousItemIsDownloadingKey, NSURLUbiquitousItemIsExcludedFromSyncKey, + NSURLUbiquitousItemIsSharedKey, NSURLUbiquitousItemIsUploadedKey, + NSURLUbiquitousItemIsUploadingKey, NSURLUbiquitousItemPercentDownloadedKey, + NSURLUbiquitousItemPercentUploadedKey, NSURLUbiquitousItemUploadingErrorKey, + NSURLUbiquitousSharedItemCurrentUserPermissionsKey, + NSURLUbiquitousSharedItemCurrentUserRoleKey, + NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey, + NSURLUbiquitousSharedItemOwnerNameComponentsKey, NSURLUbiquitousSharedItemPermissions, + NSURLUbiquitousSharedItemPermissionsReadOnly, NSURLUbiquitousSharedItemPermissionsReadWrite, + NSURLUbiquitousSharedItemRole, NSURLUbiquitousSharedItemRoleOwner, + NSURLUbiquitousSharedItemRoleParticipant, NSURLVolumeAvailableCapacityForImportantUsageKey, + NSURLVolumeAvailableCapacityForOpportunisticUsageKey, NSURLVolumeAvailableCapacityKey, + NSURLVolumeCreationDateKey, NSURLVolumeIdentifierKey, NSURLVolumeIsAutomountedKey, + NSURLVolumeIsBrowsableKey, NSURLVolumeIsEjectableKey, NSURLVolumeIsEncryptedKey, + NSURLVolumeIsInternalKey, NSURLVolumeIsJournalingKey, NSURLVolumeIsLocalKey, + NSURLVolumeIsReadOnlyKey, NSURLVolumeIsRemovableKey, NSURLVolumeIsRootFileSystemKey, + NSURLVolumeLocalizedFormatDescriptionKey, NSURLVolumeLocalizedNameKey, + NSURLVolumeMaximumFileSizeKey, NSURLVolumeNameKey, NSURLVolumeResourceCountKey, + NSURLVolumeSupportsAccessPermissionsKey, NSURLVolumeSupportsAdvisoryFileLockingKey, + NSURLVolumeSupportsCasePreservedNamesKey, NSURLVolumeSupportsCaseSensitiveNamesKey, + NSURLVolumeSupportsCompressionKey, NSURLVolumeSupportsExclusiveRenamingKey, + NSURLVolumeSupportsExtendedSecurityKey, NSURLVolumeSupportsFileCloningKey, + NSURLVolumeSupportsFileProtectionKey, NSURLVolumeSupportsHardLinksKey, + NSURLVolumeSupportsImmutableFilesKey, NSURLVolumeSupportsJournalingKey, + NSURLVolumeSupportsPersistentIDsKey, NSURLVolumeSupportsRenamingKey, + NSURLVolumeSupportsRootDirectoryDatesKey, NSURLVolumeSupportsSparseFilesKey, + NSURLVolumeSupportsSwapRenamingKey, NSURLVolumeSupportsSymbolicLinksKey, + NSURLVolumeSupportsVolumeSizesKey, NSURLVolumeSupportsZeroRunsKey, NSURLVolumeTotalCapacityKey, + NSURLVolumeURLForRemountingKey, NSURLVolumeURLKey, NSURLVolumeUUIDStringKey, NSURL, +}; +pub use self::__NSUUID::NSUUID; +pub use self::__NSXMLDTD::NSXMLDTD; diff --git a/crates/icrate/src/lib.rs b/crates/icrate/src/lib.rs new file mode 100644 index 000000000..cab69e8d4 --- /dev/null +++ b/crates/icrate/src/lib.rs @@ -0,0 +1,292 @@ +#![no_std] +#![warn(elided_lifetimes_in_paths)] +#![deny(non_ascii_idents)] +#![warn(unreachable_pub)] +#![deny(unsafe_op_in_unsafe_fn)] +#![warn(clippy::cargo)] +#![warn(clippy::ptr_as_ptr)] +#![allow(clippy::upper_case_acronyms)] +#![allow(non_camel_case_types)] +#![allow(non_upper_case_globals)] +#![allow(non_snake_case)] +// Update in Cargo.toml as well. +#![doc(html_root_url = "https://docs.rs/icrate/0.0.1")] +#![recursion_limit = "512"] + +#[cfg(feature = "std")] +extern crate std; + +macro_rules! extern_protocol { + ( + $v:vis struct $name:ident; + + $($rest:tt)* + ) => { + // TODO + $v type $name = NSObject; + }; +} + +macro_rules! extern_struct { + ( + $v:vis struct $name:ident { + $($field_v:vis $field:ident: $ty:ty),* $(,)? + } + ) => { + #[repr(C)] + #[derive(Clone, Copy, Debug, PartialEq)] + $v struct $name { + $($field_v $field: $ty,)* + } + + #[cfg(feature = "objective-c")] + unsafe impl objc2::Encode for $name { + const ENCODING: objc2::Encoding = objc2::Encoding::Struct( + stringify!($name), + &[$(<$ty as objc2::Encode>::ENCODING),*], + ); + } + + #[cfg(feature = "objective-c")] + unsafe impl objc2::RefEncode for $name { + const ENCODING_REF: objc2::Encoding = objc2::Encoding::Pointer(&::ENCODING); + } + }; +} + +macro_rules! extern_enum { + ( + #[underlying($ty:ty)] + $v:vis enum $name:ident { + $($field:ident = $value:expr),* $(,)? + } + ) => { + // TODO: Improve type-safety + $v type $name = $ty; + + extern_enum! { + @__inner + @($v) + @($name) + @($($field = $value,)*) + } + }; + ( + #[underlying($ty:ty)] + $v:vis enum { + $($field:ident = $value:expr),* $(,)? + } + ) => { + extern_enum! { + @__inner + @($v) + @($ty) + @($($field = $value,)*) + } + }; + + // tt-munch each field + ( + @__inner + @($v:vis) + @($ty:ty) + @() + ) => { + // Base case + }; + ( + @__inner + @($v:vis) + @($ty:ty) + @( + $field:ident = $value:expr, + $($rest:tt)* + ) + ) => { + $v const $field: $ty = $value; + + extern_enum! { + @__inner + @($v) + @($ty) + @($($rest)*) + } + }; +} + +/// Corresponds to `NS_ENUM` +macro_rules! ns_enum { + ( + #[underlying($ty:ty)] + $v:vis enum $($name:ident)? { + $($field:ident = $value:expr),* $(,)? + } + ) => { + extern_enum! { + #[underlying($ty)] + $v enum $($name)? { + $($field = $value),* + } + } + }; +} + +/// Corresponds to `NS_OPTIONS` +macro_rules! ns_options { + ( + #[underlying($ty:ty)] + $v:vis enum $name:ident { + $($field:ident = $value:expr),* $(,)? + } + ) => { + // TODO: Handle this differently (e.g. as `bitflags`) + extern_enum! { + #[underlying($ty)] + $v enum $name { + $($field = $value),* + } + } + }; +} + +/// Corresponds to `NS_CLOSED_ENUM` +macro_rules! ns_closed_enum { + ( + #[underlying(NSUInteger)] + $v:vis enum $name:ident { + $($field:ident = $value:expr),* $(,)? + } + ) => { + // TODO: Handle this differently + extern_enum! { + #[underlying(NSUInteger)] + $v enum $name { + $($field = $value),* + } + } + }; + ( + #[underlying(NSInteger)] + $v:vis enum $name:ident { + $($field:ident = $value:expr),* $(,)? + } + ) => { + // TODO: Handle this differently + extern_enum! { + #[underlying(NSInteger)] + $v enum $name { + $($field = $value),* + } + } + }; +} + +/// Corresponds to `NS_ERROR_ENUM` +macro_rules! ns_error_enum { + ( + #[underlying(NSInteger)] + $v:vis enum $($name:ident)? { + $($field:ident = $value:expr),* $(,)? + } + ) => { + // TODO: Handle this differently + extern_enum! { + #[underlying(NSInteger)] + $v enum $($name)? { + $($field = $value),* + } + } + }; +} + +macro_rules! extern_static { + ($name:ident: $ty:ty) => { + extern "C" { + pub static $name: $ty; + } + }; + // Floats in statics are broken + ($name:ident: NSAppKitVersion = $($value:tt)*) => { + pub static $name: NSAppKitVersion = $($value)* as _; + }; + ($name:ident: NSLayoutPriority = $($value:tt)*) => { + pub static $name: NSLayoutPriority = $($value)* as _; + }; + ($name:ident: NSStackViewVisibilityPriority = $($value:tt)*) => { + pub static $name: NSStackViewVisibilityPriority = $($value)* as _; + }; + ($name:ident: NSTouchBarItemPriority = $($value:tt)*) => { + pub static $name: NSTouchBarItemPriority = $($value)* as _; + }; + ($name:ident: $ty:ty = $value:expr) => { + pub static $name: $ty = $value; + }; +} + +macro_rules! extern_fn { + ( + $v:vis unsafe fn $name:ident($($args:tt)*) $(-> $res:ty)?; + ) => { + extern "C" { + $v fn $name($($args)*) $(-> $res)?; + } + }; +} + +macro_rules! inline_fn { + ( + $v:vis unsafe fn $name:ident($($args:tt)*) $(-> $res:ty)? $body:block + ) => { + // TODO + }; +} + +// Frameworks +#[cfg(feature = "AppKit")] +pub mod AppKit; +#[cfg(feature = "AuthenticationServices")] +pub mod AuthenticationServices; +#[cfg(feature = "CoreData")] +pub mod CoreData; +#[cfg(feature = "Foundation")] +pub mod Foundation; + +#[allow(unused_imports)] +mod common { + pub(crate) use std::ffi::{ + c_char, c_double, c_float, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint, + c_ulong, c_ulonglong, c_ushort, c_void, + }; + pub(crate) use std::marker::PhantomData; + pub(crate) use std::ptr::NonNull; + + pub(crate) use objc2::ffi::{NSInteger, NSUInteger}; + pub(crate) use objc2::rc::{Allocated, Id, Shared}; + pub(crate) use objc2::runtime::{Bool, Class, Object, Sel}; + pub(crate) use objc2::{ + __inner_extern_class, extern_class, extern_methods, ClassType, Message, + }; + + // TODO + #[repr(C)] + pub struct OptionSel(*const objc2::ffi::objc_selector); + unsafe impl objc2::Encode for OptionSel { + const ENCODING: objc2::Encoding = objc2::Encoding::Sel; + } + + #[cfg(feature = "blocks")] + pub(crate) use block2::Block; + + // TODO + pub(crate) type Protocol = Object; + pub(crate) type TodoFunction = *const c_void; + pub(crate) type TodoClass = Object; + pub(crate) type TodoProtocols = Object; + + // MacTypes.h + pub(crate) type Boolean = u8; // unsigned char + pub(crate) type FourCharCode = u32; + pub(crate) type OSType = FourCharCode; + pub(crate) type ResType = FourCharCode; + pub(crate) type UTF32Char = u32; // Or maybe Rust's char? +} diff --git a/crates/objc2/src/macros.rs b/crates/objc2/src/macros.rs index 71865fcf5..a02626e0f 100644 --- a/crates/objc2/src/macros.rs +++ b/crates/objc2/src/macros.rs @@ -1079,6 +1079,20 @@ macro_rules! msg_send_id { result = <$crate::__macro_helpers::Init as $crate::__macro_helpers::MsgSendId<_, _>>::send_message_id($obj, sel, ()); result }); + [$obj:expr, @__retain_semantics $retain_semantics:ident $($selector_and_arguments:tt)+] => { + $crate::__msg_send_parse! { + ($crate::__msg_send_id_helper) + @(send_message_id_error) + @() + @() + @($($selector_and_arguments)+) + @(send_message_id) + + @($obj) + @($retain_semantics) + } + // compile_error!(stringify!($($selector_and_arguments)*)) + }; [$obj:expr, $($selector_and_arguments:tt)+] => { $crate::__msg_send_parse! { ($crate::__msg_send_id_helper) @@ -1089,6 +1103,7 @@ macro_rules! msg_send_id { @(send_message_id) @($obj) + @() } }; } @@ -1100,6 +1115,7 @@ macro_rules! __msg_send_id_helper { { @($fn:ident) @($obj:expr) + @($($retain_semantics:ident)?) @(retain) @() } => {{ @@ -1110,6 +1126,7 @@ macro_rules! __msg_send_id_helper { { @($fn:ident) @($obj:expr) + @($($retain_semantics:ident)?) @(release) @() } => {{ @@ -1120,6 +1137,7 @@ macro_rules! __msg_send_id_helper { { @($fn:ident) @($obj:expr) + @($($retain_semantics:ident)?) @(autorelease) @() } => {{ @@ -1130,6 +1148,7 @@ macro_rules! __msg_send_id_helper { { @($fn:ident) @($obj:expr) + @($($retain_semantics:ident)?) @(dealloc) @() } => {{ @@ -1140,6 +1159,20 @@ macro_rules! __msg_send_id_helper { { @($fn:ident) @($obj:expr) + @($retain_semantics:ident) + @($sel_first:ident $(: $($sel_rest:ident :)*)?) + @($($argument:expr,)*) + } => ({ + <$crate::__macro_helpers::$retain_semantics as $crate::__macro_helpers::MsgSendId<_, _>>::$fn::<_, _>( + $obj, + $crate::sel!($sel_first $(: $($sel_rest :)*)?), + ($($argument,)*), + ) + }); + { + @($fn:ident) + @($obj:expr) + @() @($sel_first:ident $(: $($sel_rest:ident :)*)?) @($($argument:expr,)*) } => ({ diff --git a/crates/objc2/src/macros/extern_class.rs b/crates/objc2/src/macros/extern_class.rs index 3164c802e..1876a99d9 100644 --- a/crates/objc2/src/macros/extern_class.rs +++ b/crates/objc2/src/macros/extern_class.rs @@ -245,7 +245,7 @@ macro_rules! __inner_extern_class { // TODO: Expose this variant of the macro. ( $(#[$m:meta])* - $v:vis struct $name:ident<$($t_struct:ident $(: $b_struct:ident $(= $default:ty)?)?),*> { + $v:vis struct $name:ident<$($t_struct:ident $(: $b_struct:ident $(= $default:ty)?)?),* $(,)?> { $($field_vis:vis $field:ident: $field_ty:ty,)* } diff --git a/crates/objc2/src/macros/extern_methods.rs b/crates/objc2/src/macros/extern_methods.rs index cfb964a35..35eee2a58 100644 --- a/crates/objc2/src/macros/extern_methods.rs +++ b/crates/objc2/src/macros/extern_methods.rs @@ -433,10 +433,10 @@ macro_rules! __collect_msg_send { ( $macro:path; $obj:expr; - ($sel:ident); + ($(@__retain_semantics $retain_semantics:ident )? $sel:ident); (); ) => {{ - $macro![$obj, $sel] + $macro![$obj, $(@__retain_semantics $retain_semantics )? $sel] }}; // Base case @@ -454,7 +454,7 @@ macro_rules! __collect_msg_send { ( $macro:path; $obj:expr; - ($sel:ident:); + ($(@__retain_semantics $retain_semantics:ident )? $sel:ident:); ($(,)?); $($output:tt)* ) => { @@ -463,7 +463,7 @@ macro_rules! __collect_msg_send { $obj; (); (); - $($output)* $sel: _, + $($output)* $(@__retain_semantics $retain_semantics )? $sel: _, } }; @@ -471,7 +471,7 @@ macro_rules! __collect_msg_send { ( $macro:path; $obj:expr; - ($sel:ident : $($sel_rest:tt)*); + ($(@__retain_semantics $retain_semantics:ident )? $sel:ident : $($sel_rest:tt)*); ($arg:ident: $arg_ty:ty $(, $($args_rest:tt)*)?); $($output:tt)* ) => { @@ -480,7 +480,7 @@ macro_rules! __collect_msg_send { $obj; ($($sel_rest)*); ($($($args_rest)*)?); - $($output)* $sel: $arg, + $($output)* $(@__retain_semantics $retain_semantics )? $sel: $arg, } };