|
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/. */ |
|
5 |
|
6 #ifndef mozView_h_ |
|
7 #define mozView_h_ |
|
8 |
|
9 #include "npapi.h" |
|
10 |
|
11 #undef DARWIN |
|
12 #import <Cocoa/Cocoa.h> |
|
13 class nsIWidget; |
|
14 |
|
15 namespace mozilla { |
|
16 namespace widget{ |
|
17 class TextInputHandler; |
|
18 } // namespace widget |
|
19 } // namespace mozilla |
|
20 |
|
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 |
|
26 |
|
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; |
|
32 |
|
33 // access the nsIWidget associated with this view. DOES NOT ADDREF. |
|
34 - (nsIWidget*)widget; |
|
35 |
|
36 // return a context menu for this view |
|
37 - (NSMenu*)contextMenu; |
|
38 |
|
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; |
|
43 |
|
44 // called when our corresponding Gecko view goes away |
|
45 - (void)widgetDestroyed; |
|
46 |
|
47 - (BOOL)isDragInProgress; |
|
48 |
|
49 // Gets the plugin event model for the view |
|
50 - (NPEventModel)pluginEventModel; |
|
51 |
|
52 // Checks whether the view is first responder or not |
|
53 - (BOOL)isFirstResponder; |
|
54 |
|
55 // Call when you dispatch an event which may cause to open context menu. |
|
56 - (void)maybeInitContextMenuTracking; |
|
57 |
|
58 // Checks whether the view is for plugin or not |
|
59 - (BOOL)isPluginView; |
|
60 |
|
61 @end |
|
62 |
|
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) |
|
69 |
|
70 - (BOOL)suppressMakeKeyFront; |
|
71 - (void)setSuppressMakeKeyFront:(BOOL)inSuppress; |
|
72 |
|
73 @end |
|
74 |
|
75 #endif // mozView_h_ |