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
20extern_conformance!(
21    unsafe impl NSObjectProtocol for WKBackForwardList {}
22);
23
24impl WKBackForwardList {
25    extern_methods!(
26        #[cfg(feature = "WKBackForwardListItem")]
27        /// The current item.
28        #[unsafe(method(currentItem))]
29        #[unsafe(method_family = none)]
30        pub unsafe fn currentItem(&self) -> Option<Retained<WKBackForwardListItem>>;
31
32        #[cfg(feature = "WKBackForwardListItem")]
33        /// The item immediately preceding the current item, or nil
34        /// if there isn't one.
35        #[unsafe(method(backItem))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn backItem(&self) -> Option<Retained<WKBackForwardListItem>>;
38
39        #[cfg(feature = "WKBackForwardListItem")]
40        /// The item immediately following the current item, or nil
41        /// if there isn't one.
42        #[unsafe(method(forwardItem))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn forwardItem(&self) -> Option<Retained<WKBackForwardListItem>>;
45
46        #[cfg(feature = "WKBackForwardListItem")]
47        /// Returns the item at a specified distance from the current
48        /// item.
49        ///
50        /// Parameter `index`: Index of the desired list item relative to the current item:
51        /// 0 for the current item, -1 for the immediately preceding item, 1 for the
52        /// immediately following item, and so on.
53        ///
54        /// Returns: The item at the specified distance from the current item, or nil
55        /// if the index parameter exceeds the limits of the list.
56        #[unsafe(method(itemAtIndex:))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn itemAtIndex(
59            &self,
60            index: NSInteger,
61        ) -> Option<Retained<WKBackForwardListItem>>;
62
63        #[cfg(feature = "WKBackForwardListItem")]
64        /// The portion of the list preceding the current item.
65        ///
66        /// The items are in the order in which they were originally
67        /// visited.
68        #[unsafe(method(backList))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn backList(&self) -> Retained<NSArray<WKBackForwardListItem>>;
71
72        #[cfg(feature = "WKBackForwardListItem")]
73        /// The portion of the list following the current item.
74        ///
75        /// The items are in the order in which they were originally
76        /// visited.
77        #[unsafe(method(forwardList))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn forwardList(&self) -> Retained<NSArray<WKBackForwardListItem>>;
80    );
81}
82
83/// Methods declared on superclass `NSObject`.
84impl WKBackForwardList {
85    extern_methods!(
86        #[unsafe(method(init))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
89
90        #[unsafe(method(new))]
91        #[unsafe(method_family = new)]
92        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
93    );
94}