Bug 1646817 - Support DocumentChannel process switching in sidebars and popups r...
[gecko.git] / widget / cocoa / mozView.h
blobdeb719254e1b8078cf2056a578df0a9faeb2d215
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozView_h_
7 #define mozView_h_
9 #undef DARWIN
10 #import <Cocoa/Cocoa.h>
11 class nsIWidget;
13 namespace mozilla {
14 namespace widget {
15 class TextInputHandler;
16 } // namespace widget
17 } // namespace mozilla
19 // A protocol with some of the methods that ChildView implements. In the distant
20 // past, this protocol was used by embedders: They would create their own NSView
21 // subclass, implement mozView on it, and then embed a Gecko ChildView by adding
22 // it as a subview of this view. This scenario no longer exists.
23 // Now this protocol is mostly just used by TextInputHandler and mozAccessible
24 // in order to communicate with ChildView without seeing the entire ChildView
25 // interface definition.
26 @protocol mozView
28 // aHandler is Gecko's default text input handler: It implements the
29 // NSTextInput protocol to handle key events. Don't make aHandler a
30 // strong reference -- that causes a memory leak.
31 - (void)installTextInputHandler:(mozilla::widget::TextInputHandler*)aHandler;
32 - (void)uninstallTextInputHandler;
34 // access the nsIWidget associated with this view. DOES NOT ADDREF.
35 - (nsIWidget*)widget;
37 // called when our corresponding Gecko view goes away
38 - (void)widgetDestroyed;
40 - (BOOL)isDragInProgress;
42 // Checks whether the view is first responder or not
43 - (BOOL)isFirstResponder;
45 // Call when you dispatch an event which may cause to open context menu.
46 - (void)maybeInitContextMenuTracking;
48 @end
50 // An informal protocol implemented by the NSWindow of the host application.
52 // It's used to prevent re-entrant calls to -makeKeyAndOrderFront: when gecko
53 // focus/activate events propagate out to the embedder's
54 // nsIEmbeddingSiteWindow::SetFocus implementation.
55 @interface NSObject (mozWindow)
57 - (BOOL)suppressMakeKeyFront;
58 - (void)setSuppressMakeKeyFront:(BOOL)inSuppress;
60 @end
62 #endif // mozView_h_