objc2_web_kit/generated/WebHistory.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 "C" {
11 /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistoryitemsaddednotification?language=objc)
12 #[deprecated]
13 pub static WebHistoryItemsAddedNotification: Option<&'static NSString>;
14}
15
16extern "C" {
17 /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistoryitemsremovednotification?language=objc)
18 #[deprecated]
19 pub static WebHistoryItemsRemovedNotification: Option<&'static NSString>;
20}
21
22extern "C" {
23 /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistoryallitemsremovednotification?language=objc)
24 #[deprecated]
25 pub static WebHistoryAllItemsRemovedNotification: Option<&'static NSString>;
26}
27
28extern "C" {
29 /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistoryloadednotification?language=objc)
30 #[deprecated]
31 pub static WebHistoryLoadedNotification: Option<&'static NSString>;
32}
33
34extern "C" {
35 /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistorysavednotification?language=objc)
36 #[deprecated]
37 pub static WebHistorySavedNotification: Option<&'static NSString>;
38}
39
40extern "C" {
41 /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistoryitemskey?language=objc)
42 #[deprecated]
43 pub static WebHistoryItemsKey: Option<&'static NSString>;
44}
45
46extern_class!(
47 /// WebHistory is used to track pages that have been loaded
48 /// by WebKit.
49 ///
50 /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistory?language=objc)
51 #[unsafe(super(NSObject))]
52 #[derive(Debug, PartialEq, Eq, Hash)]
53 #[deprecated]
54 pub struct WebHistory;
55);
56
57extern_conformance!(
58 unsafe impl NSObjectProtocol for WebHistory {}
59);
60
61impl WebHistory {
62 extern_methods!(
63 /// Returns a shared WebHistory instance initialized with the default history file.
64 ///
65 /// Returns: A WebHistory object.
66 #[deprecated]
67 #[unsafe(method(optionalSharedHistory))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn optionalSharedHistory() -> Option<Retained<WebHistory>>;
70
71 /// Parameter `history`: The history to use for the global WebHistory.
72 ///
73 /// # Safety
74 ///
75 /// `history` might not allow `None`.
76 #[deprecated]
77 #[unsafe(method(setOptionalSharedHistory:))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn setOptionalSharedHistory(history: Option<&WebHistory>);
80
81 /// Parameter `URL`: The URL to use to initialize the WebHistory.
82 ///
83 /// Parameter `error`: Set to nil or an NSError instance if an error occurred.
84 ///
85 /// The designated initializer for WebHistory.
86 ///
87 /// Returns: Returns YES if successful, NO otherwise.
88 ///
89 /// # Safety
90 ///
91 /// - `url` might not allow `None`.
92 /// - `error` might not allow `None`.
93 #[deprecated]
94 #[unsafe(method(loadFromURL:error:))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn loadFromURL_error(
97 &self,
98 url: Option<&NSURL>,
99 error: Option<&mut Option<Retained<NSError>>>,
100 ) -> bool;
101
102 /// Save history to URL. It is the client's responsibility to call this at appropriate times.
103 ///
104 /// Parameter `URL`: The URL to use to save the WebHistory.
105 ///
106 /// Parameter `error`: Set to nil or an NSError instance if an error occurred.
107 ///
108 /// Returns: Returns YES if successful, NO otherwise.
109 ///
110 /// # Safety
111 ///
112 /// - `url` might not allow `None`.
113 /// - `error` might not allow `None`.
114 #[deprecated]
115 #[unsafe(method(saveToURL:error:))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn saveToURL_error(
118 &self,
119 url: Option<&NSURL>,
120 error: Option<&mut Option<Retained<NSError>>>,
121 ) -> bool;
122
123 /// Parameter `newItems`: An array of WebHistoryItems to add to the WebHistory.
124 ///
125 /// # Safety
126 ///
127 /// - `new_items` generic should be of the correct type.
128 /// - `new_items` might not allow `None`.
129 #[deprecated]
130 #[unsafe(method(addItems:))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn addItems(&self, new_items: Option<&NSArray>);
133
134 /// Parameter `items`: An array of WebHistoryItems to remove from the WebHistory.
135 ///
136 /// # Safety
137 ///
138 /// - `items` generic should be of the correct type.
139 /// - `items` might not allow `None`.
140 #[deprecated]
141 #[unsafe(method(removeItems:))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn removeItems(&self, items: Option<&NSArray>);
144
145 #[deprecated]
146 #[unsafe(method(removeAllItems))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn removeAllItems(&self);
149
150 /// An array of NSCalendarDates for which history items exist in the WebHistory.
151 ///
152 /// An array of NSCalendarDates, each one representing a unique day that contains one
153 /// or more history items, ordered from most recent to oldest.
154 #[deprecated]
155 #[unsafe(method(orderedLastVisitedDays))]
156 #[unsafe(method_family = none)]
157 pub unsafe fn orderedLastVisitedDays(&self) -> Retained<NSArray>;
158
159 /// # Safety
160 ///
161 /// `calendar_date` might not allow `None`.
162 #[deprecated]
163 #[unsafe(method(orderedItemsLastVisitedOnDay:))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn orderedItemsLastVisitedOnDay(
166 &self,
167 calendar_date: Option<&NSCalendarDate>,
168 ) -> Option<Retained<NSArray>>;
169
170 #[cfg(feature = "WebHistoryItem")]
171 /// Get an item for a specific URL
172 ///
173 /// Parameter `URL`: The URL of the history item to search for
174 ///
175 /// Returns: Returns an item matching the URL
176 ///
177 /// # Safety
178 ///
179 /// `url` might not allow `None`.
180 #[deprecated]
181 #[unsafe(method(itemForURL:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn itemForURL(&self, url: Option<&NSURL>) -> Option<Retained<WebHistoryItem>>;
184
185 /// The maximum number of items that will be stored by the WebHistory.
186 #[deprecated]
187 #[unsafe(method(historyItemLimit))]
188 #[unsafe(method_family = none)]
189 pub unsafe fn historyItemLimit(&self) -> c_int;
190
191 /// Setter for [`historyItemLimit`][Self::historyItemLimit].
192 #[deprecated]
193 #[unsafe(method(setHistoryItemLimit:))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn setHistoryItemLimit(&self, history_item_limit: c_int);
196
197 /// The maximum number of days to be read from stored history.
198 #[deprecated]
199 #[unsafe(method(historyAgeInDaysLimit))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn historyAgeInDaysLimit(&self) -> c_int;
202
203 /// Setter for [`historyAgeInDaysLimit`][Self::historyAgeInDaysLimit].
204 #[deprecated]
205 #[unsafe(method(setHistoryAgeInDaysLimit:))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn setHistoryAgeInDaysLimit(&self, history_age_in_days_limit: c_int);
208 );
209}
210
211/// Methods declared on superclass `NSObject`.
212impl WebHistory {
213 extern_methods!(
214 #[unsafe(method(init))]
215 #[unsafe(method_family = init)]
216 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
217
218 #[unsafe(method(new))]
219 #[unsafe(method_family = new)]
220 pub unsafe fn new() -> Retained<Self>;
221 );
222}