objc2_web_kit/generated/
WKBackForwardList.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// A WKBackForwardList object is a list of webpages previously
11    /// visited in a web view that can be reached by going back or forward.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/wkbackforwardlist?language=objc)
14    #[unsafe(super(NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct WKBackForwardList;
18);
19
20unsafe impl NSObjectProtocol for WKBackForwardList {}
21
22impl WKBackForwardList {
23    extern_methods!(
24        #[cfg(feature = "WKBackForwardListItem")]
25        /// The current item.
26        #[unsafe(method(currentItem))]
27        #[unsafe(method_family = none)]
28        pub unsafe fn currentItem(&self) -> Option<Retained<WKBackForwardListItem>>;
29
30        #[cfg(feature = "WKBackForwardListItem")]
31        /// The item immediately preceding the current item, or nil
32        /// if there isn't one.
33        #[unsafe(method(backItem))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn backItem(&self) -> Option<Retained<WKBackForwardListItem>>;
36
37        #[cfg(feature = "WKBackForwardListItem")]
38        /// The item immediately following the current item, or nil
39        /// if there isn't one.
40        #[unsafe(method(forwardItem))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn forwardItem(&self) -> Option<Retained<WKBackForwardListItem>>;
43
44        #[cfg(feature = "WKBackForwardListItem")]
45        /// Returns the item at a specified distance from the current
46        /// item.
47        ///
48        /// Parameter `index`: Index of the desired list item relative to the current item:
49        /// 0 for the current item, -1 for the immediately preceding item, 1 for the
50        /// immediately following item, and so on.
51        ///
52        /// Returns: The item at the specified distance from the current item, or nil
53        /// if the index parameter exceeds the limits of the list.
54        #[unsafe(method(itemAtIndex:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn itemAtIndex(
57            &self,
58            index: NSInteger,
59        ) -> Option<Retained<WKBackForwardListItem>>;
60
61        #[cfg(feature = "WKBackForwardListItem")]
62        /// The portion of the list preceding the current item.
63        ///
64        /// The items are in the order in which they were originally
65        /// visited.
66        #[unsafe(method(backList))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn backList(&self) -> Retained<NSArray<WKBackForwardListItem>>;
69
70        #[cfg(feature = "WKBackForwardListItem")]
71        /// The portion of the list following the current item.
72        ///
73        /// The items are in the order in which they were originally
74        /// visited.
75        #[unsafe(method(forwardList))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn forwardList(&self) -> Retained<NSArray<WKBackForwardListItem>>;
78    );
79}
80
81/// Methods declared on superclass `NSObject`.
82impl WKBackForwardList {
83    extern_methods!(
84        #[unsafe(method(init))]
85        #[unsafe(method_family = init)]
86        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
87
88        #[unsafe(method(new))]
89        #[unsafe(method_family = new)]
90        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
91    );
92}