YHExplorerViewController.h 1.91 KB
//
//  YHExplorerViewController.h
//  YohoExplorerDemo
//
//  Created by gaoqiang xu on 2/27/15.
//  Copyright (c) 2015 gaoqiang xu. All rights reserved.
//

#import "CDVViewController.h"
#import "CDVCommandDelegateImpl.h"
#import "CDVCommandQueue.h"
#import "CDVYHInterfaceDelegate.h"
#import "YHURLCache.h"
#import "YHLinkDefaultParser.h"
#import "YHExplorerWebViewDelegate.h"

@interface YHExplorerViewController : CDVViewController
<CDVYHInterfaceDelegate, YHExplorer>

/**
 *  存放一些自动跳转的scheme,目前有itms-apps, itms-appss
 可以往里面补充
 */
@property (strong, nonatomic) NSMutableArray * _Nonnull autoSchemes;
// 进度条功能的启动/停用
@property (nonatomic) BOOL progressBarEnabled;
// 本地机能列表
@property (readonly, strong, nonatomic) NSMutableArray * _Nonnull nativeAbilities;
// 自动处理默认的scheme跳转,如itms-apps
@property (nonatomic) BOOL automaticallySchemeHandle;
// 网页的title
@property (readonly, copy, nonatomic) NSString * _Nonnull pageTitle;
//滚动条所在的navibar
@property (weak, nonatomic) UINavigationBar * _Nullable currentNaviBar;
// 网页交互代理(包含UIWebView的代理)
@property (weak, nonatomic) id <YHExplorerDelegate> _Nullable delegate;
/**
 *  使用一个url初始化
 *
 *  @param url 地址
 *
 *  @return instance
 */
- (instancetype _Nonnull)initWithUrl:(NSString * _Nonnull)urlStr;

- (instancetype _Nonnull)initWithCurrentNaviBar:(UINavigationBar * _Nonnull)currentNaviBar;

/**
 @brief 使用NSURL进行初始化
 
 @param URL地址(支持file形式)
    WebUrl:
        NSURL *URL = [NSURL URLWithString:urlStr];
    File:
        NSURL *URL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"tmp.html" ofType:nil]];
 */
- (instancetype _Nonnull)initWithURL:(NSURL * _Nonnull)URL;
@end

@interface YHExplorerCommandDelegate : CDVCommandDelegateImpl
@end

@interface YHExplorerCommandQueue : CDVCommandQueue
@end