objc2_app_kit/generated/
NSSearchToolbarItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSToolbarItem, NSObject))]
17 #[derive(Debug, PartialEq, Eq, Hash)]
18 #[cfg(feature = "NSToolbarItem")]
19 pub struct NSSearchToolbarItem;
20);
21
22#[cfg(feature = "NSToolbarItem")]
23extern_conformance!(
24 unsafe impl NSCopying for NSSearchToolbarItem {}
25);
26
27#[cfg(feature = "NSToolbarItem")]
28unsafe impl CopyingHelper for NSSearchToolbarItem {
29 type Result = Self;
30}
31
32#[cfg(feature = "NSToolbarItem")]
33extern_conformance!(
34 unsafe impl NSObjectProtocol for NSSearchToolbarItem {}
35);
36
37#[cfg(feature = "NSToolbarItem")]
38impl NSSearchToolbarItem {
39 extern_methods!(
40 #[cfg(all(
41 feature = "NSControl",
42 feature = "NSResponder",
43 feature = "NSSearchField",
44 feature = "NSTextField",
45 feature = "NSView"
46 ))]
47 #[unsafe(method(searchField))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn searchField(&self) -> Retained<NSSearchField>;
55
56 #[cfg(all(
57 feature = "NSControl",
58 feature = "NSResponder",
59 feature = "NSSearchField",
60 feature = "NSTextField",
61 feature = "NSView"
62 ))]
63 #[unsafe(method(setSearchField:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn setSearchField(&self, search_field: &NSSearchField);
67
68 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
69 #[unsafe(method(view))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn view(&self) -> Option<Retained<NSView>>;
73
74 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
75 #[unsafe(method(setView:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn setView(&self, view: Option<&NSView>);
79
80 #[unsafe(method(resignsFirstResponderWithCancel))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn resignsFirstResponderWithCancel(&self) -> bool;
85
86 #[unsafe(method(setResignsFirstResponderWithCancel:))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn setResignsFirstResponderWithCancel(
90 &self,
91 resigns_first_responder_with_cancel: bool,
92 );
93
94 #[cfg(feature = "objc2-core-foundation")]
95 #[unsafe(method(preferredWidthForSearchField))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn preferredWidthForSearchField(&self) -> CGFloat;
101
102 #[cfg(feature = "objc2-core-foundation")]
103 #[unsafe(method(setPreferredWidthForSearchField:))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn setPreferredWidthForSearchField(
107 &self,
108 preferred_width_for_search_field: CGFloat,
109 );
110
111 #[unsafe(method(beginSearchInteraction))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn beginSearchInteraction(&self);
116
117 #[unsafe(method(endSearchInteraction))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn endSearchInteraction(&self);
123 );
124}
125
126#[cfg(feature = "NSToolbarItem")]
128impl NSSearchToolbarItem {
129 extern_methods!(
130 #[cfg(feature = "NSToolbar")]
131 #[unsafe(method(initWithItemIdentifier:))]
133 #[unsafe(method_family = init)]
134 pub unsafe fn initWithItemIdentifier(
135 this: Allocated<Self>,
136 item_identifier: &NSToolbarItemIdentifier,
137 ) -> Retained<Self>;
138 );
139}
140
141#[cfg(feature = "NSToolbarItem")]
143impl NSSearchToolbarItem {
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(mtm: MainThreadMarker) -> Retained<Self>;
152 );
153}