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
18extern_conformance!(
19    unsafe impl NSObjectProtocol for WKContentRuleListStore {}
20);
21
22impl WKContentRuleListStore {
23    extern_methods!(
24        #[unsafe(method(defaultStore))]
25        #[unsafe(method_family = none)]
26        pub unsafe fn defaultStore(mtm: MainThreadMarker) -> Option<Retained<Self>>;
27
28        /// # Safety
29        ///
30        /// `url` might not allow `None`.
31        #[unsafe(method(storeWithURL:))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn storeWithURL(
34            url: Option<&NSURL>,
35            mtm: MainThreadMarker,
36        ) -> Option<Retained<Self>>;
37
38        #[cfg(all(feature = "WKContentRuleList", feature = "block2"))]
39        /// # Safety
40        ///
41        /// - `identifier` might not allow `None`.
42        /// - `encoded_content_rule_list` might not allow `None`.
43        /// - `completion_handler` might not allow `None`.
44        #[unsafe(method(compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn compileContentRuleListForIdentifier_encodedContentRuleList_completionHandler(
47            &self,
48            identifier: Option<&NSString>,
49            encoded_content_rule_list: Option<&NSString>,
50            completion_handler: Option<
51                &block2::DynBlock<dyn Fn(*mut WKContentRuleList, *mut NSError)>,
52            >,
53        );
54
55        #[cfg(all(feature = "WKContentRuleList", feature = "block2"))]
56        /// # Safety
57        ///
58        /// - `identifier` might not allow `None`.
59        /// - `completion_handler` might not allow `None`.
60        #[unsafe(method(lookUpContentRuleListForIdentifier:completionHandler:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn lookUpContentRuleListForIdentifier_completionHandler(
63            &self,
64            identifier: Option<&NSString>,
65            completion_handler: Option<
66                &block2::DynBlock<dyn Fn(*mut WKContentRuleList, *mut NSError)>,
67            >,
68        );
69
70        #[cfg(feature = "block2")]
71        /// # Safety
72        ///
73        /// - `identifier` might not allow `None`.
74        /// - `completion_handler` might not allow `None`.
75        #[unsafe(method(removeContentRuleListForIdentifier:completionHandler:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn removeContentRuleListForIdentifier_completionHandler(
78            &self,
79            identifier: Option<&NSString>,
80            completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
81        );
82
83        #[cfg(feature = "block2")]
84        /// # Safety
85        ///
86        /// `completion_handler` might not allow `None`.
87        #[unsafe(method(getAvailableContentRuleListIdentifiers:))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn getAvailableContentRuleListIdentifiers(
90            &self,
91            completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSArray<NSString>)>>,
92        );
93    );
94}
95
96/// Methods declared on superclass `NSObject`.
97impl WKContentRuleListStore {
98    extern_methods!(
99        #[unsafe(method(init))]
100        #[unsafe(method_family = init)]
101        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
102
103        #[unsafe(method(new))]
104        #[unsafe(method_family = new)]
105        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
106    );
107}