michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozView_h_ michael@0: #define mozView_h_ michael@0: michael@0: #include "npapi.h" michael@0: michael@0: #undef DARWIN michael@0: #import michael@0: class nsIWidget; michael@0: michael@0: namespace mozilla { michael@0: namespace widget{ michael@0: class TextInputHandler; michael@0: } // namespace widget michael@0: } // namespace mozilla michael@0: michael@0: // A protocol listing all the methods that an object which wants michael@0: // to live in gecko's widget hierarchy must implement. |nsChildView| michael@0: // makes assumptions that any NSView with which it comes in contact will michael@0: // implement this protocol. michael@0: @protocol mozView michael@0: michael@0: // aHandler is Gecko's default text input handler: It implements the michael@0: // NSTextInput protocol to handle key events. Don't make aHandler a michael@0: // strong reference -- that causes a memory leak. michael@0: - (void)installTextInputHandler:(mozilla::widget::TextInputHandler*)aHandler; michael@0: - (void)uninstallTextInputHandler; michael@0: michael@0: // access the nsIWidget associated with this view. DOES NOT ADDREF. michael@0: - (nsIWidget*)widget; michael@0: michael@0: // return a context menu for this view michael@0: - (NSMenu*)contextMenu; michael@0: michael@0: // Allows callers to do a delayed invalidate (e.g., if an invalidate michael@0: // happens during drawing) michael@0: - (void)setNeedsPendingDisplay; michael@0: - (void)setNeedsPendingDisplayInRect:(NSRect)invalidRect; michael@0: michael@0: // called when our corresponding Gecko view goes away michael@0: - (void)widgetDestroyed; michael@0: michael@0: - (BOOL)isDragInProgress; michael@0: michael@0: // Gets the plugin event model for the view michael@0: - (NPEventModel)pluginEventModel; michael@0: michael@0: // Checks whether the view is first responder or not michael@0: - (BOOL)isFirstResponder; michael@0: michael@0: // Call when you dispatch an event which may cause to open context menu. michael@0: - (void)maybeInitContextMenuTracking; michael@0: michael@0: // Checks whether the view is for plugin or not michael@0: - (BOOL)isPluginView; michael@0: michael@0: @end michael@0: michael@0: // An informal protocol implemented by the NSWindow of the host application. michael@0: // michael@0: // It's used to prevent re-entrant calls to -makeKeyAndOrderFront: when gecko michael@0: // focus/activate events propagate out to the embedder's michael@0: // nsIEmbeddingSiteWindow::SetFocus implementation. michael@0: @interface NSObject(mozWindow) michael@0: michael@0: - (BOOL)suppressMakeKeyFront; michael@0: - (void)setSuppressMakeKeyFront:(BOOL)inSuppress; michael@0: michael@0: @end michael@0: michael@0: #endif // mozView_h_