use crate::common::*;
use crate::CallKit::*;
use crate::Foundation::*;
ns_enum!(
#[underlying(NSInteger)]
pub enum CXCallDirectoryEnabledStatus {
CXCallDirectoryEnabledStatusUnknown = 0,
CXCallDirectoryEnabledStatusDisabled = 1,
CXCallDirectoryEnabledStatusEnabled = 2,
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CallKit_CXCallDirectoryManager")]
pub struct CXCallDirectoryManager;
#[cfg(feature = "CallKit_CXCallDirectoryManager")]
unsafe impl ClassType for CXCallDirectoryManager {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
#[cfg(feature = "CallKit_CXCallDirectoryManager")]
unsafe impl NSObjectProtocol for CXCallDirectoryManager {}
extern_methods!(
#[cfg(feature = "CallKit_CXCallDirectoryManager")]
unsafe impl CXCallDirectoryManager {
#[method_id(@__retain_semantics Other sharedInstance)]
pub unsafe fn sharedInstance() -> Id<CXCallDirectoryManager>;
#[cfg(all(feature = "Foundation_NSError", feature = "Foundation_NSString"))]
#[method(reloadExtensionWithIdentifier:completionHandler:)]
pub unsafe fn reloadExtensionWithIdentifier_completionHandler(
&self,
identifier: &NSString,
completion: Option<&Block<(*mut NSError,), ()>>,
);
#[cfg(all(feature = "Foundation_NSError", feature = "Foundation_NSString"))]
#[method(getEnabledStatusForExtensionWithIdentifier:completionHandler:)]
pub unsafe fn getEnabledStatusForExtensionWithIdentifier_completionHandler(
&self,
identifier: &NSString,
completion: &Block<(CXCallDirectoryEnabledStatus, *mut NSError), ()>,
);
#[cfg(feature = "Foundation_NSError")]
#[method(openSettingsWithCompletionHandler:)]
pub unsafe fn openSettingsWithCompletionHandler(
&self,
completion: Option<&Block<(*mut NSError,), ()>>,
);
}
);
extern_methods!(
#[cfg(feature = "CallKit_CXCallDirectoryManager")]
unsafe impl CXCallDirectoryManager {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self>;
}
);