bug 818009 - canActivate: only click-to-play-type plugins are valid r=jaws
[gecko.git] / widget / cocoa / mozView.h
blob935cf9bf05178a97faa6ce6a6fc280c43c12147e
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 #include "npapi.h"
11 #undef DARWIN
12 #import <Cocoa/Cocoa.h>
13 class nsIWidget;
15 namespace mozilla {
16 namespace widget{
17 class TextInputHandler;
18 } // namespace widget
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.
25 @protocol mozView
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.
34 - (nsIWidget*)widget;
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
59 - (BOOL)isPluginView;
61 @end
63 // An informal protocol implemented by the NSWindow of the host application.
64 //
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;
73 @end
75 #endif // mozView_h_