2002-04-05 01:35:20 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2002-04-05 01:35:20 +04:00
|
|
|
|
2007-01-18 09:34:07 +03:00
|
|
|
#ifndef mozView_h_
|
|
|
|
#define mozView_h_
|
|
|
|
|
2002-12-13 11:43:18 +03:00
|
|
|
#undef DARWIN
|
2002-04-05 01:35:20 +04:00
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
class nsIWidget;
|
|
|
|
|
2011-05-08 14:19:23 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace widget {
|
|
|
|
class TextInputHandler;
|
|
|
|
} // namespace widget
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2019-02-13 14:14:02 +03:00
|
|
|
// A protocol with some of the methods that ChildView implements. In the distant
|
|
|
|
// past, this protocol was used by embedders: They would create their own NSView
|
|
|
|
// subclass, implement mozView on it, and then embed a Gecko ChildView by adding
|
|
|
|
// it as a subview of this view. This scenario no longer exists.
|
|
|
|
// Now this protocol is mostly just used by TextInputHandler and mozAccessible
|
|
|
|
// in order to communicate with ChildView without seeing the entire ChildView
|
|
|
|
// interface definition.
|
2002-04-05 01:35:20 +04:00
|
|
|
@protocol mozView
|
|
|
|
|
2011-05-08 14:19:23 +04: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;
|
|
|
|
|
2002-04-05 01:35:20 +04:00
|
|
|
// access the nsIWidget associated with this view. DOES NOT ADDREF.
|
2005-09-30 04:59:29 +04:00
|
|
|
- (nsIWidget*)widget;
|
2002-04-05 01:35:20 +04:00
|
|
|
|
2005-09-30 04:59:29 +04:00
|
|
|
// called when our corresponding Gecko view goes away
|
|
|
|
- (void)widgetDestroyed;
|
|
|
|
|
2011-03-23 21:46:57 +03:00
|
|
|
- (BOOL)isDragInProgress;
|
|
|
|
|
2011-02-23 21:06:26 +03: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;
|
|
|
|
|
2002-04-05 01:35:20 +04:00
|
|
|
@end
|
|
|
|
|
2005-10-12 21:38:29 +04:00
|
|
|
// 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
|
2007-01-18 09:34:07 +03:00
|
|
|
|
|
|
|
#endif // mozView_h_
|