use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(INIntent, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "INIntent")]
pub struct INSendMessageIntent;
);
#[cfg(feature = "INIntent")]
extern_conformance!(
unsafe impl NSCoding for INSendMessageIntent {}
);
#[cfg(feature = "INIntent")]
extern_conformance!(
unsafe impl NSCopying for INSendMessageIntent {}
);
#[cfg(feature = "INIntent")]
unsafe impl CopyingHelper for INSendMessageIntent {
type Result = Self;
}
#[cfg(feature = "INIntent")]
extern_conformance!(
unsafe impl NSObjectProtocol for INSendMessageIntent {}
);
#[cfg(feature = "INIntent")]
extern_conformance!(
unsafe impl NSSecureCoding for INSendMessageIntent {}
);
#[cfg(feature = "INIntent")]
impl INSendMessageIntent {
extern_methods!(
#[cfg(all(
feature = "INOutgoingMessageType",
feature = "INPerson",
feature = "INSendMessageAttachment",
feature = "INSpeakableString"
))]
#[unsafe(method(initWithRecipients:outgoingMessageType:content:speakableGroupName:conversationIdentifier:serviceName:sender:attachments:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithRecipients_outgoingMessageType_content_speakableGroupName_conversationIdentifier_serviceName_sender_attachments(
this: Allocated<Self>,
recipients: Option<&NSArray<INPerson>>,
outgoing_message_type: INOutgoingMessageType,
content: Option<&NSString>,
speakable_group_name: Option<&INSpeakableString>,
conversation_identifier: Option<&NSString>,
service_name: Option<&NSString>,
sender: Option<&INPerson>,
attachments: Option<&NSArray<INSendMessageAttachment>>,
) -> Retained<Self>;
#[cfg(feature = "INPerson")]
#[unsafe(method(recipients))]
#[unsafe(method_family = none)]
pub unsafe fn recipients(&self) -> Option<Retained<NSArray<INPerson>>>;
#[cfg(feature = "INOutgoingMessageType")]
#[unsafe(method(outgoingMessageType))]
#[unsafe(method_family = none)]
pub unsafe fn outgoingMessageType(&self) -> INOutgoingMessageType;
#[unsafe(method(content))]
#[unsafe(method_family = none)]
pub unsafe fn content(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "INSpeakableString")]
#[unsafe(method(speakableGroupName))]
#[unsafe(method_family = none)]
pub unsafe fn speakableGroupName(&self) -> Option<Retained<INSpeakableString>>;
#[unsafe(method(conversationIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn conversationIdentifier(&self) -> Option<Retained<NSString>>;
#[unsafe(method(serviceName))]
#[unsafe(method_family = none)]
pub unsafe fn serviceName(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "INPerson")]
#[unsafe(method(sender))]
#[unsafe(method_family = none)]
pub unsafe fn sender(&self) -> Option<Retained<INPerson>>;
#[cfg(feature = "INSendMessageAttachment")]
#[unsafe(method(attachments))]
#[unsafe(method_family = none)]
pub unsafe fn attachments(&self) -> Option<Retained<NSArray<INSendMessageAttachment>>>;
);
}
#[cfg(feature = "INIntent")]
impl INSendMessageIntent {
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>;
);
}
extern_protocol!(
pub unsafe trait INSendMessageIntentHandling: NSObjectProtocol {
#[cfg(all(
feature = "INIntent",
feature = "INIntentResponse",
feature = "INSendMessageIntentResponse",
feature = "block2"
))]
#[unsafe(method(handleSendMessage:completion:))]
#[unsafe(method_family = none)]
unsafe fn handleSendMessage_completion(
&self,
intent: &INSendMessageIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<INSendMessageIntentResponse>)>,
);
#[cfg(all(
feature = "INIntent",
feature = "INIntentResponse",
feature = "INSendMessageIntentResponse",
feature = "block2"
))]
#[optional]
#[unsafe(method(confirmSendMessage:completion:))]
#[unsafe(method_family = none)]
unsafe fn confirmSendMessage_completion(
&self,
intent: &INSendMessageIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<INSendMessageIntentResponse>)>,
);
#[cfg(all(
feature = "INIntent",
feature = "INIntentResolutionResult",
feature = "INPersonResolutionResult",
feature = "block2"
))]
#[deprecated = "resolveRecipientsForSendMessage:withCompletion: is deprecated. Use resolveRecipientsForSendMessage:completion: instead"]
#[optional]
#[unsafe(method(resolveRecipientsForSendMessage:withCompletion:))]
#[unsafe(method_family = none)]
unsafe fn resolveRecipientsForSendMessage_withCompletion(
&self,
intent: &INSendMessageIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<NSArray<INPersonResolutionResult>>)>,
);
#[cfg(all(
feature = "INIntent",
feature = "INIntentResolutionResult",
feature = "INPersonResolutionResult",
feature = "INSendMessageRecipientResolutionResult",
feature = "block2"
))]
#[optional]
#[unsafe(method(resolveRecipientsForSendMessage:completion:))]
#[unsafe(method_family = none)]
unsafe fn resolveRecipientsForSendMessage_completion(
&self,
intent: &INSendMessageIntent,
completion: &block2::DynBlock<
dyn Fn(NonNull<NSArray<INSendMessageRecipientResolutionResult>>),
>,
);
#[cfg(all(
feature = "INIntent",
feature = "INIntentResolutionResult",
feature = "INStringResolutionResult",
feature = "block2"
))]
#[deprecated = "resolveGroupNameForSendMessage:withCompletion: is deprecated. Use resolveSpeakableGroupNameForSendMessage:withCompletion: instead"]
#[optional]
#[unsafe(method(resolveGroupNameForSendMessage:withCompletion:))]
#[unsafe(method_family = none)]
unsafe fn resolveGroupNameForSendMessage_withCompletion(
&self,
intent: &INSendMessageIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<INStringResolutionResult>)>,
);
#[cfg(all(
feature = "INIntent",
feature = "INIntentResolutionResult",
feature = "INOutgoingMessageTypeResolutionResult",
feature = "block2"
))]
#[optional]
#[unsafe(method(resolveOutgoingMessageTypeForSendMessage:withCompletion:))]
#[unsafe(method_family = none)]
unsafe fn resolveOutgoingMessageTypeForSendMessage_withCompletion(
&self,
intent: &INSendMessageIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<INOutgoingMessageTypeResolutionResult>)>,
);
#[cfg(all(
feature = "INIntent",
feature = "INIntentResolutionResult",
feature = "INStringResolutionResult",
feature = "block2"
))]
#[optional]
#[unsafe(method(resolveContentForSendMessage:withCompletion:))]
#[unsafe(method_family = none)]
unsafe fn resolveContentForSendMessage_withCompletion(
&self,
intent: &INSendMessageIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<INStringResolutionResult>)>,
);
#[cfg(all(
feature = "INIntent",
feature = "INIntentResolutionResult",
feature = "INSpeakableStringResolutionResult",
feature = "block2"
))]
#[optional]
#[unsafe(method(resolveSpeakableGroupNameForSendMessage:withCompletion:))]
#[unsafe(method_family = none)]
unsafe fn resolveSpeakableGroupNameForSendMessage_withCompletion(
&self,
intent: &INSendMessageIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<INSpeakableStringResolutionResult>)>,
);
}
);