1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | #import <Cordova/CDVPlugin.h>
|
21 | #import <Cordova/CDVInvokedUrlCommand.h>
|
22 | #import <Cordova/CDVScreenOrientationDelegate.h>
|
23 | #import "CDVWKInAppBrowserUIDelegate.h"
|
24 | #import "CDVInAppBrowserOptions.h"
|
25 | #import "CDVInAppBrowserNavigationController.h"
|
26 |
|
27 | @class CDVWKInAppBrowserViewController;
|
28 |
|
29 | @interface CDVWKInAppBrowser : CDVPlugin {
|
30 | UIWindow * tmpWindow;
|
31 |
|
32 | @private
|
33 | NSString* _beforeload;
|
34 | BOOL _waitForBeforeload;
|
35 | }
|
36 |
|
37 | @property (nonatomic, retain) CDVWKInAppBrowser* instance;
|
38 | @property (nonatomic, retain) CDVWKInAppBrowserViewController* inAppBrowserViewController;
|
39 | @property (nonatomic, copy) NSString* callbackId;
|
40 | @property (nonatomic, copy) NSRegularExpression *callbackIdPattern;
|
41 |
|
42 | + (id) getInstance;
|
43 | - (void)open:(CDVInvokedUrlCommand*)command;
|
44 | - (void)close:(CDVInvokedUrlCommand*)command;
|
45 | - (void)injectScriptCode:(CDVInvokedUrlCommand*)command;
|
46 | - (void)show:(CDVInvokedUrlCommand*)command;
|
47 | - (void)hide:(CDVInvokedUrlCommand*)command;
|
48 | - (void)loadAfterBeforeload:(CDVInvokedUrlCommand*)command;
|
49 |
|
50 | @end
|
51 |
|
52 | @interface CDVWKInAppBrowserViewController : UIViewController <CDVScreenOrientationDelegate,WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,UIAdaptivePresentationControllerDelegate>{
|
53 | @private
|
54 | CDVInAppBrowserOptions *_browserOptions;
|
55 | NSDictionary *_settings;
|
56 | }
|
57 |
|
58 | @property (nonatomic, strong) IBOutlet WKWebView* webView;
|
59 | @property (nonatomic, strong) IBOutlet WKWebViewConfiguration* configuration;
|
60 | @property (nonatomic, strong) IBOutlet UIBarButtonItem* closeButton;
|
61 | @property (nonatomic, strong) IBOutlet UILabel* addressLabel;
|
62 | @property (nonatomic, strong) IBOutlet UIBarButtonItem* backButton;
|
63 | @property (nonatomic, strong) IBOutlet UIBarButtonItem* forwardButton;
|
64 | @property (nonatomic, strong) IBOutlet UIActivityIndicatorView* spinner;
|
65 | @property (nonatomic, strong) IBOutlet UIToolbar* toolbar;
|
66 | @property (nonatomic, strong) IBOutlet CDVWKInAppBrowserUIDelegate* webViewUIDelegate;
|
67 |
|
68 | @property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate;
|
69 | @property (nonatomic, weak) CDVWKInAppBrowser* navigationDelegate;
|
70 | @property (nonatomic) NSURL* currentURL;
|
71 |
|
72 | - (void)close;
|
73 | - (void)navigateTo:(NSURL*)url;
|
74 | - (void)showLocationBar:(BOOL)show;
|
75 | - (void)showToolBar:(BOOL)show : (NSString *) toolbarPosition;
|
76 | - (void)setCloseButtonTitle:(NSString*)title : (NSString*) colorString : (int) buttonIndex;
|
77 |
|
78 | - (id)initWithBrowserOptions: (CDVInAppBrowserOptions*) browserOptions andSettings:(NSDictionary*) settings;
|
79 |
|
80 | @end
|