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 NCUpdateResult(pub NSUInteger);
impl NCUpdateResult {
#[doc(alias = "NCUpdateResultNewData")]
pub const NewData: Self = Self(0);
#[doc(alias = "NCUpdateResultNoData")]
pub const NoData: Self = Self(1);
#[doc(alias = "NCUpdateResultFailed")]
pub const Failed: Self = Self(2);
}
unsafe impl Encode for NCUpdateResult {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NCUpdateResult {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_protocol!(
#[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
pub unsafe trait NCWidgetProviding: NSExtensionRequestHandling {
#[cfg(feature = "block2")]
#[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
#[optional]
#[unsafe(method(widgetPerformUpdateWithCompletionHandler:))]
#[unsafe(method_family = none)]
unsafe fn widgetPerformUpdateWithCompletionHandler(
&self,
completion_handler: &block2::DynBlock<dyn Fn(NCUpdateResult)>,
);
#[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
#[optional]
#[unsafe(method(widgetMarginInsetsForProposedMarginInsets:))]
#[unsafe(method_family = none)]
unsafe fn widgetMarginInsetsForProposedMarginInsets(
&self,
default_margin_inset: NSEdgeInsets,
) -> NSEdgeInsets;
#[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
#[optional]
#[unsafe(method(widgetAllowsEditing))]
#[unsafe(method_family = none)]
unsafe fn widgetAllowsEditing(&self) -> bool;
#[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
#[optional]
#[unsafe(method(widgetDidBeginEditing))]
#[unsafe(method_family = none)]
unsafe fn widgetDidBeginEditing(&self);
#[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
#[optional]
#[unsafe(method(widgetDidEndEditing))]
#[unsafe(method_family = none)]
unsafe fn widgetDidEndEditing(&self);
}
);