2023-08-20 16:14:31 -04:00
|
|
|
/*
|
2024-07-30 14:01:05 -04:00
|
|
|
* Copyright (c) 2023-2024, Tim Flynn <trflynn89@serenityos.org>
|
2023-08-20 16:14:31 -04:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Forward.h>
|
2024-03-18 16:22:27 +13:00
|
|
|
#include <LibURL/URL.h>
|
2023-08-20 16:14:31 -04:00
|
|
|
|
2024-07-16 23:54:53 -06:00
|
|
|
#import <Cocoa/Cocoa.h>
|
2023-08-20 16:14:31 -04:00
|
|
|
|
2024-09-17 15:49:00 -04:00
|
|
|
@class Tab;
|
|
|
|
|
|
2023-09-10 19:49:53 +04:00
|
|
|
struct TabSettings {
|
|
|
|
|
BOOL should_show_line_box_borders { NO };
|
|
|
|
|
BOOL scripting_enabled { YES };
|
|
|
|
|
BOOL block_popups { YES };
|
|
|
|
|
BOOL same_origin_policy_enabled { NO };
|
2023-12-16 17:49:34 +03:30
|
|
|
ByteString user_agent_name { "Disabled"sv };
|
2024-07-09 07:30:27 +01:00
|
|
|
ByteString navigator_compatibility_mode { "chrome"sv };
|
2023-09-10 19:49:53 +04:00
|
|
|
};
|
|
|
|
|
|
2023-08-20 16:14:31 -04:00
|
|
|
@interface TabController : NSWindowController <NSWindowDelegate>
|
|
|
|
|
|
2024-07-30 14:01:05 -04:00
|
|
|
- (instancetype)init;
|
2024-09-17 15:49:00 -04:00
|
|
|
- (instancetype)initAsChild:(Tab*)parent
|
|
|
|
|
pageIndex:(u64)page_index;
|
2023-08-20 16:14:31 -04:00
|
|
|
|
2024-03-18 16:22:27 +13:00
|
|
|
- (void)loadURL:(URL::URL const&)url;
|
|
|
|
|
- (void)loadHTML:(StringView)html url:(URL::URL const&)url;
|
2023-08-20 16:14:31 -04:00
|
|
|
|
2024-03-18 16:22:27 +13:00
|
|
|
- (void)onLoadStart:(URL::URL const&)url isRedirect:(BOOL)isRedirect;
|
2024-04-14 16:54:30 -04:00
|
|
|
|
|
|
|
|
- (void)onURLChange:(URL::URL const&)url;
|
|
|
|
|
- (void)onBackNavigationEnabled:(BOOL)back_enabled
|
|
|
|
|
forwardNavigationEnabled:(BOOL)forward_enabled;
|
|
|
|
|
|
2023-12-16 17:49:34 +03:30
|
|
|
- (void)onTitleChange:(ByteString const&)title;
|
2023-08-20 16:14:31 -04:00
|
|
|
|
2024-09-03 22:43:54 +01:00
|
|
|
- (void)onCreateNewTab;
|
|
|
|
|
|
2023-08-20 16:14:31 -04:00
|
|
|
- (void)navigateBack:(id)sender;
|
|
|
|
|
- (void)navigateForward:(id)sender;
|
|
|
|
|
- (void)reload:(id)sender;
|
|
|
|
|
- (void)clearHistory;
|
|
|
|
|
|
2024-09-03 22:43:54 +01:00
|
|
|
- (void)setPopupBlocking:(BOOL)block_popups;
|
2024-09-04 07:13:40 +01:00
|
|
|
- (void)setScripting:(BOOL)enabled;
|
2023-12-16 17:49:34 +03:30
|
|
|
- (void)debugRequest:(ByteString const&)request argument:(ByteString const&)argument;
|
2023-09-10 19:49:53 +04:00
|
|
|
|
2023-08-20 16:14:31 -04:00
|
|
|
- (void)focusLocationToolbarItem;
|
|
|
|
|
|
|
|
|
|
@end
|