2020-11-14 08:25:38 -08:00
|
|
|
/* All Rights reserved */
|
|
|
|
|
2020-12-05 06:07:25 -08:00
|
|
|
#import <AppKit/AppKit.h>
|
|
|
|
#import "netsurf/netsurf.h"
|
|
|
|
#import "netsurf/mouse.h"
|
2021-02-10 11:15:59 -08:00
|
|
|
#import "Website.h"
|
2021-03-09 11:54:10 -08:00
|
|
|
#import "Preferences.h"
|
|
|
|
#import "VerticalTabsView.h"
|
2021-03-22 13:04:22 -07:00
|
|
|
#import "UrlSuggestionView.h"
|
2020-11-14 08:25:38 -08:00
|
|
|
|
2020-11-17 12:14:34 -08:00
|
|
|
struct browser_window;
|
2022-02-10 00:54:37 -08:00
|
|
|
struct form_control;
|
|
|
|
|
2021-03-09 11:54:10 -08:00
|
|
|
@interface BrowserWindowController : NSWindowController<NSTextFieldDelegate, VerticalTabsViewDelegate> {
|
2020-11-17 12:14:34 -08:00
|
|
|
id backButton;
|
|
|
|
id forwardButton;
|
|
|
|
id urlBar;
|
2021-02-17 13:04:38 -08:00
|
|
|
id tabView;
|
2020-12-04 12:30:45 -08:00
|
|
|
id refreshButton;
|
2020-12-05 07:43:34 -08:00
|
|
|
id caretView;
|
2020-12-05 06:07:25 -08:00
|
|
|
enum gui_pointer_shape lastRequestedPointer;
|
2021-02-10 11:15:59 -08:00
|
|
|
id searchBar;
|
|
|
|
id searchImage;
|
2021-04-08 12:47:23 -07:00
|
|
|
id searchLabel;
|
2021-02-17 13:04:38 -08:00
|
|
|
NSMutableArray *tabs;
|
2021-02-23 13:05:01 -08:00
|
|
|
BOOL isClosing;
|
2021-02-25 11:42:53 -08:00
|
|
|
id activeTab;
|
2021-03-04 12:00:54 -08:00
|
|
|
id verticalTabsView;
|
2021-03-09 11:54:10 -08:00
|
|
|
TabLocation currentTabLocation;
|
2021-03-22 13:04:22 -07:00
|
|
|
UrlSuggestionView *urlSuggestionView;
|
2021-03-09 11:54:10 -08:00
|
|
|
|
2021-02-17 13:04:38 -08:00
|
|
|
|
|
|
|
// These three are set based on the currently focused tab.
|
|
|
|
id scrollView;
|
|
|
|
id plotView;
|
|
|
|
struct browser_window *browser;
|
2020-11-14 08:25:38 -08:00
|
|
|
}
|
2020-11-14 13:45:05 -08:00
|
|
|
|
2020-11-17 12:14:34 -08:00
|
|
|
-(id)initWithBrowser: (struct browser_window*)aBrowser;
|
2020-12-04 12:30:45 -08:00
|
|
|
-(void)back: (id)sender;
|
|
|
|
-(void)forward: (id)sender;
|
|
|
|
-(void)stopOrRefresh: (id)sender;
|
2021-01-28 11:37:40 -08:00
|
|
|
-(NSString*)visibleUrl;
|
2021-02-10 11:15:59 -08:00
|
|
|
-(void)enterSearch: (id)sender;
|
|
|
|
-(void)openWebsite: (Website*)aWebsite;
|
2021-02-23 12:01:15 -08:00
|
|
|
-(void)newTab: (id)sender;
|
2021-02-25 11:42:53 -08:00
|
|
|
// Returns a tab identifier that must be provided to some of the below messages.
|
|
|
|
-(id)newTabWithBrowser: (struct browser_window*)aBrowser;
|
2021-02-23 12:01:15 -08:00
|
|
|
-(void)close: (id)sender;
|
2021-02-25 11:42:53 -08:00
|
|
|
-(id)initialTabId;
|
2020-11-21 07:53:14 -08:00
|
|
|
|
|
|
|
// Browser control
|
2021-02-25 11:42:53 -08:00
|
|
|
-(NSSize)getBrowserSizeForTab: (id)tab;
|
|
|
|
-(NSPoint)getBrowserScrollForTab: (id)tab;
|
|
|
|
-(void)setBrowserScroll: (NSPoint)scroll forTab: (id)tab;
|
|
|
|
-(void)invalidateBrowserForTab: (id)tab;
|
|
|
|
-(void)invalidateBrowser: (NSRect)rect forTab: (id)tab;
|
|
|
|
-(void)updateBrowserExtentForTab: (id)tab;
|
|
|
|
-(void)placeCaretAtX: (int)x y: (int)y height: (int)height inTab: (id)tab;
|
|
|
|
-(void)removeCaretInTab: (id)tab;
|
2020-12-05 06:07:25 -08:00
|
|
|
-(void)setPointerToShape: (enum gui_pointer_shape)shape;
|
2021-02-25 11:42:53 -08:00
|
|
|
-(void)newContentForTab: (id)tab;
|
|
|
|
-(void)setNavigationUrl: (NSString*)urlString forTab: (id)tab;
|
|
|
|
-(void)setTitle: (NSString*)title forTab: (id)tab;
|
|
|
|
-(void)netsurfWindowDestroyForTab: (id)tab;
|
|
|
|
|
2020-12-02 11:48:59 -08:00
|
|
|
-(void)startThrobber;
|
|
|
|
-(void)stopThrobber;
|
2020-12-14 13:27:23 -08:00
|
|
|
-(void)findNext: (NSString*)needle matchCase: (BOOL)matchCase sender: (id)sender;
|
|
|
|
-(void)findPrevious: (NSString*)needle matchCase: (BOOL)matchCase sender: (id)sender;
|
|
|
|
-(void)showAll: (NSString*)needle matchCase: (BOOL)matchCase sender: (id)sender;
|
2021-01-06 11:59:28 -08:00
|
|
|
-(void)bookmarkPage: (id)sender;
|
2020-12-14 13:27:23 -08:00
|
|
|
|
2022-02-10 00:54:37 -08:00
|
|
|
-(void)showDropdownMenuWithOptions: (NSArray*)options atLocation: (NSPoint)location inTab: (id)tab control: (struct form_control*)control;
|
|
|
|
|
2021-02-23 12:01:15 -08:00
|
|
|
|
|
|
|
+(id)newTabTarget;
|
2020-11-14 08:25:38 -08:00
|
|
|
@end
|