objc2_web_kit/generated/WebHistoryItem.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::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern "C" {
14 /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistoryitemchangednotification?language=objc)
15 pub static WebHistoryItemChangedNotification: Option<&'static NSString>;
16}
17
18extern_class!(
19 /// WebHistoryItems are created by WebKit to represent pages visited.
20 /// The WebBackForwardList and WebHistory classes both use WebHistoryItems to represent
21 /// pages visited. With the exception of the displayTitle, the properties of
22 /// WebHistoryItems are set by WebKit. WebHistoryItems are normally never created directly.
23 ///
24 /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webhistoryitem?language=objc)
25 #[unsafe(super(NSObject))]
26 #[derive(Debug, PartialEq, Eq, Hash)]
27 #[deprecated]
28 pub struct WebHistoryItem;
29);
30
31unsafe impl NSCopying for WebHistoryItem {}
32
33unsafe impl CopyingHelper for WebHistoryItem {
34 type Result = Self;
35}
36
37unsafe impl NSObjectProtocol for WebHistoryItem {}
38
39impl WebHistoryItem {
40 extern_methods!(
41 /// Parameter `URLString`: The URL string for the item.
42 ///
43 /// Parameter `title`: The title to use for the item. This is normally the
44 /// <title
45 /// > of a page.
46 ///
47 /// Parameter `time`: The time used to indicate when the item was used.
48 ///
49 /// Initialize a new WebHistoryItem
50 ///
51 /// WebHistoryItems are normally created for you by the WebKit.
52 /// You may use this method to prepopulate a WebBackForwardList, or create
53 /// 'artificial' items to add to a WebBackForwardList. When first initialized
54 /// the URLString and originalURLString will be the same.
55 #[deprecated]
56 #[unsafe(method(initWithURLString:title:lastVisitedTimeInterval:))]
57 #[unsafe(method_family = init)]
58 pub unsafe fn initWithURLString_title_lastVisitedTimeInterval(
59 this: Allocated<Self>,
60 url_string: Option<&NSString>,
61 title: Option<&NSString>,
62 time: NSTimeInterval,
63 ) -> Option<Retained<Self>>;
64
65 /// The string representation of the initial URL of this item.
66 /// This value is normally set by the WebKit.
67 #[deprecated]
68 #[unsafe(method(originalURLString))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn originalURLString(&self) -> Retained<NSString>;
71
72 /// The string representation of the URL represented by this item.
73 ///
74 /// The URLString may be different than the originalURLString if the page
75 /// redirected to a new location. This value is normally set by the WebKit.
76 #[deprecated]
77 #[unsafe(method(URLString))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn URLString(&self) -> Retained<NSString>;
80
81 /// The title of the page represented by this item.
82 ///
83 /// This title cannot be changed by the client. This value
84 /// is normally set by the WebKit when a page title for the item is received.
85 #[deprecated]
86 #[unsafe(method(title))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn title(&self) -> Retained<NSString>;
89
90 /// The last time the page represented by this item was visited. The interval
91 /// is since the reference date as determined by NSDate. This value is normally set by
92 /// the WebKit.
93 #[deprecated]
94 #[unsafe(method(lastVisitedTimeInterval))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn lastVisitedTimeInterval(&self) -> NSTimeInterval;
97
98 #[deprecated]
99 #[unsafe(method(alternateTitle))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn alternateTitle(&self) -> Retained<NSString>;
102
103 /// Setter for [`alternateTitle`][Self::alternateTitle].
104 #[deprecated]
105 #[unsafe(method(setAlternateTitle:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn setAlternateTitle(&self, alternate_title: Option<&NSString>);
108
109 #[cfg(feature = "objc2-app-kit")]
110 #[cfg(target_os = "macos")]
111 /// The favorite icon of the page represented by this item.
112 ///
113 /// This icon returned will be determined by the WebKit.
114 #[deprecated]
115 #[unsafe(method(icon))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn icon(&self) -> Option<Retained<NSImage>>;
118 );
119}
120
121/// Methods declared on superclass `NSObject`.
122impl WebHistoryItem {
123 extern_methods!(
124 #[unsafe(method(init))]
125 #[unsafe(method_family = init)]
126 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
127
128 #[unsafe(method(new))]
129 #[unsafe(method_family = new)]
130 pub unsafe fn new() -> Retained<Self>;
131 );
132}