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    pub static WebHistoryItemsAddedNotification: Option<&'static NSString>;
13}
14
15extern "C" {
16    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistoryitemsremovednotification?language=objc)
17    pub static WebHistoryItemsRemovedNotification: Option<&'static NSString>;
18}
19
20extern "C" {
21    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistoryallitemsremovednotification?language=objc)
22    pub static WebHistoryAllItemsRemovedNotification: Option<&'static NSString>;
23}
24
25extern "C" {
26    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistoryloadednotification?language=objc)
27    pub static WebHistoryLoadedNotification: Option<&'static NSString>;
28}
29
30extern "C" {
31    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistorysavednotification?language=objc)
32    pub static WebHistorySavedNotification: Option<&'static NSString>;
33}
34
35extern "C" {
36    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistoryitemskey?language=objc)
37    pub static WebHistoryItemsKey: Option<&'static NSString>;
38}
39
40extern_class!(
41    /// WebHistory is used to track pages that have been loaded
42    /// by WebKit.
43    ///
44    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistory?language=objc)
45    #[unsafe(super(NSObject))]
46    #[derive(Debug, PartialEq, Eq, Hash)]
47    #[deprecated]
48    pub struct WebHistory;
49);
50
51unsafe impl NSObjectProtocol for WebHistory {}
52
53impl WebHistory {
54    extern_methods!(
55        /// Returns a shared WebHistory instance initialized with the default history file.
56        ///
57        /// Returns: A WebHistory object.
58        #[deprecated]
59        #[unsafe(method(optionalSharedHistory))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn optionalSharedHistory() -> Option<Retained<WebHistory>>;
62
63        /// Parameter `history`: The history to use for the global WebHistory.
64        #[deprecated]
65        #[unsafe(method(setOptionalSharedHistory:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn setOptionalSharedHistory(history: Option<&WebHistory>);
68
69        /// Parameter `newItems`: An array of WebHistoryItems to add to the WebHistory.
70        #[deprecated]
71        #[unsafe(method(addItems:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn addItems(&self, new_items: Option<&NSArray>);
74
75        /// Parameter `items`: An array of WebHistoryItems to remove from the WebHistory.
76        #[deprecated]
77        #[unsafe(method(removeItems:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn removeItems(&self, items: Option<&NSArray>);
80
81        #[deprecated]
82        #[unsafe(method(removeAllItems))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn removeAllItems(&self);
85
86        /// An array of NSCalendarDates for which history items exist in the WebHistory.
87        ///
88        /// An array of NSCalendarDates, each one representing a unique day that contains one
89        /// or more history items, ordered from most recent to oldest.
90        #[deprecated]
91        #[unsafe(method(orderedLastVisitedDays))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn orderedLastVisitedDays(&self) -> Retained<NSArray>;
94
95        #[deprecated]
96        #[unsafe(method(orderedItemsLastVisitedOnDay:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn orderedItemsLastVisitedOnDay(
99            &self,
100            calendar_date: Option<&NSCalendarDate>,
101        ) -> Option<Retained<NSArray>>;
102
103        #[cfg(feature = "WebHistoryItem")]
104        /// Get an item for a specific URL
105        ///
106        /// Parameter `URL`: The URL of the history item to search for
107        ///
108        /// Returns: Returns an item matching the URL
109        #[deprecated]
110        #[unsafe(method(itemForURL:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn itemForURL(&self, url: Option<&NSURL>) -> Option<Retained<WebHistoryItem>>;
113
114        /// The maximum number of items that will be stored by the WebHistory.
115        #[deprecated]
116        #[unsafe(method(historyItemLimit))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn historyItemLimit(&self) -> c_int;
119
120        /// Setter for [`historyItemLimit`][Self::historyItemLimit].
121        #[deprecated]
122        #[unsafe(method(setHistoryItemLimit:))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn setHistoryItemLimit(&self, history_item_limit: c_int);
125
126        /// The maximum number of days to be read from stored history.
127        #[deprecated]
128        #[unsafe(method(historyAgeInDaysLimit))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn historyAgeInDaysLimit(&self) -> c_int;
131
132        /// Setter for [`historyAgeInDaysLimit`][Self::historyAgeInDaysLimit].
133        #[deprecated]
134        #[unsafe(method(setHistoryAgeInDaysLimit:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn setHistoryAgeInDaysLimit(&self, history_age_in_days_limit: c_int);
137    );
138}
139
140/// Methods declared on superclass `NSObject`.
141impl WebHistory {
142    extern_methods!(
143        #[unsafe(method(init))]
144        #[unsafe(method_family = init)]
145        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
146
147        #[unsafe(method(new))]
148        #[unsafe(method_family = new)]
149        pub unsafe fn new() -> Retained<Self>;
150    );
151}