objc2_web_kit/generated/
WKContentRuleListStore.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/wkcontentruleliststore?language=objc)
12    #[unsafe(super(NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct WKContentRuleListStore;
16);
17
18unsafe impl NSObjectProtocol for WKContentRuleListStore {}
19
20impl WKContentRuleListStore {
21    extern_methods!(
22        #[unsafe(method(defaultStore))]
23        #[unsafe(method_family = none)]
24        pub unsafe fn defaultStore(mtm: MainThreadMarker) -> Option<Retained<Self>>;
25
26        #[unsafe(method(storeWithURL:))]
27        #[unsafe(method_family = none)]
28        pub unsafe fn storeWithURL(
29            url: Option<&NSURL>,
30            mtm: MainThreadMarker,
31        ) -> Option<Retained<Self>>;
32
33        #[cfg(all(feature = "WKContentRuleList", feature = "block2"))]
34        #[unsafe(method(compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn compileContentRuleListForIdentifier_encodedContentRuleList_completionHandler(
37            &self,
38            identifier: Option<&NSString>,
39            encoded_content_rule_list: Option<&NSString>,
40            completion_handler: Option<
41                &block2::Block<dyn Fn(*mut WKContentRuleList, *mut NSError)>,
42            >,
43        );
44
45        #[cfg(all(feature = "WKContentRuleList", feature = "block2"))]
46        #[unsafe(method(lookUpContentRuleListForIdentifier:completionHandler:))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn lookUpContentRuleListForIdentifier_completionHandler(
49            &self,
50            identifier: Option<&NSString>,
51            completion_handler: Option<
52                &block2::Block<dyn Fn(*mut WKContentRuleList, *mut NSError)>,
53            >,
54        );
55
56        #[cfg(feature = "block2")]
57        #[unsafe(method(removeContentRuleListForIdentifier:completionHandler:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn removeContentRuleListForIdentifier_completionHandler(
60            &self,
61            identifier: Option<&NSString>,
62            completion_handler: Option<&block2::Block<dyn Fn(*mut NSError)>>,
63        );
64
65        #[cfg(feature = "block2")]
66        #[unsafe(method(getAvailableContentRuleListIdentifiers:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn getAvailableContentRuleListIdentifiers(
69            &self,
70            completion_handler: Option<&block2::Block<dyn Fn(*mut NSArray<NSString>)>>,
71        );
72    );
73}
74
75/// Methods declared on superclass `NSObject`.
76impl WKContentRuleListStore {
77    extern_methods!(
78        #[unsafe(method(init))]
79        #[unsafe(method_family = init)]
80        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
81
82        #[unsafe(method(new))]
83        #[unsafe(method_family = new)]
84        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
85    );
86}