#![allow(unused_imports)]
#![allow(deprecated)]
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#![allow(missing_docs)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::type_complexity)]
#![allow(clippy::upper_case_acronyms)]
#![allow(clippy::identity_op)]
#![allow(clippy::missing_safety_doc)]
#[link(name = "FinderSync", kind = "framework")]
extern "C" {}
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
use objc2_app_kit::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct FIFinderSyncController;
unsafe impl ClassType for FIFinderSyncController {
#[inherits(NSObject)]
type Super = NSExtensionContext;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for FIFinderSyncController {}
extern_methods!(
unsafe impl FIFinderSyncController {
#[method_id(@__retain_semantics Other defaultController)]
pub unsafe fn defaultController() -> Retained<Self>;
#[method_id(@__retain_semantics Other directoryURLs)]
pub unsafe fn directoryURLs(&self) -> Retained<NSSet<NSURL>>;
#[method(setDirectoryURLs:)]
pub unsafe fn setDirectoryURLs(&self, directory_ur_ls: Option<&NSSet<NSURL>>);
#[cfg(feature = "objc2-app-kit")]
#[method(setBadgeImage:label:forBadgeIdentifier:)]
pub unsafe fn setBadgeImage_label_forBadgeIdentifier(
&self,
image: &NSImage,
label: Option<&NSString>,
badge_id: &NSString,
);
#[method(setBadgeIdentifier:forURL:)]
pub unsafe fn setBadgeIdentifier_forURL(&self, badge_id: &NSString, url: &NSURL);
#[method_id(@__retain_semantics Other targetedURL)]
pub unsafe fn targetedURL(&self) -> Option<Retained<NSURL>>;
#[method_id(@__retain_semantics Other selectedItemURLs)]
pub unsafe fn selectedItemURLs(&self) -> Option<Retained<NSArray<NSURL>>>;
#[method_id(@__retain_semantics Other lastUsedDateForItemWithURL:)]
pub unsafe fn lastUsedDateForItemWithURL(
&self,
item_url: &NSURL,
) -> Option<Retained<NSDate>>;
#[cfg(feature = "block2")]
#[method(setLastUsedDate:forItemWithURL:completion:)]
pub unsafe fn setLastUsedDate_forItemWithURL_completion(
&self,
last_used_date: &NSDate,
item_url: &NSURL,
completion: &block2::Block<dyn Fn(NonNull<NSError>)>,
);
#[method_id(@__retain_semantics Other tagDataForItemWithURL:)]
pub unsafe fn tagDataForItemWithURL(&self, item_url: &NSURL) -> Option<Retained<NSData>>;
#[cfg(feature = "block2")]
#[method(setTagData:forItemWithURL:completion:)]
pub unsafe fn setTagData_forItemWithURL_completion(
&self,
tag_data: Option<&NSData>,
item_url: &NSURL,
completion: &block2::Block<dyn Fn(NonNull<NSError>)>,
);
#[method(isExtensionEnabled)]
pub unsafe fn isExtensionEnabled() -> bool;
#[method(showExtensionManagementInterface)]
pub unsafe fn showExtensionManagementInterface();
}
);
extern_methods!(
unsafe impl FIFinderSyncController {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct FIMenuKind(pub NSUInteger);
impl FIMenuKind {
#[doc(alias = "FIMenuKindContextualMenuForItems")]
pub const ContextualMenuForItems: Self = Self(0);
#[doc(alias = "FIMenuKindContextualMenuForContainer")]
pub const ContextualMenuForContainer: Self = Self(1);
#[doc(alias = "FIMenuKindContextualMenuForSidebar")]
pub const ContextualMenuForSidebar: Self = Self(2);
#[doc(alias = "FIMenuKindToolbarItemMenu")]
pub const ToolbarItemMenu: Self = Self(3);
}
unsafe impl Encode for FIMenuKind {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for FIMenuKind {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_protocol!(
pub unsafe trait FIFinderSyncProtocol {
#[cfg(feature = "objc2-app-kit")]
#[optional]
#[method_id(@__retain_semantics Other menuForMenuKind:)]
unsafe fn menuForMenuKind(
&self,
menu: FIMenuKind,
mtm: MainThreadMarker,
) -> Option<Retained<NSMenu>>;
#[optional]
#[method(beginObservingDirectoryAtURL:)]
unsafe fn beginObservingDirectoryAtURL(&self, url: &NSURL);
#[optional]
#[method(endObservingDirectoryAtURL:)]
unsafe fn endObservingDirectoryAtURL(&self, url: &NSURL);
#[optional]
#[method(requestBadgeIdentifierForURL:)]
unsafe fn requestBadgeIdentifierForURL(&self, url: &NSURL);
#[optional]
#[method_id(@__retain_semantics Other toolbarItemName)]
unsafe fn toolbarItemName(&self) -> Retained<NSString>;
#[cfg(feature = "objc2-app-kit")]
#[optional]
#[method_id(@__retain_semantics Other toolbarItemImage)]
unsafe fn toolbarItemImage(&self) -> Retained<NSImage>;
#[optional]
#[method_id(@__retain_semantics Other toolbarItemToolTip)]
unsafe fn toolbarItemToolTip(&self) -> Retained<NSString>;
#[optional]
#[method_id(@__retain_semantics Other supportedServiceNamesForItemWithURL:)]
unsafe fn supportedServiceNamesForItemWithURL(
&self,
item_url: &NSURL,
) -> Retained<NSArray<NSFileProviderServiceName>>;
#[optional]
#[method_id(@__retain_semantics Other makeListenerEndpointForServiceName:itemURL:andReturnError:_)]
unsafe fn makeListenerEndpointForServiceName_itemURL_andReturnError(
&self,
service_name: &NSFileProviderServiceName,
item_url: &NSURL,
) -> Result<Retained<NSXPCListenerEndpoint>, Retained<NSError>>;
#[cfg(feature = "block2")]
#[optional]
#[method(valuesForAttributes:forItemWithURL:completion:)]
unsafe fn valuesForAttributes_forItemWithURL_completion(
&self,
attributes: &NSArray<NSURLResourceKey>,
item_url: &NSURL,
completion: &block2::Block<
dyn Fn(NonNull<NSDictionary<NSURLResourceKey, AnyObject>>, *mut NSError),
>,
);
}
unsafe impl ProtocolType for dyn FIFinderSyncProtocol {
const NAME: &'static str = "FIFinderSync";
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct FIFinderSync;
unsafe impl ClassType for FIFinderSync {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl FIFinderSyncProtocol for FIFinderSync {}
unsafe impl NSExtensionRequestHandling for FIFinderSync {}
unsafe impl NSObjectProtocol for FIFinderSync {}
extern_methods!(
unsafe impl FIFinderSync {}
);
extern_methods!(
unsafe impl FIFinderSync {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);