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