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 |
|
24 | #ifdef __CORDOVA_4_0_0
|
25 | #import <Cordova/CDVUIWebViewDelegate.h>
|
26 | #else
|
27 | #import <Cordova/CDVWebViewDelegate.h>
|
28 | #endif
|
29 |
|
30 | @class CDVInAppBrowserViewController;
|
31 |
|
32 | @interface CDVInAppBrowser : CDVPlugin {
|
33 | }
|
34 |
|
35 | @property (nonatomic, retain) CDVInAppBrowserViewController* inAppBrowserViewController;
|
36 | @property (nonatomic, copy) NSString* callbackId;
|
37 | @property (nonatomic, copy) NSRegularExpression *callbackIdPattern;
|
38 |
|
39 | - (void)open:(CDVInvokedUrlCommand*)command;
|
40 | - (void)close:(CDVInvokedUrlCommand*)command;
|
41 | - (void)injectScriptCode:(CDVInvokedUrlCommand*)command;
|
42 | - (void)show:(CDVInvokedUrlCommand*)command;
|
43 | - (void)hide:(CDVInvokedUrlCommand*)command;
|
44 |
|
45 | @end
|
46 |
|
47 | @interface CDVInAppBrowserOptions : NSObject {}
|
48 |
|
49 | @property (nonatomic, assign) BOOL location;
|
50 | @property (nonatomic, assign) BOOL toolbar;
|
51 | @property (nonatomic, copy) NSString* closebuttoncaption;
|
52 | @property (nonatomic, copy) NSString* toolbarposition;
|
53 | @property (nonatomic, assign) BOOL clearcache;
|
54 | @property (nonatomic, assign) BOOL clearsessioncache;
|
55 |
|
56 | @property (nonatomic, copy) NSString* presentationstyle;
|
57 | @property (nonatomic, copy) NSString* transitionstyle;
|
58 |
|
59 | @property (nonatomic, assign) BOOL enableviewportscale;
|
60 | @property (nonatomic, assign) BOOL mediaplaybackrequiresuseraction;
|
61 | @property (nonatomic, assign) BOOL allowinlinemediaplayback;
|
62 | @property (nonatomic, assign) BOOL keyboarddisplayrequiresuseraction;
|
63 | @property (nonatomic, assign) BOOL suppressesincrementalrendering;
|
64 | @property (nonatomic, assign) BOOL hidden;
|
65 | @property (nonatomic, assign) BOOL disallowoverscroll;
|
66 |
|
67 | + (CDVInAppBrowserOptions*)parseOptions:(NSString*)options;
|
68 |
|
69 | @end
|
70 |
|
71 | @interface CDVInAppBrowserViewController : UIViewController <UIWebViewDelegate, CDVScreenOrientationDelegate>{
|
72 | @private
|
73 | NSString* _userAgent;
|
74 | NSString* _prevUserAgent;
|
75 | NSInteger _userAgentLockToken;
|
76 | CDVInAppBrowserOptions *_browserOptions;
|
77 |
|
78 | #ifdef __CORDOVA_4_0_0
|
79 | CDVUIWebViewDelegate* _webViewDelegate;
|
80 | #else
|
81 | CDVWebViewDelegate* _webViewDelegate;
|
82 | #endif
|
83 |
|
84 | }
|
85 |
|
86 | @property (nonatomic, strong) IBOutlet UIWebView* webView;
|
87 | @property (nonatomic, strong) IBOutlet UIBarButtonItem* closeButton;
|
88 | @property (nonatomic, strong) IBOutlet UILabel* addressLabel;
|
89 | @property (nonatomic, strong) IBOutlet UIBarButtonItem* backButton;
|
90 | @property (nonatomic, strong) IBOutlet UIBarButtonItem* forwardButton;
|
91 | @property (nonatomic, strong) IBOutlet UIActivityIndicatorView* spinner;
|
92 | @property (nonatomic, strong) IBOutlet UIToolbar* toolbar;
|
93 |
|
94 | @property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate;
|
95 | @property (nonatomic, weak) CDVInAppBrowser* navigationDelegate;
|
96 | @property (nonatomic) NSURL* currentURL;
|
97 |
|
98 | - (void)close;
|
99 | - (void)navigateTo:(NSURL*)url;
|
100 | - (void)showLocationBar:(BOOL)show;
|
101 | - (void)showToolBar:(BOOL)show : (NSString *) toolbarPosition;
|
102 | - (void)setCloseButtonTitle:(NSString*)title;
|
103 |
|
104 | - (id)initWithUserAgent:(NSString*)userAgent prevUserAgent:(NSString*)prevUserAgent browserOptions: (CDVInAppBrowserOptions*) browserOptions;
|
105 |
|
106 | @end
|
107 |
|
108 | @interface CDVInAppBrowserNavigationController : UINavigationController
|
109 |
|
110 | @property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate;
|
111 |
|
112 | @end
|
113 |
|