objc2_app_kit/generated/
NSHelpManager.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10pub type NSHelpBookName = NSString;
12
13pub type NSHelpAnchorName = NSString;
15
16pub type NSHelpManagerContextHelpKey = NSString;
18
19extern_class!(
20 #[unsafe(super(NSObject))]
22 #[thread_kind = MainThreadOnly]
23 #[derive(Debug, PartialEq, Eq, Hash)]
24 pub struct NSHelpManager;
25);
26
27extern_conformance!(
28 unsafe impl NSObjectProtocol for NSHelpManager {}
29);
30
31impl NSHelpManager {
32 extern_methods!(
33 #[unsafe(method(sharedHelpManager))]
34 #[unsafe(method_family = none)]
35 pub fn sharedHelpManager(mtm: MainThreadMarker) -> Retained<NSHelpManager>;
36
37 #[unsafe(method(isContextHelpModeActive))]
38 #[unsafe(method_family = none)]
39 pub fn isContextHelpModeActive(mtm: MainThreadMarker) -> bool;
40
41 #[unsafe(method(setContextHelpModeActive:))]
43 #[unsafe(method_family = none)]
44 pub fn setContextHelpModeActive(context_help_mode_active: bool, mtm: MainThreadMarker);
45
46 #[unsafe(method(setContextHelp:forObject:))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn setContextHelp_forObject(
52 &self,
53 attr_string: &NSAttributedString,
54 object: &AnyObject,
55 );
56
57 #[unsafe(method(removeContextHelpForObject:))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn removeContextHelpForObject(&self, object: &AnyObject);
63
64 #[unsafe(method(contextHelpForObject:))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn contextHelpForObject(
70 &self,
71 object: &AnyObject,
72 ) -> Option<Retained<NSAttributedString>>;
73
74 #[unsafe(method(showContextHelpForObject:locationHint:))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn showContextHelpForObject_locationHint(
80 &self,
81 object: &AnyObject,
82 pt: NSPoint,
83 ) -> bool;
84
85 #[unsafe(method(openHelpAnchor:inBook:))]
86 #[unsafe(method_family = none)]
87 pub fn openHelpAnchor_inBook(
88 &self,
89 anchor: &NSHelpAnchorName,
90 book: Option<&NSHelpBookName>,
91 );
92
93 #[unsafe(method(findString:inBook:))]
94 #[unsafe(method_family = none)]
95 pub fn findString_inBook(&self, query: &NSString, book: Option<&NSHelpBookName>);
96
97 #[unsafe(method(registerBooksInBundle:))]
98 #[unsafe(method_family = none)]
99 pub fn registerBooksInBundle(&self, bundle: &NSBundle) -> bool;
100 );
101}
102
103impl NSHelpManager {
105 extern_methods!(
106 #[unsafe(method(init))]
107 #[unsafe(method_family = init)]
108 pub fn init(this: Allocated<Self>) -> Retained<Self>;
109
110 #[unsafe(method(new))]
111 #[unsafe(method_family = new)]
112 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
113 );
114}
115
116extern "C" {
117 pub static NSContextHelpModeDidActivateNotification: &'static NSNotificationName;
119}
120
121extern "C" {
122 pub static NSContextHelpModeDidDeactivateNotification: &'static NSNotificationName;
124}
125
126mod private_NSBundleHelpExtension {
127 pub trait Sealed {}
128}
129
130pub unsafe trait NSBundleHelpExtension:
132 ClassType + Sized + private_NSBundleHelpExtension::Sealed
133{
134 extern_methods!(
135 #[unsafe(method(contextHelpForKey:))]
136 #[unsafe(method_family = none)]
137 fn contextHelpForKey(
138 &self,
139 key: &NSHelpManagerContextHelpKey,
140 ) -> Option<Retained<NSAttributedString>>;
141 );
142}
143
144impl private_NSBundleHelpExtension::Sealed for NSBundle {}
145unsafe impl NSBundleHelpExtension for NSBundle {}
146
147#[cfg(all(feature = "NSApplication", feature = "NSResponder"))]
149impl NSApplication {
150 extern_methods!(
151 #[unsafe(method(activateContextHelpMode:))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn activateContextHelpMode(&self, sender: Option<&AnyObject>);
157
158 #[unsafe(method(showHelp:))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn showHelp(&self, sender: Option<&AnyObject>);
164 );
165}