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
27unsafe impl NSObjectProtocol for NSHelpManager {}
28
29impl NSHelpManager {
30 extern_methods!(
31 #[unsafe(method(sharedHelpManager))]
32 #[unsafe(method_family = none)]
33 pub unsafe fn sharedHelpManager(mtm: MainThreadMarker) -> Retained<NSHelpManager>;
34
35 #[unsafe(method(isContextHelpModeActive))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn isContextHelpModeActive(mtm: MainThreadMarker) -> bool;
38
39 #[unsafe(method(setContextHelpModeActive:))]
41 #[unsafe(method_family = none)]
42 pub unsafe fn setContextHelpModeActive(
43 context_help_mode_active: bool,
44 mtm: MainThreadMarker,
45 );
46
47 #[unsafe(method(setContextHelp:forObject:))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn setContextHelp_forObject(
50 &self,
51 attr_string: &NSAttributedString,
52 object: &AnyObject,
53 );
54
55 #[unsafe(method(removeContextHelpForObject:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn removeContextHelpForObject(&self, object: &AnyObject);
58
59 #[unsafe(method(contextHelpForObject:))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn contextHelpForObject(
62 &self,
63 object: &AnyObject,
64 ) -> Option<Retained<NSAttributedString>>;
65
66 #[unsafe(method(showContextHelpForObject:locationHint:))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn showContextHelpForObject_locationHint(
69 &self,
70 object: &AnyObject,
71 pt: NSPoint,
72 ) -> bool;
73
74 #[unsafe(method(openHelpAnchor:inBook:))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn openHelpAnchor_inBook(
77 &self,
78 anchor: &NSHelpAnchorName,
79 book: Option<&NSHelpBookName>,
80 );
81
82 #[unsafe(method(findString:inBook:))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn findString_inBook(&self, query: &NSString, book: Option<&NSHelpBookName>);
85
86 #[unsafe(method(registerBooksInBundle:))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn registerBooksInBundle(&self, bundle: &NSBundle) -> bool;
89 );
90}
91
92impl NSHelpManager {
94 extern_methods!(
95 #[unsafe(method(init))]
96 #[unsafe(method_family = init)]
97 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
98
99 #[unsafe(method(new))]
100 #[unsafe(method_family = new)]
101 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
102 );
103}
104
105extern "C" {
106 pub static NSContextHelpModeDidActivateNotification: &'static NSNotificationName;
108}
109
110extern "C" {
111 pub static NSContextHelpModeDidDeactivateNotification: &'static NSNotificationName;
113}
114
115mod private_NSBundleHelpExtension {
116 pub trait Sealed {}
117}
118
119pub unsafe trait NSBundleHelpExtension:
121 ClassType + Sized + private_NSBundleHelpExtension::Sealed
122{
123 extern_methods!(
124 #[unsafe(method(contextHelpForKey:))]
125 #[unsafe(method_family = none)]
126 unsafe fn contextHelpForKey(
127 &self,
128 key: &NSHelpManagerContextHelpKey,
129 ) -> Option<Retained<NSAttributedString>>;
130 );
131}
132
133impl private_NSBundleHelpExtension::Sealed for NSBundle {}
134unsafe impl NSBundleHelpExtension for NSBundle {}
135
136#[cfg(all(feature = "NSApplication", feature = "NSResponder"))]
138impl NSApplication {
139 extern_methods!(
140 #[unsafe(method(activateContextHelpMode:))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn activateContextHelpMode(&self, sender: Option<&AnyObject>);
143
144 #[unsafe(method(showHelp:))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn showHelp(&self, sender: Option<&AnyObject>);
147 );
148}