--- chimera/BrowserWindowController.h 2002/04/08 22:30:20 1.32 +++ chimera/BrowserWindowController.h 2002/04/14 00:08:17 1.37 @@ -37,8 +37,12 @@ #import #import "MyBrowserView.h" +#import "Find.h" -@interface BrowserWindowController : NSWindowController +class nsIDOMEvent; +class nsIDOMNode; + +@interface BrowserWindowController : NSWindowController { IBOutlet id mTabBrowser; IBOutlet id mSidebarDrawer; @@ -52,6 +56,13 @@ IBOutlet id mLocationSheetURLField; IBOutlet id mSidebarBrowserView; IBOutlet id mSidebarBookmarksDataSource; + + // Context menu outlets. + IBOutlet id mPageMenu; + IBOutlet id mImageMenu; + IBOutlet id mInputMenu; + IBOutlet id mLinkMenu; + IBOutlet id mImageLinkMenu; NSToolbarItem *mLocationToolbarItem; NSToolbarItem *mSidebarToolbarItem; @@ -65,6 +76,18 @@ NSModalSession mModalSession; BOOL mShouldAutosave; + + BOOL mDrawerCachedFrame; + NSRect mCachedFrameBeforeDrawerOpen; // This is used by the drawer to figure out if the window should + // be returned to its original position when the drawer closes. + NSRect mCachedFrameAfterDrawerOpen; + + int mChromeMask; // Indicates which parts of the window to show (e.g., don't show toolbars) + + // Context menu members. + int mContextMenuFlags; + nsIDOMEvent* mContextMenuEvent; + nsIDOMNode* mContextMenuNode; } - (void)dealloc; @@ -85,8 +108,7 @@ - (void)printDocument; - (void)printPreview; -- (void)findInPage:(NSString*)text; -- (void)findAgain; +//- (BOOL)findInPage:(NSString*)text; - (void)addBookmark; @@ -109,4 +131,17 @@ -(void)autosaveWindowFrame; -(void)disableAutosave; +-(void)setChromeMask:(int)aMask; + +// Called when a context menu should be shown. +- (void)onShowContextMenu:(int)flags domEvent:(nsIDOMEvent*)aEvent domNode:(nsIDOMNode*)aNode; +- (NSMenu*)getContextMenu; + +// Context menu methods +- (IBAction)openLinkInNewWindow:(id)aSender; +- (IBAction)openLinkInNewTab:(id)aSender; +-(void)openLinkInNewWindowOrTab: (BOOL)aUseWindow; +- (IBAction)saveLinkAs:(id)aSender; +- (IBAction)saveImageAs:(id)aSender; + @end