1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/cocoa/mozView.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,75 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef mozView_h_ 1.10 +#define mozView_h_ 1.11 + 1.12 +#include "npapi.h" 1.13 + 1.14 +#undef DARWIN 1.15 +#import <Cocoa/Cocoa.h> 1.16 +class nsIWidget; 1.17 + 1.18 +namespace mozilla { 1.19 +namespace widget{ 1.20 +class TextInputHandler; 1.21 +} // namespace widget 1.22 +} // namespace mozilla 1.23 + 1.24 +// A protocol listing all the methods that an object which wants 1.25 +// to live in gecko's widget hierarchy must implement. |nsChildView| 1.26 +// makes assumptions that any NSView with which it comes in contact will 1.27 +// implement this protocol. 1.28 +@protocol mozView 1.29 + 1.30 + // aHandler is Gecko's default text input handler: It implements the 1.31 + // NSTextInput protocol to handle key events. Don't make aHandler a 1.32 + // strong reference -- that causes a memory leak. 1.33 +- (void)installTextInputHandler:(mozilla::widget::TextInputHandler*)aHandler; 1.34 +- (void)uninstallTextInputHandler; 1.35 + 1.36 + // access the nsIWidget associated with this view. DOES NOT ADDREF. 1.37 +- (nsIWidget*)widget; 1.38 + 1.39 + // return a context menu for this view 1.40 +- (NSMenu*)contextMenu; 1.41 + 1.42 + // Allows callers to do a delayed invalidate (e.g., if an invalidate 1.43 + // happens during drawing) 1.44 +- (void)setNeedsPendingDisplay; 1.45 +- (void)setNeedsPendingDisplayInRect:(NSRect)invalidRect; 1.46 + 1.47 + // called when our corresponding Gecko view goes away 1.48 +- (void)widgetDestroyed; 1.49 + 1.50 +- (BOOL)isDragInProgress; 1.51 + 1.52 + // Gets the plugin event model for the view 1.53 +- (NPEventModel)pluginEventModel; 1.54 + 1.55 + // Checks whether the view is first responder or not 1.56 +- (BOOL)isFirstResponder; 1.57 + 1.58 + // Call when you dispatch an event which may cause to open context menu. 1.59 +- (void)maybeInitContextMenuTracking; 1.60 + 1.61 + // Checks whether the view is for plugin or not 1.62 +- (BOOL)isPluginView; 1.63 + 1.64 +@end 1.65 + 1.66 +// An informal protocol implemented by the NSWindow of the host application. 1.67 +// 1.68 +// It's used to prevent re-entrant calls to -makeKeyAndOrderFront: when gecko 1.69 +// focus/activate events propagate out to the embedder's 1.70 +// nsIEmbeddingSiteWindow::SetFocus implementation. 1.71 +@interface NSObject(mozWindow) 1.72 + 1.73 +- (BOOL)suppressMakeKeyFront; 1.74 +- (void)setSuppressMakeKeyFront:(BOOL)inSuppress; 1.75 + 1.76 +@end 1.77 + 1.78 +#endif // mozView_h_