iOS web browser with a focus on security and privacy
1/*
2 * Endless
3 * Copyright (c) 2014-2015 joshua stein <jcs@jcs.org>
4 *
5 * See LICENSE file for redistribution terms.
6 */
7
8#import <UIKit/UIKit.h>
9#import "IASKAppSettingsViewController.h"
10#import "WebViewTab.h"
11#import "WYPopoverController.h"
12
13#define TOOLBAR_HEIGHT 47
14#define TOOLBAR_PADDING 6
15#define TOOLBAR_BUTTON_SIZE 30
16
17/* this just detects the iPhone X by its notch */
18#define HAS_OLED ([[[[UIApplication sharedApplication] delegate] window] safeAreaInsets].bottom > 0)
19
20typedef NS_ENUM(NSInteger, WebViewTabAnimation) {
21 WebViewTabAnimationDefault,
22 WebViewTabAnimationHidden,
23 WebViewTabAnimationQuick,
24};
25
26@interface WebViewController : UIViewController <UITableViewDelegate, UITextFieldDelegate, UIGestureRecognizerDelegate, UIScrollViewDelegate, IASKSettingsDelegate, WYPopoverControllerDelegate>
27
28@property BOOL toolbarOnBottom;
29@property BOOL darkInterface;
30
31- (void)focusUrlField;
32- (void)unfocusUrlField;
33
34- (NSMutableArray *)webViewTabs;
35- (__strong WebViewTab *)curWebViewTab;
36
37- (UIButton *)settingsButton;
38
39- (void)viewIsVisible;
40- (void)viewIsNoLongerVisible;
41
42- (WebViewTab *)addNewTabForURL:(NSURL *)url;
43- (WebViewTab *)addNewTabForURL:(NSURL *)url forRestoration:(BOOL)restoration withAnimation:(WebViewTabAnimation)animation withCompletionBlock:(void(^)(BOOL finished))block;
44- (void)addNewTabFromToolbar:(id)_id;
45- (void)switchToTab:(NSNumber *)tabNumber;
46- (void)removeTab:(NSNumber *)tabNumber andFocusTab:(NSNumber *)toFocus;
47- (void)removeTab:(NSNumber *)tabNumber;
48- (void)removeAllTabs;
49
50- (void)webViewTouched;
51- (void)updateProgress;
52- (void)updateSearchBarDetails;
53- (void)refresh;
54- (void)forceRefresh;
55- (void)dismissPopover;
56- (void)prepareForNewURLFromString:(NSString *)url;
57- (void)showBookmarksForEditing:(BOOL)editing;
58- (void)hideBookmarks;
59- (void)hideSearchResults;
60
61@end