use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CKSharingParticipantAccessOption(pub NSUInteger);
bitflags::bitflags! {
impl CKSharingParticipantAccessOption: NSUInteger {
#[doc(alias = "CKSharingParticipantAccessOptionAnyoneWithLink")]
const AnyoneWithLink = 1<<0;
#[doc(alias = "CKSharingParticipantAccessOptionSpecifiedRecipientsOnly")]
const SpecifiedRecipientsOnly = 1<<1;
#[doc(alias = "CKSharingParticipantAccessOptionAny")]
const Any = CKSharingParticipantAccessOption::AnyoneWithLink.0|CKSharingParticipantAccessOption::SpecifiedRecipientsOnly.0;
}
}
unsafe impl Encode for CKSharingParticipantAccessOption {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for CKSharingParticipantAccessOption {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CKSharingParticipantPermissionOption(pub NSUInteger);
bitflags::bitflags! {
impl CKSharingParticipantPermissionOption: NSUInteger {
#[doc(alias = "CKSharingParticipantPermissionOptionReadOnly")]
const ReadOnly = 1<<0;
#[doc(alias = "CKSharingParticipantPermissionOptionReadWrite")]
const ReadWrite = 1<<1;
#[doc(alias = "CKSharingParticipantPermissionOptionAny")]
const Any = CKSharingParticipantPermissionOption::ReadOnly.0|CKSharingParticipantPermissionOption::ReadWrite.0;
}
}
unsafe impl Encode for CKSharingParticipantPermissionOption {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for CKSharingParticipantPermissionOption {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CKAllowedSharingOptions;
);
extern_conformance!(
unsafe impl NSCoding for CKAllowedSharingOptions {}
);
extern_conformance!(
unsafe impl NSCopying for CKAllowedSharingOptions {}
);
unsafe impl CopyingHelper for CKAllowedSharingOptions {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CKAllowedSharingOptions {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CKAllowedSharingOptions {}
);
impl CKAllowedSharingOptions {
extern_methods!(
#[unsafe(method(initWithAllowedParticipantPermissionOptions:allowedParticipantAccessOptions:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithAllowedParticipantPermissionOptions_allowedParticipantAccessOptions(
this: Allocated<Self>,
allowed_participant_permission_options: CKSharingParticipantPermissionOption,
allowed_participant_access_options: CKSharingParticipantAccessOption,
) -> Retained<Self>;
#[unsafe(method(allowedParticipantPermissionOptions))]
#[unsafe(method_family = none)]
pub unsafe fn allowedParticipantPermissionOptions(
&self,
) -> CKSharingParticipantPermissionOption;
#[unsafe(method(setAllowedParticipantPermissionOptions:))]
#[unsafe(method_family = none)]
pub unsafe fn setAllowedParticipantPermissionOptions(
&self,
allowed_participant_permission_options: CKSharingParticipantPermissionOption,
);
#[unsafe(method(allowedParticipantAccessOptions))]
#[unsafe(method_family = none)]
pub unsafe fn allowedParticipantAccessOptions(&self) -> CKSharingParticipantAccessOption;
#[unsafe(method(setAllowedParticipantAccessOptions:))]
#[unsafe(method_family = none)]
pub unsafe fn setAllowedParticipantAccessOptions(
&self,
allowed_participant_access_options: CKSharingParticipantAccessOption,
);
#[unsafe(method(allowsParticipantsToInviteOthers))]
#[unsafe(method_family = none)]
pub unsafe fn allowsParticipantsToInviteOthers(&self) -> bool;
#[unsafe(method(setAllowsParticipantsToInviteOthers:))]
#[unsafe(method_family = none)]
pub unsafe fn setAllowsParticipantsToInviteOthers(
&self,
allows_participants_to_invite_others: bool,
);
#[unsafe(method(standardOptions))]
#[unsafe(method_family = none)]
pub unsafe fn standardOptions() -> Retained<CKAllowedSharingOptions>;
#[unsafe(method(allowsAccessRequests))]
#[unsafe(method_family = none)]
pub unsafe fn allowsAccessRequests(&self) -> bool;
#[unsafe(method(setAllowsAccessRequests:))]
#[unsafe(method_family = none)]
pub unsafe fn setAllowsAccessRequests(&self, allows_access_requests: bool);
);
}
impl CKAllowedSharingOptions {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}