objc2_web_kit/generated/
WebBackForwardList.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    /// WebBackForwardList holds an ordered list of WebHistoryItems that comprises the back and
12    /// forward lists.
13    ///
14    /// Note that the methods which modify instances of this class do not cause
15    /// navigation to happen in other layers of the stack;  they are only for maintaining this data
16    /// structure.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webbackforwardlist?language=objc)
19    #[unsafe(super(NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    #[deprecated]
22    pub struct WebBackForwardList;
23);
24
25unsafe impl NSObjectProtocol for WebBackForwardList {}
26
27impl WebBackForwardList {
28    extern_methods!(
29        #[cfg(feature = "WebHistoryItem")]
30        /// Adds an entry to the list.
31        ///
32        /// Parameter `item`: The entry to add.
33        ///
34        /// The added entry is inserted immediately after the current entry.
35        /// If the current position in the list is not at the end of the list, elements in the
36        /// forward list will be dropped at this point.  In addition, entries may be dropped to keep
37        /// the size of the list within the maximum size.
38        #[deprecated]
39        #[unsafe(method(addItem:))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn addItem(&self, item: Option<&WebHistoryItem>);
42
43        /// Move the current pointer back to the entry before the current entry.
44        #[deprecated]
45        #[unsafe(method(goBack))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn goBack(&self);
48
49        /// Move the current pointer ahead to the entry after the current entry.
50        #[deprecated]
51        #[unsafe(method(goForward))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn goForward(&self);
54
55        #[cfg(feature = "WebHistoryItem")]
56        /// Move the current pointer to the given entry.
57        ///
58        /// Parameter `item`: The history item to move the pointer to
59        #[deprecated]
60        #[unsafe(method(goToItem:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn goToItem(&self, item: Option<&WebHistoryItem>);
63
64        #[cfg(feature = "WebHistoryItem")]
65        /// The entry right before the current entry, or nil if there isn't one.
66        #[deprecated]
67        #[unsafe(method(backItem))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn backItem(&self) -> Option<Retained<WebHistoryItem>>;
70
71        #[cfg(feature = "WebHistoryItem")]
72        /// Returns the current entry.
73        #[deprecated]
74        #[unsafe(method(currentItem))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn currentItem(&self) -> Option<Retained<WebHistoryItem>>;
77
78        #[cfg(feature = "WebHistoryItem")]
79        /// The entry right after the current entry, or nil if there isn't one.
80        #[deprecated]
81        #[unsafe(method(forwardItem))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn forwardItem(&self) -> Option<Retained<WebHistoryItem>>;
84
85        /// Returns a portion of the list before the current entry.
86        ///
87        /// Parameter `limit`: A cap on the size of the array returned.
88        ///
89        /// Returns: An array of items before the current entry, or nil if there are none.  The entries are in the order that they were originally visited.
90        #[deprecated]
91        #[unsafe(method(backListWithLimit:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn backListWithLimit(&self, limit: c_int) -> Option<Retained<NSArray>>;
94
95        /// Returns a portion of the list after the current entry.
96        ///
97        /// Parameter `limit`: A cap on the size of the array returned.
98        ///
99        /// Returns: An array of items after the current entry, or nil if there are none.  The entries are in the order that they were originally visited.
100        #[deprecated]
101        #[unsafe(method(forwardListWithLimit:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn forwardListWithLimit(&self, limit: c_int) -> Option<Retained<NSArray>>;
104
105        /// The list's maximum size.
106        #[deprecated]
107        #[unsafe(method(capacity))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn capacity(&self) -> c_int;
110
111        /// Setter for [`capacity`][Self::capacity].
112        #[deprecated]
113        #[unsafe(method(setCapacity:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setCapacity(&self, capacity: c_int);
116
117        /// The number of items in the list.
118        #[deprecated]
119        #[unsafe(method(backListCount))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn backListCount(&self) -> c_int;
122
123        /// Returns: The number of items in the list.
124        #[deprecated]
125        #[unsafe(method(forwardListCount))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn forwardListCount(&self) -> c_int;
128
129        #[cfg(feature = "WebHistoryItem")]
130        /// Parameter `item`: The item that will be checked for presence in the WebBackForwardList.
131        ///
132        /// Returns: Returns YES if the item is in the list.
133        #[deprecated]
134        #[unsafe(method(containsItem:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn containsItem(&self, item: Option<&WebHistoryItem>) -> bool;
137
138        #[cfg(feature = "WebHistoryItem")]
139        /// Returns an entry the given distance from the current entry.
140        ///
141        /// Parameter `index`: Index of the desired list item relative to the current item; 0 is current item, -1 is back item, 1 is forward item, etc.
142        ///
143        /// Returns: The entry the given distance from the current entry. If index exceeds the limits of the list, nil is returned.
144        #[deprecated]
145        #[unsafe(method(itemAtIndex:))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn itemAtIndex(&self, index: c_int) -> Option<Retained<WebHistoryItem>>;
148    );
149}
150
151/// Methods declared on superclass `NSObject`.
152impl WebBackForwardList {
153    extern_methods!(
154        #[unsafe(method(init))]
155        #[unsafe(method_family = init)]
156        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
157
158        #[unsafe(method(new))]
159        #[unsafe(method_family = new)]
160        pub unsafe fn new() -> Retained<Self>;
161    );
162}
163
164/// WebBackForwardListDeprecated.
165impl WebBackForwardList {
166    extern_methods!(
167        /// The size passed to this method determines whether the WebView
168        /// associated with this WebBackForwardList will use the shared page cache.
169        ///
170        /// Parameter `size`: If size is 0, the WebView associated with this WebBackForwardList
171        /// will not use the shared page cache. Otherwise, it will.
172        #[deprecated]
173        #[unsafe(method(setPageCacheSize:))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn setPageCacheSize(&self, size: NSUInteger);
176
177        /// Returns the size of the shared page cache, or 0.
178        ///
179        /// Returns: The size of the shared page cache (in pages), or 0 if the WebView
180        /// associated with this WebBackForwardList will not use the shared page cache.
181        #[deprecated]
182        #[unsafe(method(pageCacheSize))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn pageCacheSize(&self) -> NSUInteger;
185    );
186}