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/. */
12 #import <Cocoa/Cocoa.h>
17 class TextInputHandler
;
19 } // namespace mozilla
21 // A protocol listing all the methods that an object which wants
22 // to live in gecko's widget hierarchy must implement. |nsChildView|
23 // makes assumptions that any NSView with which it comes in contact will
24 // implement this protocol.
27 // aHandler is Gecko's default text input handler: It implements the
28 // NSTextInput protocol to handle key events. Don't make aHandler a
29 // strong reference -- that causes a memory leak.
30 - (void)installTextInputHandler
:(mozilla::widget::TextInputHandler
*)aHandler
;
31 - (void)uninstallTextInputHandler
;
33 // access the nsIWidget associated with this view. DOES NOT ADDREF.
36 // return a context menu for this view
37 - (NSMenu
*)contextMenu
;
39 // Allows callers to do a delayed invalidate (e.g., if an invalidate
40 // happens during drawing)
41 - (void)setNeedsPendingDisplay
;
42 - (void)setNeedsPendingDisplayInRect
:(NSRect
)invalidRect
;
44 // called when our corresponding Gecko view goes away
45 - (void)widgetDestroyed
;
47 - (BOOL
)isDragInProgress
;
49 // Gets the plugin event model for the view
50 - (NPEventModel
)pluginEventModel
;
52 // Checks whether the view is first responder or not
53 - (BOOL
)isFirstResponder
;
55 // Call when you dispatch an event which may cause to open context menu.
56 - (void)maybeInitContextMenuTracking
;
58 // Checks whether the view is for plugin or not
63 // An informal protocol implemented by the NSWindow of the host application.
65 // It's used to prevent re-entrant calls to -makeKeyAndOrderFront: when gecko
66 // focus/activate events propagate out to the embedder's
67 // nsIEmbeddingSiteWindow::SetFocus implementation.
68 @interface
NSObject(mozWindow
)
70 - (BOOL
)suppressMakeKeyFront
;
71 - (void)setSuppressMakeKeyFront
:(BOOL
)inSuppress
;