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