diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /widget/cocoa/mozView.h | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/cocoa/mozView.h')
-rw-r--r-- | widget/cocoa/mozView.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/widget/cocoa/mozView.h b/widget/cocoa/mozView.h new file mode 100644 index 0000000000..deb719254e --- /dev/null +++ b/widget/cocoa/mozView.h @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozView_h_ +#define mozView_h_ + +#undef DARWIN +#import <Cocoa/Cocoa.h> +class nsIWidget; + +namespace mozilla { +namespace widget { +class TextInputHandler; +} // namespace widget +} // namespace mozilla + +// A protocol with some of the methods that ChildView implements. In the distant +// past, this protocol was used by embedders: They would create their own NSView +// subclass, implement mozView on it, and then embed a Gecko ChildView by adding +// it as a subview of this view. This scenario no longer exists. +// Now this protocol is mostly just used by TextInputHandler and mozAccessible +// in order to communicate with ChildView without seeing the entire ChildView +// interface definition. +@protocol mozView + +// aHandler is Gecko's default text input handler: It implements the +// NSTextInput protocol to handle key events. Don't make aHandler a +// strong reference -- that causes a memory leak. +- (void)installTextInputHandler:(mozilla::widget::TextInputHandler*)aHandler; +- (void)uninstallTextInputHandler; + +// access the nsIWidget associated with this view. DOES NOT ADDREF. +- (nsIWidget*)widget; + +// called when our corresponding Gecko view goes away +- (void)widgetDestroyed; + +- (BOOL)isDragInProgress; + +// Checks whether the view is first responder or not +- (BOOL)isFirstResponder; + +// Call when you dispatch an event which may cause to open context menu. +- (void)maybeInitContextMenuTracking; + +@end + +// An informal protocol implemented by the NSWindow of the host application. +// +// It's used to prevent re-entrant calls to -makeKeyAndOrderFront: when gecko +// focus/activate events propagate out to the embedder's +// nsIEmbeddingSiteWindow::SetFocus implementation. +@interface NSObject (mozWindow) + +- (BOOL)suppressMakeKeyFront; +- (void)setSuppressMakeKeyFront:(BOOL)inSuppress; + +@end + +#endif // mozView_h_ |