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
51extern_conformance!(
52    unsafe impl NSObjectProtocol for WebHistory {}
53);
54
55impl WebHistory {
56    extern_methods!(
57        /// Returns a shared WebHistory instance initialized with the default history file.
58        ///
59        /// Returns: A WebHistory object.
60        #[deprecated]
61        #[unsafe(method(optionalSharedHistory))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn optionalSharedHistory() -> Option<Retained<WebHistory>>;
64
65        /// Parameter `history`: The history to use for the global WebHistory.
66        #[deprecated]
67        #[unsafe(method(setOptionalSharedHistory:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn setOptionalSharedHistory(history: Option<&WebHistory>);
70
71        /// Parameter `newItems`: An array of WebHistoryItems to add to the WebHistory.
72        #[deprecated]
73        #[unsafe(method(addItems:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn addItems(&self, new_items: Option<&NSArray>);
76
77        /// Parameter `items`: An array of WebHistoryItems to remove from the WebHistory.
78        #[deprecated]
79        #[unsafe(method(removeItems:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn removeItems(&self, items: Option<&NSArray>);
82
83        #[deprecated]
84        #[unsafe(method(removeAllItems))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn removeAllItems(&self);
87
88        /// An array of NSCalendarDates for which history items exist in the WebHistory.
89        ///
90        /// An array of NSCalendarDates, each one representing a unique day that contains one
91        /// or more history items, ordered from most recent to oldest.
92        #[deprecated]
93        #[unsafe(method(orderedLastVisitedDays))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn orderedLastVisitedDays(&self) -> Retained<NSArray>;
96
97        #[deprecated]
98        #[unsafe(method(orderedItemsLastVisitedOnDay:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn orderedItemsLastVisitedOnDay(
101            &self,
102            calendar_date: Option<&NSCalendarDate>,
103        ) -> Option<Retained<NSArray>>;
104
105        #[cfg(feature = "WebHistoryItem")]
106        /// Get an item for a specific URL
107        ///
108        /// Parameter `URL`: The URL of the history item to search for
109        ///
110        /// Returns: Returns an item matching the URL
111        #[deprecated]
112        #[unsafe(method(itemForURL:))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn itemForURL(&self, url: Option<&NSURL>) -> Option<Retained<WebHistoryItem>>;
115
116        /// The maximum number of items that will be stored by the WebHistory.
117        #[deprecated]
118        #[unsafe(method(historyItemLimit))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn historyItemLimit(&self) -> c_int;
121
122        /// Setter for [`historyItemLimit`][Self::historyItemLimit].
123        #[deprecated]
124        #[unsafe(method(setHistoryItemLimit:))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn setHistoryItemLimit(&self, history_item_limit: c_int);
127
128        /// The maximum number of days to be read from stored history.
129        #[deprecated]
130        #[unsafe(method(historyAgeInDaysLimit))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn historyAgeInDaysLimit(&self) -> c_int;
133
134        /// Setter for [`historyAgeInDaysLimit`][Self::historyAgeInDaysLimit].
135        #[deprecated]
136        #[unsafe(method(setHistoryAgeInDaysLimit:))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn setHistoryAgeInDaysLimit(&self, history_age_in_days_limit: c_int);
139    );
140}
141
142/// Methods declared on superclass `NSObject`.
143impl WebHistory {
144    extern_methods!(
145        #[unsafe(method(init))]
146        #[unsafe(method_family = init)]
147        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
148
149        #[unsafe(method(new))]
150        #[unsafe(method_family = new)]
151        pub unsafe fn new() -> Retained<Self>;
152    );
153}