objc2_notification_center/generated/
NCWidgetProviding.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NCUpdateResult(pub NSUInteger);
15impl NCUpdateResult {
16 #[doc(alias = "NCUpdateResultNewData")]
17 pub const NewData: Self = Self(0);
18 #[doc(alias = "NCUpdateResultNoData")]
19 pub const NoData: Self = Self(1);
20 #[doc(alias = "NCUpdateResultFailed")]
21 pub const Failed: Self = Self(2);
22}
23
24unsafe impl Encode for NCUpdateResult {
25 const ENCODING: Encoding = NSUInteger::ENCODING;
26}
27
28unsafe impl RefEncode for NCUpdateResult {
29 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32extern_protocol!(
33 #[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
35 pub unsafe trait NCWidgetProviding: NSExtensionRequestHandling {
36 #[cfg(feature = "block2")]
37 #[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
38 #[optional]
39 #[unsafe(method(widgetPerformUpdateWithCompletionHandler:))]
40 #[unsafe(method_family = none)]
41 unsafe fn widgetPerformUpdateWithCompletionHandler(
42 &self,
43 completion_handler: &block2::DynBlock<dyn Fn(NCUpdateResult)>,
44 );
45
46 #[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
47 #[optional]
48 #[unsafe(method(widgetMarginInsetsForProposedMarginInsets:))]
49 #[unsafe(method_family = none)]
50 unsafe fn widgetMarginInsetsForProposedMarginInsets(
51 &self,
52 default_margin_inset: NSEdgeInsets,
53 ) -> NSEdgeInsets;
54
55 #[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
56 #[optional]
57 #[unsafe(method(widgetAllowsEditing))]
58 #[unsafe(method_family = none)]
59 unsafe fn widgetAllowsEditing(&self) -> bool;
60
61 #[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
62 #[optional]
63 #[unsafe(method(widgetDidBeginEditing))]
64 #[unsafe(method_family = none)]
65 unsafe fn widgetDidBeginEditing(&self);
66
67 #[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
68 #[optional]
69 #[unsafe(method(widgetDidEndEditing))]
70 #[unsafe(method_family = none)]
71 unsafe fn widgetDidEndEditing(&self);
72 }
73);