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
31extern_conformance!(
32    unsafe impl NSCopying for WebHistoryItem {}
33);
34
35unsafe impl CopyingHelper for WebHistoryItem {
36    type Result = Self;
37}
38
39extern_conformance!(
40    unsafe impl NSObjectProtocol for WebHistoryItem {}
41);
42
43impl WebHistoryItem {
44    extern_methods!(
45        /// Parameter `URLString`: The URL string for the item.
46        ///
47        /// Parameter `title`: The title to use for the item.  This is normally the
48        /// <title
49        /// > of a page.
50        ///
51        /// Parameter `time`: The time used to indicate when the item was used.
52        ///
53        /// Initialize a new WebHistoryItem
54        ///
55        /// WebHistoryItems are normally created for you by the WebKit.
56        /// You may use this method to prepopulate a WebBackForwardList, or create
57        /// 'artificial' items to add to a WebBackForwardList.  When first initialized
58        /// the URLString and originalURLString will be the same.
59        #[deprecated]
60        #[unsafe(method(initWithURLString:title:lastVisitedTimeInterval:))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn initWithURLString_title_lastVisitedTimeInterval(
63            this: Allocated<Self>,
64            url_string: Option<&NSString>,
65            title: Option<&NSString>,
66            time: NSTimeInterval,
67        ) -> Option<Retained<Self>>;
68
69        /// The string representation of the initial URL of this item.
70        /// This value is normally set by the WebKit.
71        #[deprecated]
72        #[unsafe(method(originalURLString))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn originalURLString(&self) -> Retained<NSString>;
75
76        /// The string representation of the URL represented by this item.
77        ///
78        /// The URLString may be different than the originalURLString if the page
79        /// redirected to a new location.  This value is normally set by the WebKit.
80        #[deprecated]
81        #[unsafe(method(URLString))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn URLString(&self) -> Retained<NSString>;
84
85        /// The title of the page represented by this item.
86        ///
87        /// This title cannot be changed by the client.  This value
88        /// is normally set by the WebKit when a page title for the item is received.
89        #[deprecated]
90        #[unsafe(method(title))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn title(&self) -> Retained<NSString>;
93
94        /// The last time the page represented by this item was visited. The interval
95        /// is since the reference date as determined by NSDate.  This value is normally set by
96        /// the WebKit.
97        #[deprecated]
98        #[unsafe(method(lastVisitedTimeInterval))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn lastVisitedTimeInterval(&self) -> NSTimeInterval;
101
102        #[deprecated]
103        #[unsafe(method(alternateTitle))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn alternateTitle(&self) -> Retained<NSString>;
106
107        /// Setter for [`alternateTitle`][Self::alternateTitle].
108        #[deprecated]
109        #[unsafe(method(setAlternateTitle:))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn setAlternateTitle(&self, alternate_title: Option<&NSString>);
112
113        #[cfg(feature = "objc2-app-kit")]
114        #[cfg(target_os = "macos")]
115        /// The favorite icon of the page represented by this item.
116        ///
117        /// This icon returned will be determined by the WebKit.
118        #[deprecated]
119        #[unsafe(method(icon))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn icon(&self) -> Option<Retained<NSImage>>;
122    );
123}
124
125/// Methods declared on superclass `NSObject`.
126impl WebHistoryItem {
127    extern_methods!(
128        #[unsafe(method(init))]
129        #[unsafe(method_family = init)]
130        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
131
132        #[unsafe(method(new))]
133        #[unsafe(method_family = new)]
134        pub unsafe fn new() -> Retained<Self>;
135    );
136}