Loki
3 years ago
467 changed files with 254 additions and 19989 deletions
@ -1,24 +0,0 @@ |
|||||||
//
|
|
||||||
// UniappPlugin.h
|
|
||||||
// Runner
|
|
||||||
//
|
|
||||||
// Created by tangziyang on 2021/7/6.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef UniappPlugin_h |
|
||||||
#define UniappPlugin_h |
|
||||||
|
|
||||||
#import "DCUniMP.h" |
|
||||||
#import <Flutter/Flutter.h> |
|
||||||
//#import "AFNetworking.h"
|
|
||||||
|
|
||||||
#endif /* UniappPlugin_h */ |
|
||||||
|
|
||||||
@interface UniappPlugin:NSObject <DCUniMPSDKEngineDelegate> |
|
||||||
|
|
||||||
-(void)open:(NSString*)appid url:(NSString*)wgtUrl param:(NSDictionary*)dict block:(void (^)(void))block; |
|
||||||
|
|
||||||
-(void)openUniApp:(NSString *)name dict:(NSDictionary *)dict; |
|
||||||
|
|
||||||
//-(void)downloadWgt:(NSString *)url appid:(NSString*)appid block:(void (^)(NSString * tips))block success:(void (^)(void))success;
|
|
||||||
@end |
|
@ -1,78 +0,0 @@ |
|||||||
// |
|
||||||
// UniappPlugin.m |
|
||||||
// Runner |
|
||||||
// |
|
||||||
// Created by tangziyang on 2021/7/6. |
|
||||||
// |
|
||||||
|
|
||||||
#import "UniappPlugin.h" |
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
@implementation UniappPlugin |
|
||||||
|
|
||||||
-(void)open:(NSString *)appid url:(NSString *)wgtUrl param:(NSDictionary *)dict block:(void (^)(void))block{ |
|
||||||
if (![DCUniMPSDKEngine isExistsApp:appid]) { |
|
||||||
//不存在准备下载 |
|
||||||
// [self downloadWgt:wgtUrl appid:appid block:nil success:^{ |
|
||||||
// [self openUniApp:appid dict:dict]; |
|
||||||
// }]; |
|
||||||
}else{ |
|
||||||
[self openUniApp:appid dict:dict]; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
-(void)openUniApp:(NSString *)name dict:(NSDictionary *)dict{ |
|
||||||
DCUniMPConfiguration *configuration = [[DCUniMPConfiguration alloc] init]; |
|
||||||
[configuration setShowAnimated:YES]; |
|
||||||
[configuration setHideAnimated:YES]; |
|
||||||
[configuration setOpenMode:DCUniMPOpenModePresent]; |
|
||||||
[configuration setEnableGestureClose:YES]; |
|
||||||
[configuration setArguments:dict]; |
|
||||||
[DCUniMPSDKEngine openUniMP:name configuration:configuration completed:^(DCUniMPInstance * _Nullable uniMPInstance, NSError * _Nullable error) { |
|
||||||
if (uniMPInstance) { |
|
||||||
NSLog(@"打开成功"); |
|
||||||
}else{ |
|
||||||
NSLog(@"打开失败:%@",error); |
|
||||||
} |
|
||||||
}]; |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
//-(void)downloadWgt:(NSString *)url appid:(NSString *)appid block:(void (^)(NSString *))block success:(void (^)(void))success{ |
|
||||||
// NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; |
|
||||||
// AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; |
|
||||||
// NSLog(@"url:%@",url); |
|
||||||
// NSURL *URL = [NSURL URLWithString:url]; |
|
||||||
// NSURLRequest *request = [NSURLRequest requestWithURL:URL]; |
|
||||||
// |
|
||||||
// NSURLSessionDownloadTask *downloadTask = [manager downloadTaskWithRequest:request progress:^(NSProgress * _Nonnull downloadProgress) { |
|
||||||
// // |
|
||||||
// NSLog(@"downloadProgress:%f",downloadProgress.fractionCompleted); |
|
||||||
// //block([NSString stringWithFormat:@"loading...%f",downloadProgress.fractionCompleted]); |
|
||||||
// } destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) { |
|
||||||
// NSURL *documentsDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; |
|
||||||
// return [documentsDirectoryURL URLByAppendingPathComponent:[response suggestedFilename]]; |
|
||||||
// } completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) { |
|
||||||
// NSLog(@"File downloaded to: %@", filePath); |
|
||||||
// if ([DCUniMPSDKEngine releaseAppResourceToRunPathWithAppid:appid resourceFilePath:filePath.path]) { |
|
||||||
// NSLog(@"应用资源文件部署成功"); |
|
||||||
// //直接打开 |
|
||||||
// success(); |
|
||||||
// } |
|
||||||
// }]; |
|
||||||
// [downloadTask resume]; |
|
||||||
//} |
|
||||||
|
|
||||||
|
|
||||||
-(void)uniMPOnClose:(NSString *)appid{ |
|
||||||
NSLog(@"小程序关闭"); |
|
||||||
} |
|
||||||
|
|
||||||
-(void)defaultMenuItemClicked:(NSString *)identifier{ |
|
||||||
NSLog(@"胶囊点击"); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
@end |
|
||||||
|
|
@ -1,22 +0,0 @@ |
|||||||
//
|
|
||||||
// DCUniMP.h
|
|
||||||
// DCUniMP
|
|
||||||
//
|
|
||||||
// Created by XHY on 2020/1/14.
|
|
||||||
// Copyright © 2020 DCloud. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
//! Project version number for DCUniMP.
|
|
||||||
FOUNDATION_EXPORT double DCUniMPVersionNumber; |
|
||||||
|
|
||||||
//! Project version string for DCUniMP.
|
|
||||||
FOUNDATION_EXPORT const unsigned char DCUniMPVersionString[]; |
|
||||||
|
|
||||||
// In this header, you should import all the public headers of your framework using statements like #import <DCUniMP/PublicHeader.h>
|
|
||||||
|
|
||||||
#import "DCUniMPSDKEngine.h" |
|
||||||
#import "DCUniMPMenuActionSheetStyle.h" |
|
||||||
#import "DCUniMPInstance.h" |
|
||||||
#import "DCUniMPError.h" |
|
@ -1,33 +0,0 @@ |
|||||||
//
|
|
||||||
// DCUniMPConfiguration.h
|
|
||||||
// libPDRCore
|
|
||||||
//
|
|
||||||
// Created by XHY on 2020/6/16.
|
|
||||||
// Copyright © 2020 DCloud. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN |
|
||||||
|
|
||||||
/// 打开小程序页面的方式
|
|
||||||
typedef NS_ENUM(NSUInteger,DCUniMPOpenMode) { |
|
||||||
/// 获取宿主当前显示的 ViewController 调用 presentViewController:animated:completion: 方法打开小程序页面对应的 DCUniMPViewController
|
|
||||||
DCUniMPOpenModePresent, |
|
||||||
/// 获取宿主当前显示的 ViewController 对应的 navigationController 调用 pushViewController:animated: 方法打开小程序页面对应的 DCUniMPViewController,注意:如果 navigationController 不存在则使用 DCUniMPOpenModePresent 的方式打开
|
|
||||||
DCUniMPOpenModePush |
|
||||||
}; |
|
||||||
|
|
||||||
@interface DCUniMPConfiguration : NSObject |
|
||||||
|
|
||||||
@property (nonatomic, strong, nullable) NSDictionary *arguments; /**< 启动参数(在小程序中通过 plus.runtime.arguments 获取此参数)默认:nil*/ |
|
||||||
@property (nonatomic, copy, nullable) NSString *redirectPath; /**< 启动后直接打开的页面路径 例:"pages/component/view/view?a=1&b=2" 默认:nil*/ |
|
||||||
@property (nonatomic, assign) BOOL enableBackground; /**< 是否开启后台运行(退出小程序时隐藏到后台不销毁小程序应用) 默认:NO*/ |
|
||||||
@property (nonatomic, assign) BOOL showAnimated; /**< 是否开启 show 小程序时的动画效果 默认:YES */ |
|
||||||
@property (nonatomic, assign) BOOL hideAnimated; /**< 是否开启 hide 时的动画效果 默认:YES*/ |
|
||||||
@property (nonatomic, assign) DCUniMPOpenMode openMode; /**< 打开小程序的方式 默认: DCUniMPOpenModePresent*/ |
|
||||||
@property(nonatomic, assign) BOOL enableGestureClose; /**< 是否开启手势关闭小程序 默认:NO */ |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END |
|
@ -1,29 +0,0 @@ |
|||||||
//
|
|
||||||
// DCUniMPError.h
|
|
||||||
// libPDRCore
|
|
||||||
//
|
|
||||||
// Created by XHY on 2020/6/15.
|
|
||||||
// Copyright © 2020 DCloud. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN |
|
||||||
|
|
||||||
static NSString * const DCUniMPErrorDomain = @"DCUniMPErrorDomain"; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger,DCUniMPErrorCode) { |
|
||||||
/// 未知错误
|
|
||||||
DCUniMPErrorUnknown = -999, |
|
||||||
/// 应用资源不存在
|
|
||||||
DCUniMPErrorUniMPResourcesDoesNotExist = -1001, |
|
||||||
/// 非v3编译模式
|
|
||||||
DCUniMPErrorNotCompiledByV3Mode = -1002, |
|
||||||
/// 重复调用
|
|
||||||
DCUniMPErrorRepeatedBehavior = -2001, |
|
||||||
/// 小程序未运行
|
|
||||||
DCUniMPErrorUniMPNotRunning = -3001, |
|
||||||
/// 已存在运行的小程序
|
|
||||||
DCUniMPErrorExistOtherUniMPRunning = 3002 |
|
||||||
}; |
|
||||||
NS_ASSUME_NONNULL_END |
|
@ -1,38 +0,0 @@ |
|||||||
//
|
|
||||||
// DCUniMPInstance.h
|
|
||||||
// DCUniMP
|
|
||||||
//
|
|
||||||
// Created by XHY on 2020/1/14.
|
|
||||||
// Copyright © 2020 DCloud. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "DCUniMPConfiguration.h" |
|
||||||
|
|
||||||
/// 方法执行回调block
|
|
||||||
/// @param success 是否执行成功
|
|
||||||
/// @param error 失败信息
|
|
||||||
typedef void(^DCUniMPResultBlock)(BOOL success, NSError *_Nullable error); |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN |
|
||||||
|
|
||||||
@interface DCUniMPInstance : NSObject |
|
||||||
|
|
||||||
@property (nonatomic, copy, readonly) NSString *appid; /**< 小程序的 appid */ |
|
||||||
@property (nonatomic, strong) DCUniMPConfiguration *configuration; /**< 小程序应用的配置信息 */ |
|
||||||
|
|
||||||
/// 将小程序显示到前台
|
|
||||||
/// @param completion 方法执行回调
|
|
||||||
- (void)showWithCompletion:(DCUniMPResultBlock)completion; |
|
||||||
|
|
||||||
/// 将小程序隐藏到后台
|
|
||||||
/// @param completion 方法执行回调
|
|
||||||
- (void)hideWithCompletion:(DCUniMPResultBlock)completion; |
|
||||||
|
|
||||||
/// 关闭小程序
|
|
||||||
/// @param completion 方法执行回调
|
|
||||||
- (void)closeWithCompletion:(DCUniMPResultBlock)completion; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END |
|
@ -1,43 +0,0 @@ |
|||||||
//
|
|
||||||
// DCUniMPMenuActionSheetStyle.h
|
|
||||||
// libPDRCore
|
|
||||||
//
|
|
||||||
// Created by XHY on 2020/2/5.
|
|
||||||
// Copyright © 2020 DCloud. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN |
|
||||||
|
|
||||||
@interface DCUniMPMenuActionSheetStyle : NSObject |
|
||||||
|
|
||||||
/// ActionSheet 按钮字体颜色 支持:"#RRGGBB" 和 "rgba(R,G,B,A)" 格式字符串。默认值黑色
|
|
||||||
@property (nonatomic, copy) NSString *textColor; |
|
||||||
|
|
||||||
/// ActionSheet 按钮文字大小 。默认值 16
|
|
||||||
@property (nonatomic, assign) CGFloat fontSize; |
|
||||||
|
|
||||||
/// ActionSheet 按钮文字的粗细 可取值:"normal" - 标准字体; "bold" - 加粗字体。 默认值为"normal"。
|
|
||||||
@property (nonatomic, copy) NSString *fontWeight; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@interface DCUniMPMenuActionSheetItem : NSObject |
|
||||||
|
|
||||||
/// 标题
|
|
||||||
@property (nonatomic, copy) NSString *title; |
|
||||||
|
|
||||||
/// item 标识(当点击 ActionSheet 对应的 item 返回此标识)
|
|
||||||
@property (nonatomic, copy) NSString *identifier; |
|
||||||
|
|
||||||
|
|
||||||
/// 实例化方法
|
|
||||||
/// @param title 标题
|
|
||||||
/// @param identifier 标识
|
|
||||||
- (instancetype)initWithTitle:(NSString *)title identifier:(NSString *)identifier; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END |
|
@ -1,185 +0,0 @@ |
|||||||
//
|
|
||||||
// DCUniMPSDKEngine.h
|
|
||||||
// DCUniMP
|
|
||||||
//
|
|
||||||
// Created by XHY on 2020/1/14.
|
|
||||||
// Copyright © 2020 DCloud. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
#import "DCUniMPInstance.h" |
|
||||||
#import "DCUniMPMenuActionSheetStyle.h" |
|
||||||
|
|
||||||
/// 加载小程序 block 回调
|
|
||||||
/// uniMPInstance: 加载成功返回小程序实例,失败则为 nil
|
|
||||||
/// error:失败信息
|
|
||||||
typedef void(^DCUniMPCompletionBlock)(DCUniMPInstance *_Nullable uniMPInstance, NSError *_Nullable error); |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN |
|
||||||
|
|
||||||
@protocol DCUniMPSDKEngineDelegate <NSObject> |
|
||||||
|
|
||||||
///
|
|
||||||
/// 回调数据给小程序
|
|
||||||
/// result:回调参数支持 NSString 或 NSDictionary 类型
|
|
||||||
/// keepAlive:如果 keepAlive 为 YES,则可以多次回调数据给小程序,反之触发一次后回调方法即被移除
|
|
||||||
typedef void (^DCUniMPKeepAliveCallback)(id result, BOOL keepAlive); |
|
||||||
|
|
||||||
@optional |
|
||||||
/// 胶囊按钮菜单 ActionSheetItem 点击回调方法
|
|
||||||
/// @param identifier item 项的标识
|
|
||||||
- (void)defaultMenuItemClicked:(NSString *)identifier; |
|
||||||
|
|
||||||
/// 返回打开小程序时的闪屏视图
|
|
||||||
/// @param appid appid
|
|
||||||
- (UIView *)splashViewForApp:(NSString *)appid; |
|
||||||
|
|
||||||
/// 关闭小程序的回调方法
|
|
||||||
/// @param appid appid
|
|
||||||
- (void)uniMPOnClose:(NSString *)appid; |
|
||||||
|
|
||||||
|
|
||||||
/// 小程序向原生发送事件回调方法
|
|
||||||
/// @param event 事件名称
|
|
||||||
/// @param data 数据:NSString 或 NSDictionary 类型
|
|
||||||
/// @param callback 回调数据给小程序
|
|
||||||
- (void)onUniMPEventReceive:(NSString *)event data:(id)data callback:(DCUniMPKeepAliveCallback)callback; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@interface DCUniMPSDKEngine : NSObject |
|
||||||
|
|
||||||
#pragma mark - SDK 全局生命周期方法 |
|
||||||
/// 初始化 sdk 全局环境
|
|
||||||
/// @param options 启动参数
|
|
||||||
+ (void)initSDKEnvironmentWithLaunchOptions:(NSDictionary *)options; |
|
||||||
|
|
||||||
/// 释放SDK资源
|
|
||||||
+ (void)destory; |
|
||||||
|
|
||||||
#pragma mark - 小程序应用相关方法 |
|
||||||
|
|
||||||
/// 小程序打开状态,调用此方法可获取小程序对应的 DCUniMPViewController 实例
|
|
||||||
+ (UIViewController *)getUniMPViewController; |
|
||||||
|
|
||||||
/// 获取 App 运行路径,注:需要将应用资源放到此路径下
|
|
||||||
/// @param appid appid
|
|
||||||
+ (NSString *)getAppRunPathWithAppid:(NSString *)appid; |
|
||||||
|
|
||||||
/// 运行目录中是否已经存在 App
|
|
||||||
/// @param appid appid
|
|
||||||
+ (BOOL)isExistsApp:(NSString *)appid; |
|
||||||
|
|
||||||
/// 将wgt应用资源包部署到运行路径中
|
|
||||||
/// @param appid appid
|
|
||||||
/// @param wgtPath wgt应用资源包路径
|
|
||||||
+ (BOOL)releaseAppResourceToRunPathWithAppid:(NSString *)appid |
|
||||||
resourceFilePath:(NSString *)wgtPath; |
|
||||||
|
|
||||||
/// 启动小程序
|
|
||||||
/// @param appid appid
|
|
||||||
/// @param configuration 小程序的配置信息
|
|
||||||
/// @param completionBlock 方法执行回调
|
|
||||||
+ (void)openUniMP:(NSString *)appid |
|
||||||
configuration:(DCUniMPConfiguration *)configuration |
|
||||||
completed:(DCUniMPCompletionBlock)completionBlock; |
|
||||||
|
|
||||||
/// 预加载小程序
|
|
||||||
/// @param appid appid
|
|
||||||
/// @param configuration 小程序的配置信息
|
|
||||||
/// @param completionBlock 方法执行回调
|
|
||||||
+ (void)preloadUniMP:(NSString *)appid |
|
||||||
configuration:(DCUniMPConfiguration * __nullable)configuration |
|
||||||
completed:(DCUniMPCompletionBlock)completionBlock; |
|
||||||
|
|
||||||
/// 关闭当前显示的小程序应用
|
|
||||||
+ (void)closeUniMP; |
|
||||||
|
|
||||||
/// 获取当前显示的小程序appid
|
|
||||||
+ (NSString *)getActiveUniMPAppid; |
|
||||||
|
|
||||||
|
|
||||||
/// 获取当前显示小程序页面的直达链接url
|
|
||||||
+ (NSString *)getCurrentPageUrl; |
|
||||||
|
|
||||||
|
|
||||||
/// 获取已经部署的小程序应用资源版本信息
|
|
||||||
/// @param appid appid
|
|
||||||
/// 返回数据为 manifest 中的配置信息
|
|
||||||
/// {
|
|
||||||
/// "name": "1.0.0", // 应用版本名称
|
|
||||||
/// "code": 100 // 应用版本号
|
|
||||||
/// }
|
|
||||||
+ (NSDictionary *__nullable)getUniMPVersionInfoWithAppid:(NSString *)appid; |
|
||||||
|
|
||||||
|
|
||||||
/// 向小程序发送事件
|
|
||||||
/// @param event 事件名称
|
|
||||||
/// @param data 数据:NSString 或 NSDictionary 类型
|
|
||||||
+ (void)sendUniMPEvent:(NSString *)event data:(id)data; |
|
||||||
|
|
||||||
/// 小程序页面关闭时设置原生导航栏的显隐 (请使用此方法来控制进入小程序页面或离开小程序页面导航栏的显隐,不然导航栏的显隐效果不好,可能会出现闪一下的情况)
|
|
||||||
/// 说明:当小程序是通过 DCUniMPOpenModePush 方式打开(即通过原生导航控制器push方式打开小程序页面)如果系统导航栏是显示状态,进入小程序时会隐藏系统导航栏并在小程序页面关闭或从小程序页面在 push 到宿主其他原生页面时会将系统导航栏恢复之前的显隐状态;如果您想控制导航栏的显隐可通过此方法来实现
|
|
||||||
/// 场景:在显示系统导航栏的页面 push 进入小程序页面,从小程序页面 push 到其他原生页面时需要隐藏系统导航栏,则可以在跳转页面前调用此方法来处理;
|
|
||||||
/// 注意:只有通过 push 的方式打开小程序才生效
|
|
||||||
/// @param hidden 是否隐藏
|
|
||||||
+ (void)whenUniMPCloseSetNavigationBarHidden:(BOOL)hidden; |
|
||||||
|
|
||||||
#pragma mark - 胶囊按钮相关方法 |
|
||||||
|
|
||||||
/// 设置导航栏上的胶囊按钮显示还是隐藏(默认显示)
|
|
||||||
/// @param menuButtonHidden Bool 是否隐藏胶囊按钮
|
|
||||||
+ (void)setMenuButtonHidden:(BOOL)menuButtonHidden; |
|
||||||
|
|
||||||
/// 配置点击菜单按钮弹出 ActionSheet 视图的样式
|
|
||||||
/// @param menuActionSheetStyle DCUniMPMenuActionSheetStyle
|
|
||||||
+ (void)configMenuActionSheetStyle:(DCUniMPMenuActionSheetStyle *)menuActionSheetStyle; |
|
||||||
|
|
||||||
/// 配置胶囊按钮菜单 ActionSheet 全局项
|
|
||||||
/// @param items DCUniMPMenuActionSheetItem 数组
|
|
||||||
+ (void)setDefaultMenuItems:(NSArray<DCUniMPMenuActionSheetItem *> *)items; |
|
||||||
|
|
||||||
|
|
||||||
/// 设置 DCUniMPSDKEngineDelegate
|
|
||||||
/// @param delegate 代理对象
|
|
||||||
+ (void)setDelegate:(id<DCUniMPSDKEngineDelegate>)delegate; |
|
||||||
|
|
||||||
#pragma mark - App 生命周期方法 |
|
||||||
+ (void)applicationDidBecomeActive:(UIApplication *)application; |
|
||||||
+ (void)applicationWillResignActive:(UIApplication *)application; |
|
||||||
+ (void)applicationDidEnterBackground:(UIApplication *)application; |
|
||||||
+ (void)applicationWillEnterForeground:(UIApplication *)application; |
|
||||||
|
|
||||||
|
|
||||||
#pragma mark - 如果需要使用 URL Scheme 或 通用链接相关功能,请实现以下方法 |
|
||||||
+ (void)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options; |
|
||||||
+ (void)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity; |
|
||||||
|
|
||||||
#pragma mark - 如需使用远程推送相关功能,请实现以下方法 |
|
||||||
+ (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; |
|
||||||
+ (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; |
|
||||||
+ (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo; |
|
||||||
|
|
||||||
#pragma mark - 如需使用本地推送通知功能,请实现以下方法 |
|
||||||
+ (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification; |
|
||||||
|
|
||||||
|
|
||||||
#pragma mark - deprecated (废弃API) |
|
||||||
/// 启动 App
|
|
||||||
/// @param appid appid
|
|
||||||
/// @param arguments 启动参数(可以在小程序中通过 plus.runtime.arguments 获取此参数)
|
|
||||||
+ (void)openApp:(NSString *)appid |
|
||||||
arguments:(NSDictionary * __nullable)arguments __attribute__((deprecated("deprecated, Use -openUniMP:configuration:completed:"))); |
|
||||||
|
|
||||||
/// 启动 App
|
|
||||||
/// @param appid appid
|
|
||||||
/// @param arguments 启动参数(可以在小程序中通过 plus.runtime.arguments 获取此参数)
|
|
||||||
/// @param redirectPath 启动后直接打开的页面路径 例:"pages/component/view/view?a=1&b=2"
|
|
||||||
+ (void)openApp:(NSString *)appid |
|
||||||
arguments:(NSDictionary * _Nullable)arguments |
|
||||||
redirectPath:(NSString * _Nullable)redirectPath __attribute__((deprecated("deprecated, Use -openUniMP:configuration:completed:"))); |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END |
|
@ -1,26 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <JavaScriptCore/JavaScriptCore.h> |
|
||||||
|
|
||||||
@interface JSContext (Weex) |
|
||||||
|
|
||||||
@property (nonatomic, strong) NSString *instanceId; |
|
||||||
|
|
||||||
@end |
|
@ -1,27 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
@interface NSObject (WXSwizzle) |
|
||||||
|
|
||||||
+ (BOOL)weex_swizzle:(Class)originalClass Method:(SEL)originalSelector withMethod:(SEL)swizzledSelector; |
|
||||||
|
|
||||||
@end |
|
@ -1,33 +0,0 @@ |
|||||||
//
|
|
||||||
// UniPluginProtocol.h
|
|
||||||
// libWeex
|
|
||||||
//
|
|
||||||
// Created by 4Ndf on 2018/11/30.
|
|
||||||
// Copyright © 2018年 DCloud. All rights reserved.
|
|
||||||
//
|
|
||||||
#import <UIKit/UIApplication.h> |
|
||||||
@protocol UniPluginProtocol <NSObject> |
|
||||||
//@required // 必须实现的方法
|
|
||||||
-(void)onCreateUniPlugin; |
|
||||||
|
|
||||||
- (BOOL)application:(UIApplication *_Nullable)application didFinishLaunchingWithOptions:(NSDictionary *_Nullable)launchOptions; |
|
||||||
- (void)application:(UIApplication *_Nullable)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *_Nullable)deviceToken; |
|
||||||
- (void)application:(UIApplication *_Nullable)application didFailToRegisterForRemoteNotificationsWithError:(NSError *_Nullable)err; |
|
||||||
- (void)application:(UIApplication *_Nullable)application didReceiveRemoteNotification:(NSDictionary *_Nullable)userInfo; |
|
||||||
- (void)application:(UIApplication *_Nullable)application didReceiveRemoteNotification:(NSDictionary *_Nullable)userInfo fetchCompletionHandler:(void (^_Nullable)(UIBackgroundFetchResult))completionHandler; |
|
||||||
- (void)application:(UIApplication *_Nullable)application didReceiveLocalNotification:(UILocalNotification *_Nullable)notification; |
|
||||||
- (BOOL)application:(UIApplication *_Nullable)application handleOpenURL:(NSURL *_Nullable)url; |
|
||||||
- (BOOL)application:(UIApplication *_Nullable)application openURL:(NSURL *_Nullable)url sourceApplication:(NSString *_Nullable)sourceApplication annotation:(id _Nonnull )annotation; |
|
||||||
- (BOOL)application:(UIApplication *_Nullable)app openURL:(NSURL *_Nonnull)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *_Nullable)options NS_AVAILABLE_IOS(9_0); |
|
||||||
|
|
||||||
- (void)applicationWillResignActive:(UIApplication * _Nullable)application; |
|
||||||
- (void)applicationDidBecomeActive:(UIApplication *_Nullable)application; |
|
||||||
- (void)applicationDidEnterBackground:(UIApplication *_Nullable)application; |
|
||||||
- (void)applicationWillEnterForeground:(UIApplication *_Nullable)application; |
|
||||||
- (void)applicationWillTerminate:(UIApplication *_Nullable)application; |
|
||||||
- (void)applicationDidReceiveMemoryWarning:(UIApplication *_Nullable)application; |
|
||||||
- (void)application:(UIApplication *_Nullable)application performActionForShortcutItem:(UIApplicationShortcutItem *_Nullable)shortcutItem completionHandler:(void (^_Nullable)(BOOL))completionHandler API_AVAILABLE(ios(9.0)); |
|
||||||
- (void)application:(UIApplication *_Nullable)application handleEventsForBackgroundURLSession:(NSString *_Nonnull)identifier completionHandler:(void (^_Nullable)(void))completionHandler; |
|
||||||
- (BOOL)application:(UIApplication *_Nullable)application continueUserActivity:(NSUserActivity *_Nullable)userActivity restorationHandler:(void(^_Nullable)(NSArray * __nullable restorableObjects))restorationHandler API_AVAILABLE(ios(8.0)); |
|
||||||
|
|
||||||
@end |
|
@ -1,24 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXComponent.h" |
|
||||||
|
|
||||||
@interface WXAComponent : WXComponent <UIGestureRecognizerDelegate> |
|
||||||
|
|
||||||
@end |
|
@ -1,37 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXAnalyzerProtocol.h" |
|
||||||
|
|
||||||
@interface WXAnalyzerCenter : NSObject |
|
||||||
|
|
||||||
+(NSMutableArray<WXAnalyzerProtocol> *) getAnalyzerList; |
|
||||||
|
|
||||||
+(void) addWxAnalyzer:(id<WXAnalyzerProtocol>)handler; |
|
||||||
|
|
||||||
+(void) rmWxAnalyzer:(id<WXAnalyzerProtocol>)handler; |
|
||||||
|
|
||||||
+(void) setOpen:(BOOL)isOpen; |
|
||||||
+(BOOL) isOpen; |
|
||||||
|
|
||||||
+(void) switchInteractionLog:(BOOL) isOpen; |
|
||||||
+(BOOL) isInteractionLogOpen; |
|
||||||
|
|
||||||
@end |
|
@ -1,44 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXAppMonitorProtocol.h" |
|
||||||
|
|
||||||
#define GROUP_ANALYZER @"WXAnalyzer" |
|
||||||
#define MODULE_PERFORMANCE @"WXPerformance" |
|
||||||
#define MODULE_ERROR @"WXError" |
|
||||||
#define TYPE_MEASURE_REAL @"measure_real_time" |
|
||||||
#define TYPE_DIMEN_REAL @"dimen_real_time" |
|
||||||
#define TYPE_JS_ERROR @"js" |
|
||||||
|
|
||||||
@protocol WXAnalyzerProtocol <NSObject> |
|
||||||
|
|
||||||
|
|
||||||
@required |
|
||||||
/**
|
|
||||||
@param value = @{ |
|
||||||
@"group":group, |
|
||||||
@"module":module, |
|
||||||
@"type":type, |
|
||||||
@"data":jsonData |
|
||||||
}; |
|
||||||
*/ |
|
||||||
- (void)transfer:(NSDictionary *) value; |
|
||||||
|
|
||||||
@end |
|
@ -1,147 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXJSExceptionInfo.h" |
|
||||||
|
|
||||||
#pragma mark - const static string |
|
||||||
|
|
||||||
extern NSString* const WEEX_PAGE_TOPIC; |
|
||||||
|
|
||||||
/************** properties *****************/ |
|
||||||
extern NSString* const KEY_PROPERTIES_ERROR_CODE; |
|
||||||
extern NSString* const KEY_PAGE_PROPERTIES_BIZ_ID; |
|
||||||
extern NSString* const KEY_PAGE_PROPERTIES_BUBDLE_URL; |
|
||||||
extern NSString* const KEY_PAGE_PROPERTIES_JSLIB_VERSION; |
|
||||||
extern NSString* const KEY_PAGE_PROPERTIES_WEEX_VERSION; |
|
||||||
extern NSString* const KEY_PAGE_PROPERTIES_REQUEST_TYPE; |
|
||||||
extern NSString* const KEY_PAGE_PROPERTIES_Z_CACHE_INFO; |
|
||||||
extern NSString* const KEY_PAGE_PROPERTIES_JS_FM_INIT; |
|
||||||
extern NSString* const KEY_PAGE_PROPERTIES_BUNDLE_TYPE; |
|
||||||
extern NSString* const KEY_PAGE_PROPERTIES_CONTAINER_NAME; |
|
||||||
extern NSString* const KEY_PAGE_PROPERTIES_INSTANCE_TYPE; |
|
||||||
extern NSString* const KEY_PAGE_PROPERTIES_PARENT_PAGE; |
|
||||||
extern NSString* const KEY_PAGE_PROPERTIES_RENDER_TYPE; |
|
||||||
|
|
||||||
|
|
||||||
///************** stages *****************/
|
|
||||||
extern NSString* const KEY_PAGE_STAGES_START; |
|
||||||
extern NSString* const KEY_PAGE_STAGES_DOWN_BUNDLE_START; |
|
||||||
extern NSString* const KEY_PAGE_STAGES_DOWN_BUNDLE_END; |
|
||||||
extern NSString* const KEY_PAGE_STAGES_RENDER_ORGIGIN; |
|
||||||
extern NSString* const KEY_PAGE_STAGES_LOAD_BUNDLE_START; |
|
||||||
extern NSString* const KEY_PAGE_STAGES_LOAD_BUNDLE_END; |
|
||||||
extern NSString* const KEY_PAGE_STAGES_CREATE_FINISH; |
|
||||||
extern NSString* const KEY_PAGE_STAGES_FSRENDER; |
|
||||||
extern NSString* const KEY_PAGE_STAGES_NEW_FSRENDER; |
|
||||||
extern NSString* const KEY_PAGE_STAGES_INTERACTION; |
|
||||||
extern NSString* const KEY_PAGE_STAGES_DESTROY; |
|
||||||
|
|
||||||
///************** stats *****************/
|
|
||||||
extern NSString* const KEY_PAGE_STATS_BUNDLE_SIZE; |
|
||||||
extern NSString* const KEY_PAGE_STATS_FS_CALL_JS_TIME; |
|
||||||
extern NSString* const KEY_PAGE_STATS_FS_CALL_JS_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_FS_TIMER_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_FS_CALL_NATIVE_TIME; |
|
||||||
extern NSString* const KEY_PAGE_STATS_FS_CALL_NATIVE_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_FS_CALL_EVENT_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_FS_REQUEST_NUM; |
|
||||||
|
|
||||||
extern NSString* const KEY_PAGE_STATS_SCROLLER_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_CELL_EXCEED_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_CELL_UN_RE_USE_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_CELL_DATA_UN_RECYCLE_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_EMBED_COUNT; |
|
||||||
extern NSString* const KEY_PAGE_STATS_LARGE_IMG_COUNT; |
|
||||||
|
|
||||||
extern NSString* const KEY_PAGE_STATS_MAX_DEEP_VIEW; |
|
||||||
extern NSString* const KEY_PAGE_STATS_MAX_DEEP_DOM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_MAX_COMPONENT_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_WRONG_IMG_SIZE_COUNT; |
|
||||||
extern NSString* const KEY_PAGE_STATS_IMG_UN_RECYCLE_NUM; |
|
||||||
|
|
||||||
extern NSString* const KEY_PAGE_STATS_I_SCREEN_VIEW_COUNT; |
|
||||||
extern NSString* const KEY_PAGE_STATS_I_ALL_VIEW_COUNT; |
|
||||||
|
|
||||||
extern NSString* const KEY_PAGE_STATS_I_COMPONENT_CREATE_COUNT; |
|
||||||
extern NSString* const KEY_PAGE_ANIM_BACK_NUM; |
|
||||||
extern NSString* const KEY_PAGE_TIMER_BACK_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_ACTUAL_DOWNLOAD_TIME; |
|
||||||
|
|
||||||
extern NSString* const KEY_PAGE_STATS_IMG_LOAD_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_IMG_LOAD_SUCCESS_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_IMG_LOAD_FAIL_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_NET_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_NET_SUCCESS_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STATS_NET_FAIL_NUM; |
|
||||||
extern NSString* const KEY_PAGE_STAGES_FIRST_INTERACTION_VIEW; |
|
||||||
extern NSString* const KEY_PAGE_STATS_BODY_RATIO; |
|
||||||
|
|
||||||
///************** value *****************/
|
|
||||||
extern NSString* const VALUE_ERROR_CODE_DEFAULT; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@interface WXApmForInstance : NSObject |
|
||||||
|
|
||||||
@property (nonatomic, assign) BOOL isFSEnd; |
|
||||||
@property (nonatomic,assign) BOOL isOpenApm; |
|
||||||
@property (nonatomic, assign) BOOL isStartRecord; |
|
||||||
@property (nonatomic, assign) BOOL hasAddView; |
|
||||||
@property (nonatomic, assign) BOOL isDegrade; |
|
||||||
@property (nonatomic, assign) BOOL isStartRender; |
|
||||||
@property (nonatomic,assign) BOOL hasRecordFirstInterationView; |
|
||||||
@property (nonatomic, assign) BOOL isDownLoadFailed; |
|
||||||
@property (nonatomic,assign) double pageRatio; |
|
||||||
|
|
||||||
#pragma mark - basic method |
|
||||||
|
|
||||||
- (void) onEvent:(NSString *)name withValue:(id)value; |
|
||||||
- (void) onStage:(NSString *)name; |
|
||||||
- (void) onStageWithTime:(NSString*)name time:(long)unixTime; |
|
||||||
- (void) setProperty:(NSString *)name withValue:(id)value; |
|
||||||
- (void) setStatistic:(NSString *)name withValue:(double)value; |
|
||||||
|
|
||||||
#pragma mark - instance record |
|
||||||
|
|
||||||
- (void) startRecord:(NSString*) instanceId; |
|
||||||
- (void) endRecord; |
|
||||||
- (void) updateFSDiffStats:(NSString *)name withDiffValue:(double)diff; |
|
||||||
- (void) updateDiffStats:(NSString *)name withDiffValue:(double)diff; |
|
||||||
- (void) updateMaxStats:(NSString *)name curMaxValue:(double)maxValue; |
|
||||||
- (void) updateExtInfoFromResponseHeader:(NSDictionary*) extInfo; |
|
||||||
- (void) forceSetInteractionTime:(long) unixTime; |
|
||||||
|
|
||||||
|
|
||||||
#pragma mark - called by IWXHttpAdapter implementer |
|
||||||
|
|
||||||
- (void) actionNetRequest; |
|
||||||
- (void) actionNetRequestResult:(bool)succeed withErrorCode:(NSString*)errorCode; |
|
||||||
|
|
||||||
#pragma mark - called by IWXImgLoaderAdapter implementer |
|
||||||
- (void) actionImgLoad; |
|
||||||
- (void) actionImgLoadResult:(bool)succeed withErrorCode:(NSString*)errorCode; |
|
||||||
|
|
||||||
#pragma mark record top5 errorMsg |
|
||||||
- (void) recordErrorMsg:(WXJSExceptionInfo *)exception; |
|
||||||
- (NSDictionary<NSString*,NSNumber*>*) stageDic; |
|
||||||
|
|
||||||
#pragma mark templateinfo |
|
||||||
- (NSString*) templateInfo; |
|
||||||
@end |
|
@ -1,102 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
|
|
||||||
@protocol WXApmProtocol <NSObject> |
|
||||||
|
|
||||||
/**
|
|
||||||
* start record |
|
||||||
* |
|
||||||
* @param instanceId instanceId |
|
||||||
*/ |
|
||||||
@required |
|
||||||
- (void) onStart:(NSString*)instanceId topic:(NSString*)topic; |
|
||||||
|
|
||||||
/**
|
|
||||||
* pause apm record (apm ext mem / fps) |
|
||||||
*/ |
|
||||||
@required |
|
||||||
- (void) pauseApmRecord; |
|
||||||
|
|
||||||
/**
|
|
||||||
* resume apm record (apm ext mem / fps) |
|
||||||
*/ |
|
||||||
@required |
|
||||||
- (void) resumeApmRecord; |
|
||||||
|
|
||||||
/**
|
|
||||||
* end record |
|
||||||
*/ |
|
||||||
@required |
|
||||||
- (void) onEnd; |
|
||||||
|
|
||||||
/**
|
|
||||||
* record event |
|
||||||
*/ |
|
||||||
@required |
|
||||||
- (void) onEvent:(NSString *)name withValue:(id)value;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* record stage |
|
||||||
*/ |
|
||||||
@required |
|
||||||
- (void) onStage:(NSString *)name withValue:(long)timestamp; |
|
||||||
|
|
||||||
/**
|
|
||||||
* record property |
|
||||||
*/ |
|
||||||
@required |
|
||||||
- (void) addProperty:(NSString *)name withValue:(id)value; |
|
||||||
|
|
||||||
/**
|
|
||||||
* record statistic |
|
||||||
*/ |
|
||||||
@required |
|
||||||
- (void) addStatistic:(NSString *)name withValue:(double)value; |
|
||||||
|
|
||||||
@required |
|
||||||
- (void) onSubProcedureBegin:(NSString*)subProcedureName; |
|
||||||
|
|
||||||
@required |
|
||||||
- (void) onSubProcedureEndSucceed:(NSString*)subProcedureName; |
|
||||||
|
|
||||||
@required |
|
||||||
- (void) onSubProcedureEndFailed:(NSString*)subProcedureName; |
|
||||||
|
|
||||||
/**
|
|
||||||
* record biz properties |
|
||||||
*/ |
|
||||||
@required |
|
||||||
- (void) addBiz:(NSString *)bizID withValue:(NSDictionary *)properties; |
|
||||||
|
|
||||||
/**
|
|
||||||
* record biz stage |
|
||||||
*/ |
|
||||||
@required |
|
||||||
- (void) addBizStage:(NSString *)bizID withValue:(NSDictionary *)stage; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@protocol WXApmGeneratorProtocol <NSObject> |
|
||||||
|
|
||||||
@required |
|
||||||
- (id<WXApmProtocol>)gengratorApmInstance:(NSString *) type; |
|
||||||
@end |
|
@ -1,66 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
@interface WXAppConfiguration : NSObject |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Group or organization of your app, default value is nil. |
|
||||||
*/ |
|
||||||
+ (NSString *)appGroup; |
|
||||||
+ (void)setAppGroup:(NSString *) appGroup; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Name of your app, default is value for CFBundleDisplayName in main bundle. |
|
||||||
*/ |
|
||||||
+ (NSString *)appName; |
|
||||||
+ (void)setAppName:(NSString *)appName; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Version of your app, default is value for CFBundleShortVersionString in main bundle. |
|
||||||
*/ |
|
||||||
+ (NSString *)appVersion; |
|
||||||
+ (void)setAppVersion:(NSString *)appVersion; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract External user agent of your app, all requests sent by weex will set the user agent on header, default value is nil. |
|
||||||
*/ |
|
||||||
+ (NSString *)externalUserAgent; |
|
||||||
+ (void)setExternalUserAgent:(NSString *)userAgent; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract JSFrameworkVersion |
|
||||||
*/ |
|
||||||
+ (NSString *)JSFrameworkVersion; |
|
||||||
+ (void)setJSFrameworkVersion:(NSString *)JSFrameworkVersion; |
|
||||||
|
|
||||||
/**
|
|
||||||
+ * @abstract JSFrameworkLibSize |
|
||||||
+ */ |
|
||||||
+ (NSUInteger)JSFrameworkLibSize; |
|
||||||
+ (void)setJSFrameworkLibSize:(NSUInteger)JSFrameworkLibSize; |
|
||||||
|
|
||||||
/*
|
|
||||||
* @abstract customizeProtocolClasses |
|
||||||
*/ |
|
||||||
+ (NSArray*)customizeProtocolClasses; |
|
||||||
+ (void)setCustomizeProtocolClasses:(NSArray*)customizeProtocolClasses; |
|
||||||
|
|
||||||
@end |
|
@ -1,83 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXModuleProtocol.h" |
|
||||||
|
|
||||||
/** dimenValue */ |
|
||||||
#define BIZTYPE @"bizType" |
|
||||||
#define PAGENAME @"pageName" |
|
||||||
#define WXSDKVERSION @"WXSDKVersion" |
|
||||||
#define JSLIBVERSION @"JSLibVersion" |
|
||||||
#define JSLIBSIZE @"JSLibSize" |
|
||||||
#define WXREQUESTTYPE @"requestType" |
|
||||||
#define WXCONNECTIONTYPE @"connectionType" |
|
||||||
#define NETWORKTYPE @"networkType" |
|
||||||
#define CACHETYPE @"cacheType" |
|
||||||
#define WXCUSTOMMONITORINFO @"customMonitorInfo" |
|
||||||
|
|
||||||
/** measureValue */ |
|
||||||
|
|
||||||
#define SDKINITTIME @"SDKInitTime" |
|
||||||
#define SDKINITINVOKETIME @"SDKInitInvokeTime" |
|
||||||
#define JSLIBINITTIME @"JSLibInitTime" |
|
||||||
#define JSTEMPLATESIZE @"JSTemplateSize" |
|
||||||
#define NETWORKTIME @"networkTime" |
|
||||||
#define COMMUNICATETIME @"communicateTime" |
|
||||||
#define SCREENRENDERTIME @"screenRenderTime" |
|
||||||
#define TOTALTIME @"totalTime" |
|
||||||
#define FIRSETSCREENJSFEXECUTETIME @"firstScreenJSFExecuteTime" |
|
||||||
|
|
||||||
#define CALLCREATEINSTANCETIME @"callCreateInstanceTime" |
|
||||||
#define COMMUNICATETOTALTIME @"communicateTotalTime" |
|
||||||
#define FSRENDERTIME @"fsRenderTime" |
|
||||||
#define COMPONENTCOUNT @"componentCount" |
|
||||||
#define M_COMPONENT_TIME @"componentCreateTime" |
|
||||||
|
|
||||||
#define CACHEPROCESSTIME @"cacheProcessTime" |
|
||||||
#define CACHERATIO @"cacheRatio" |
|
||||||
|
|
||||||
//todo new point
|
|
||||||
#define M_FS_CALL_JS_TIME @"fsCallJsTotalTime" |
|
||||||
#define M_FS_CALL_JS_NUM @"fsCallJsTotalNum" |
|
||||||
#define M_FS_CALL_NATIVE_TIME @"fsCallNativeTotalTime" |
|
||||||
#define M_FS_CALL_NATIVE_NUM @"fsCallNativeTotalNum" |
|
||||||
#define M_FS_CALL_EVENT_NUM @"fsCallEventTotalNum" |
|
||||||
#define M_FS_REQUEST_NET_NUM @"fsRequestNum" |
|
||||||
#define M_CELL_EXCEED_NUM @"cellExceedNum" |
|
||||||
#define M_MAX_DEEP_VDOM @"maxDeepVDomLayer" |
|
||||||
#define M_IMG_WRONG_SIZE_NUM @"imgSizeCount" |
|
||||||
#define M_TIMER_NUM @"timerCount" |
|
||||||
#define M_WRONG_IMG_NUM @"imgSizeCount" |
|
||||||
#define M_INTERACTION_TIME @"interactionTime" |
|
||||||
#define M_INTERACTION_ADD_COUNT @"interactionViewAddCount" |
|
||||||
#define M_INTERACTION_LIMIT_ADD_COUNT @"interactionViewAddLimitCount" |
|
||||||
#define M_NEW_FS_RENDER_TIME @"newFsRenderTime" |
|
||||||
|
|
||||||
|
|
||||||
@protocol WXAppMonitorProtocol <WXModuleProtocol> |
|
||||||
|
|
||||||
- (void)commitAppMonitorArgs:(NSDictionary *)args; |
|
||||||
|
|
||||||
- (void)commitAppMonitorAlarm:(NSString *)pageName monitorPoint:(NSString *)monitorPoint success:(BOOL)success errorCode:(NSString *)errorCode errorMsg:(NSString *)errorMsg arg:(NSString *)arg; |
|
||||||
|
|
||||||
@optional |
|
||||||
|
|
||||||
- (void)commitMonitorWithPage:(NSString *)pageName monitorPoint:(NSString *)monitorPoint args:(NSDictionary *)args; |
|
||||||
|
|
||||||
@end |
|
@ -1,46 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
|
|
||||||
/**
|
|
||||||
* The WXBaseViewController class provides the infrastructure for managing the weex view in your app. It is
|
|
||||||
* responsible for creating a weex instance or rendering the weex view, for observing the lifecycle of the |
|
||||||
* view such as "appear" or "disappear"、"foreground" or "background" etc. You can initialize this controller by |
|
||||||
* special bundle URL. |
|
||||||
*/ |
|
||||||
|
|
||||||
@interface WXBaseViewController : UIViewController<UIGestureRecognizerDelegate> |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract initializes the viewcontroller with bundle url. |
|
||||||
* |
|
||||||
* @param sourceURL The url of bundle rendered to a weex view. |
|
||||||
* |
|
||||||
* @return a object the class of WXBaseViewController. |
|
||||||
* |
|
||||||
*/ |
|
||||||
- (instancetype)initWithSourceURL:(NSURL *)sourceURL; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract refreshes the weex view in controller. |
|
||||||
*/ |
|
||||||
- (void)refreshWeex; |
|
||||||
|
|
||||||
@end |
|
@ -1,219 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import <JavaScriptCore/JavaScriptCore.h> |
|
||||||
|
|
||||||
@class WXBridgeMethod; |
|
||||||
@class WXSDKInstance; |
|
||||||
|
|
||||||
#ifdef __cplusplus |
|
||||||
extern "C" { |
|
||||||
#endif |
|
||||||
void WXPerformBlockOnBridgeThread(void (^block)(void)); |
|
||||||
#ifdef __cplusplus |
|
||||||
} |
|
||||||
#endif |
|
||||||
|
|
||||||
@interface WXBridgeManager : NSObject |
|
||||||
|
|
||||||
/**
|
|
||||||
* return instance at the top of the stack. |
|
||||||
**/ |
|
||||||
@property (nonatomic, weak, readonly) WXSDKInstance *topInstance; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Create Instance Method |
|
||||||
* @param instance : instance id |
|
||||||
* @param temp : template data |
|
||||||
* @param options : parameters |
|
||||||
* @param data : external data |
|
||||||
**/ |
|
||||||
- (void)createInstance:(NSString *)instance |
|
||||||
template:(NSString *)temp |
|
||||||
options:(NSDictionary *)options |
|
||||||
data:(id)data; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Create Instance with opcode |
|
||||||
* @param instance : instance id |
|
||||||
* @param contents : opcode data |
|
||||||
* @param options : parameters |
|
||||||
* @param data : external data |
|
||||||
**/ |
|
||||||
- (void)createInstance:(NSString *)instance |
|
||||||
contents:(NSData *)contents |
|
||||||
options:(NSDictionary *)options |
|
||||||
data:(id)data; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract return currentInstanceId |
|
||||||
**/ |
|
||||||
- (NSArray *)getInstanceIdStack; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Destroy Instance Method |
|
||||||
* @param instance : instance id |
|
||||||
**/ |
|
||||||
- (void)destroyInstance:(NSString *)instance; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Trigger full GC, for dev and debug only. |
|
||||||
**/ |
|
||||||
- (void)forceGarbageCollection; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Refresh Instance Method |
|
||||||
* @param instance : instance id |
|
||||||
* @param data : external data |
|
||||||
**/ |
|
||||||
- (void)refreshInstance:(NSString *)instance data:(id)data; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Unload |
|
||||||
**/ |
|
||||||
- (void)unload; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Update Instance State Method |
|
||||||
* @param instance : instance id |
|
||||||
* @param data : parameters |
|
||||||
**/ |
|
||||||
- (void)updateState:(NSString *)instance data:(id)data; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute JSFramework Script |
|
||||||
* @param script : script code |
|
||||||
**/ |
|
||||||
- (void)executeJsFramework:(NSString *)script; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register JS service Script |
|
||||||
* @param name : service name |
|
||||||
* @param serviceScript : script code |
|
||||||
* @param options : service options |
|
||||||
* @param completion : completion callback |
|
||||||
**/ |
|
||||||
- (void)registerService:(NSString *)name withService:(NSString *)serviceScript withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register JS service Script |
|
||||||
* @param name : service name |
|
||||||
* @param serviceScriptUrl : script url |
|
||||||
* @param options : service options |
|
||||||
* @param completion : completion callback |
|
||||||
**/ |
|
||||||
-(void)registerService:(NSString *)name withServiceUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Unregister JS service Script |
|
||||||
* @param name : script code |
|
||||||
**/ |
|
||||||
- (void)unregisterService:(NSString *)name; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register Modules Method |
|
||||||
* @param modules : module list |
|
||||||
**/ |
|
||||||
- (void)registerModules:(NSDictionary *)modules; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register Components Method |
|
||||||
* @param components component list |
|
||||||
**/ |
|
||||||
- (void)registerComponents:(NSArray* )components; |
|
||||||
|
|
||||||
/**
|
|
||||||
* FireEvent |
|
||||||
* @param instanceId instance id |
|
||||||
* @param ref : node reference |
|
||||||
* @param type : event type |
|
||||||
* @param params : parameters in event object |
|
||||||
* @param domChanges dom value changes, used for two-way data binding |
|
||||||
**/ |
|
||||||
- (void)fireEvent:(NSString *)instanceId ref:(NSString *)ref type:(NSString *)type params:(NSDictionary *)params domChanges:(NSDictionary *)domChanges; |
|
||||||
|
|
||||||
/**
|
|
||||||
* FireEvent |
|
||||||
* @param instanceId instance id |
|
||||||
* @param ref : node reference |
|
||||||
* @param type : event type |
|
||||||
* @param params : parameters in event object |
|
||||||
* @param domChanges dom value changes, used for two-way data binding |
|
||||||
* @param handlerArguments : arguments passed to event handler |
|
||||||
**/ |
|
||||||
- (void)fireEvent:(NSString *)instanceId ref:(NSString *)ref type:(NSString *)type params:(NSDictionary *)params domChanges:(NSDictionary *)domChanges handlerArguments:(NSArray *)handlerArguments; |
|
||||||
|
|
||||||
- (JSValue *)fireEventWithResult:(NSString *)instanceId ref:(NSString *)ref type:(NSString *)type params:(NSDictionary *)params domChanges:(NSDictionary *)domChanges; |
|
||||||
|
|
||||||
/**
|
|
||||||
* componentHook |
|
||||||
* @param instanceId : instance id |
|
||||||
* @param componentId : compoent id |
|
||||||
* @param type : component hook Type, such as life-cycle |
|
||||||
* @param hookPhase : hook phase |
|
||||||
*/ |
|
||||||
- (void)callComponentHook:(NSString*)instanceId componentId:(NSString*)componentId type:(NSString*)type hook:(NSString*)hookPhase args:(NSArray*)args competion:(void (^)(JSValue * value))complection; |
|
||||||
/**
|
|
||||||
* callBack |
|
||||||
* |
|
||||||
* @param instanceId instanceId |
|
||||||
* @param funcId funcId |
|
||||||
* @param params params |
|
||||||
* @param keepAlive indicate that whether this func will be reused |
|
||||||
*/ |
|
||||||
- (void)callBack:(NSString *)instanceId funcId:(NSString *)funcId params:(id)params keepAlive:(BOOL)keepAlive; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Connect To WebSocket for devtool debug |
|
||||||
* @param url : url to connect |
|
||||||
**/ |
|
||||||
- (void)connectToDevToolWithUrl:(NSURL *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* CallBack |
|
||||||
* @param instanceId instance id |
|
||||||
* @param funcId : callback id |
|
||||||
* @param params : parameters |
|
||||||
**/ |
|
||||||
- (void)callBack:(NSString *)instanceId funcId:(NSString *)funcId params:(id)params; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Connect To WebSocket for collecting log |
|
||||||
* @param url : url to connect |
|
||||||
**/ |
|
||||||
- (void)connectToWebSocket:(NSURL *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Log To WebSocket |
|
||||||
* @param flag : the tag to identify |
|
||||||
* @param message : message to output |
|
||||||
**/ |
|
||||||
- (void)logToWebSocket:(NSString *)flag message:(NSString *)message; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Reset Environment |
|
||||||
**/ |
|
||||||
- (void)resetEnvironment; |
|
||||||
|
|
||||||
- (void)fireEvent:(NSString *)instanceId ref:(NSString *)ref type:(NSString *)type params:(NSDictionary *)params DEPRECATED_MSG_ATTRIBUTE("Use fireEvent:ref:type:params:domChanges: method instead."); |
|
||||||
- (void)executeJsMethod:(WXBridgeMethod *)method DEPRECATED_MSG_ATTRIBUTE(); |
|
||||||
|
|
||||||
@end |
|
@ -1,172 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <JavaScriptCore/JavaScriptCore.h> |
|
||||||
|
|
||||||
typedef NSInteger(^WXJSCallNative)(NSString *instance, NSArray *tasks, NSString *callback); |
|
||||||
typedef NSInteger(^WXJSCallAddElement)(NSString *instanceId, NSString *parentRef, NSDictionary *elementData, NSInteger index); |
|
||||||
typedef NSInteger(^WXJSCallCreateBody)(NSString *instanceId, NSDictionary *bodyData); |
|
||||||
typedef NSInteger(^WXJSCallRemoveElement)(NSString *instanceId,NSString *ref); |
|
||||||
typedef NSInteger(^WXJSCallMoveElement)(NSString *instanceId,NSString *ref,NSString *parentRef,NSInteger index); |
|
||||||
typedef NSInteger(^WXJSCallUpdateAttrs)(NSString *instanceId,NSString *ref,NSDictionary *attrsData); |
|
||||||
typedef NSInteger(^WXJSCallUpdateStyle)(NSString *instanceId,NSString *ref,NSDictionary *stylesData); |
|
||||||
typedef NSInteger(^WXJSCallAddEvent)(NSString *instanceId,NSString *ref,NSString *event); |
|
||||||
typedef NSInteger(^WXJSCallRemoveEvent)(NSString *instanceId,NSString *ref,NSString *event); |
|
||||||
typedef NSInteger(^WXJSCallCreateFinish)(NSString *instanceId); |
|
||||||
typedef NSInteger(^WXJSCallRefreshFinish)(NSString *instanceId); |
|
||||||
typedef NSInteger(^WXJSCallUpdateFinish)(NSString *instanceId); |
|
||||||
typedef NSInvocation *(^WXJSCallNativeModule)(NSString *instanceId, NSString *moduleName, NSString *methodName, NSArray *args, NSDictionary *options); |
|
||||||
typedef void (^WXJSCallNativeComponent)(NSString *instanceId, NSString *componentRef, NSString *methodName, NSArray *args, NSDictionary *options); |
|
||||||
|
|
||||||
@protocol WXBridgeProtocol <NSObject> |
|
||||||
|
|
||||||
@property (nonatomic, readonly) JSValue* exception; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Executes the js framework code in javascript engine |
|
||||||
* You can do some setup in this method |
|
||||||
*/ |
|
||||||
- (void)executeJSFramework:(NSString *)frameworkScript; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Executes the js code in javascript engine |
|
||||||
* You can do some setup in this method |
|
||||||
*/ |
|
||||||
- (void)executeJavascript:(NSString *)script; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Executes global js method with specific arguments |
|
||||||
*/ |
|
||||||
- (JSValue *)callJSMethod:(NSString *)method args:(NSArray*)args; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Reset js engine environment, called when any environment variable is changed. |
|
||||||
*/ |
|
||||||
- (void)resetEnvironment; |
|
||||||
|
|
||||||
@optional |
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove instance's timer. |
|
||||||
*/ |
|
||||||
-(void)removeTimers:(NSString *)instance; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when garbage collection is wanted by sdk. |
|
||||||
*/ |
|
||||||
- (void)garbageCollect; |
|
||||||
|
|
||||||
@required |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback when call native tasks occur |
|
||||||
*/ |
|
||||||
- (void)registerCallNative:(WXJSCallNative)callNative; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback when addElement tasks occur |
|
||||||
*/ |
|
||||||
- (void)registerCallAddElement:(WXJSCallAddElement)callAddElement; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback when createBody tasks occur |
|
||||||
*/ |
|
||||||
- (void)registerCallCreateBody:(WXJSCallCreateBody)callCreateBody; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback when removeElement tasks occur |
|
||||||
*/ |
|
||||||
- (void)registerCallRemoveElement:(WXJSCallRemoveElement)callRemoveElement; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback when removeElement tasks occur |
|
||||||
*/ |
|
||||||
- (void)registerCallMoveElement:(WXJSCallMoveElement)callMoveElement; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback when updateAttrs tasks occur |
|
||||||
*/ |
|
||||||
- (void)registerCallUpdateAttrs:(WXJSCallUpdateAttrs)callUpdateAttrs; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback when updateStyle tasks occur |
|
||||||
*/ |
|
||||||
- (void)registerCallUpdateStyle:(WXJSCallUpdateStyle)callUpdateStyle; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback when addEvent tasks occur |
|
||||||
*/ |
|
||||||
- (void)registerCallAddEvent:(WXJSCallAddEvent)callAddEvent; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback when removeEvent tasks occur |
|
||||||
*/ |
|
||||||
- (void)registerCallRemoveEvent:(WXJSCallRemoveEvent)callRemoveEvent; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback when createFinish tasks occur |
|
||||||
*/ |
|
||||||
- (void)registerCallCreateFinish:(WXJSCallCreateFinish)callCreateFinish; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback for global js function `callNativeModule` |
|
||||||
*/ |
|
||||||
- (void)registerCallNativeModule:(WXJSCallNativeModule)callNativeModuleBlock; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback for global js function `callNativeComponent` |
|
||||||
*/ |
|
||||||
- (void)registerCallNativeComponent:(WXJSCallNativeComponent)callNativeComponentBlock; |
|
||||||
|
|
||||||
@optional |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback when refreshFinish tasks occur |
|
||||||
*/ |
|
||||||
- (void)registerCallRefreshFinish:(WXJSCallRefreshFinish)callRefreshFinish; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Register callback when updateFinish tasks occur |
|
||||||
*/ |
|
||||||
- (void)registerCallUpdateFinish:(WXJSCallUpdateFinish)callUpdateFinish; |
|
||||||
|
|
||||||
/*
|
|
||||||
* Executes the specified JavaScript code, treating the specified URL as its source location. |
|
||||||
* Evaluating a script runs any top-level code and adds function or object definitions to the brige’s global object. |
|
||||||
* The sourceURL parameter is informative only; debuggers may use this URL when reporting exceptions. |
|
||||||
@param script The JavaScript source code to evaluate. |
|
||||||
@param sourceURL A URL to be considered as the script’s origin. |
|
||||||
@return ReturnsThe last value generated by the script. Note that a script can result in the JavaScript value undefined. |
|
||||||
*/ |
|
||||||
- (JSValue *)executeJavascript:(NSString *)script withSourceURL:(NSURL*)sourceURL; |
|
||||||
|
|
||||||
|
|
||||||
@property (nonatomic, strong) NSString* weexInstanceId; |
|
||||||
|
|
||||||
/**
|
|
||||||
set JavaScriptContext |
|
||||||
*/ |
|
||||||
- (void)setJSContext:(JSContext*)context; |
|
||||||
|
|
||||||
/*
|
|
||||||
* javaScript runtime context |
|
||||||
*/ |
|
||||||
- (JSContext*)javaScriptContext; |
|
||||||
|
|
||||||
@end |
|
@ -1,162 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXComponent.h" |
|
||||||
#import "WXSDKInstance.h" |
|
||||||
#import "WXUtility.h" |
|
||||||
|
|
||||||
#define FlexUndefined NAN |
|
||||||
|
|
||||||
#ifdef __cplusplus |
|
||||||
#include "layout.h" |
|
||||||
|
|
||||||
typedef WeexCore::WXCoreFlexDirection WXCoreFlexDirection; |
|
||||||
typedef WeexCore::WXCoreFlexWrap WXCoreFlexWrap; |
|
||||||
typedef WeexCore::WXCoreJustifyContent WXCoreJustifyContent; |
|
||||||
typedef WeexCore::WXCoreAlignItems WXCoreAlignItems; |
|
||||||
typedef WeexCore::WXCoreAlignSelf WXCoreAlignSelf; |
|
||||||
typedef WeexCore::WXCorePositionType WXCorePositionType; |
|
||||||
typedef WeexCore::WXCoreDirection WXCoreDirection; |
|
||||||
|
|
||||||
extern "C" { |
|
||||||
#endif |
|
||||||
bool flexIsUndefined(float value); |
|
||||||
#ifdef __cplusplus |
|
||||||
} |
|
||||||
#endif |
|
||||||
|
|
||||||
#ifndef __cplusplus |
|
||||||
// Ensure that .m files can use css style enum definitions.
|
|
||||||
#include "flex_enum.h" |
|
||||||
|
|
||||||
typedef enum WXCoreFlexDirection WXCoreFlexDirection; |
|
||||||
typedef enum WXCoreFlexWrap WXCoreFlexWrap; |
|
||||||
typedef enum WXCoreJustifyContent WXCoreJustifyContent; |
|
||||||
typedef enum WXCoreAlignItems WXCoreAlignItems; |
|
||||||
typedef enum WXCoreAlignSelf WXCoreAlignSelf; |
|
||||||
typedef enum WXCorePositionType WXCorePositionType; |
|
||||||
typedef enum WXCoreDirection WXCoreDirection; |
|
||||||
|
|
||||||
#endif |
|
||||||
|
|
||||||
@interface WXComponent () |
|
||||||
{ |
|
||||||
@package |
|
||||||
#ifdef __cplusplus |
|
||||||
WeexCore::WXCoreLayoutNode *_flexCssNode; |
|
||||||
#endif // __cplusplus
|
|
||||||
|
|
||||||
CGRect _calculatedFrame; |
|
||||||
CGPoint _absolutePosition; |
|
||||||
WXPositionType _positionType; |
|
||||||
BOOL _isLastLayoutDirectionRTL; |
|
||||||
BOOL _isLayoutDirectionRTL; |
|
||||||
} |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Return the css node used to layout. |
|
||||||
* |
|
||||||
* @warning Subclasses must not override this. |
|
||||||
*/ |
|
||||||
#ifdef __cplusplus |
|
||||||
@property (nonatomic, readonly, assign) WeexCore::WXCoreLayoutNode *flexCssNode; |
|
||||||
#endif |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Get css style value for key. The key should be of CSS standard form. |
|
||||||
* This method is for convenience use in C/ObjC environment. And if you want to |
|
||||||
* retrieve all style values or in C++, you could use flexCssNode directly. |
|
||||||
* |
|
||||||
* Thread usage: |
|
||||||
* This method should be invoked in component thread by WXPerformBlockOnComponentThread. |
|
||||||
* Note that all initWithRef methods of WXComponent and its subclasses are performed in |
|
||||||
* component thread by default. Therefore you can call this method directly in initWithRef. |
|
||||||
* |
|
||||||
* Supported keys: |
|
||||||
* width, height, min-width, min-height, max-width, max-height, |
|
||||||
* margin-(left/right/top/bottom) |
|
||||||
* padding-(left/right/top/bottom) |
|
||||||
* border-(left/right/top/bottom)-width |
|
||||||
* left, right, top, bottom |
|
||||||
* flex-grow |
|
||||||
*/ |
|
||||||
- (float)getCssStyleValueForKey:(NSString *)key; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Get css style flex-direction. Thread usage the same as getCssStyleValueForKey. |
|
||||||
*/ |
|
||||||
- (WXCoreFlexDirection)getCssStyleFlexDirection; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Get css style flex-wrap. Thread usage the same as getCssStyleValueForKey. |
|
||||||
*/ |
|
||||||
- (WXCoreFlexWrap)getCssStyleFlexWrap; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Get css style justify-content. Thread usage the same as getCssStyleValueForKey. |
|
||||||
*/ |
|
||||||
- (WXCoreJustifyContent)getCssStyleJustifyContent; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Get css style align-items. Thread usage the same as getCssStyleValueForKey. |
|
||||||
*/ |
|
||||||
- (WXCoreAlignItems)getCssStyleAlignItems; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Get css style align-self. Thread usage the same as getCssStyleValueForKey. |
|
||||||
*/ |
|
||||||
- (WXCoreAlignSelf)getCssStyleAlignSelf; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Get css style position. Thread usage the same as getCssStyleValueForKey. |
|
||||||
*/ |
|
||||||
- (WXCorePositionType)getCssStylePositionType; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Get css layout direction. Thread usage the same as getCssStyleValueForKey. |
|
||||||
*/ |
|
||||||
- (WXCoreDirection)getCssDirection; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Convert layout dimension value like 'left', 'width' to style value in js considering viewport and scale. |
|
||||||
*/ |
|
||||||
- (NSString*)convertLayoutValueToStyleValue:(NSString*)valueName; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Get style width of a container(scroller like) with safe value. No NAN, No zero. |
|
||||||
*/ |
|
||||||
- (CGFloat)safeContainerStyleWidth; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Delete css node of a subcomponent. |
|
||||||
*/ |
|
||||||
- (void)removeSubcomponentCssNode:(WXComponent *)subcomponent; |
|
||||||
|
|
||||||
#pragma mark - RTL |
|
||||||
|
|
||||||
@property (nonatomic, assign, readonly) BOOL isDirectionRTL; |
|
||||||
|
|
||||||
// Now we scrollView RTL solution is tranform
|
|
||||||
// so scrollView need tranform subviews when RTL by default
|
|
||||||
// if your component view is not scrollView but also implement RTL layout by tranform,you need return YES
|
|
||||||
- (BOOL)shouldTransformSubviewsWhenRTL; |
|
||||||
|
|
||||||
- (void)layoutDirectionDidChanged:(BOOL)isRTL; |
|
||||||
|
|
||||||
@end |
|
@ -1,279 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <CoreGraphics/CoreGraphics.h> |
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXDisplayLinkManager.h" |
|
||||||
|
|
||||||
@class WXBridgeMethod; |
|
||||||
@class WXSDKInstance; |
|
||||||
@class WXComponent; |
|
||||||
|
|
||||||
#ifdef __cplusplus |
|
||||||
extern "C" { |
|
||||||
#endif |
|
||||||
|
|
||||||
void WXPerformBlockOnComponentThread(void (^block)(void)); |
|
||||||
void WXPerformBlockSyncOnComponentThread(void (^block)(void)); |
|
||||||
|
|
||||||
#ifdef __cplusplus |
|
||||||
} |
|
||||||
#endif |
|
||||||
|
|
||||||
@interface WXComponentManager : NSObject <WXDisplayLinkClient> |
|
||||||
|
|
||||||
@property (nonatomic, readonly, weak) WXSDKInstance *weexInstance; |
|
||||||
@property (nonatomic, readonly, assign) BOOL isValid; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract initialize with weex instance |
|
||||||
**/ |
|
||||||
- (instancetype)initWithWeexInstance:(WXSDKInstance *)weexInstance; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract return the component thread |
|
||||||
**/ |
|
||||||
+ (NSThread *)componentThread; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract starting component tasks |
|
||||||
**/ |
|
||||||
- (void)startComponentTasks; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract tell the component manager that instance root view's frame has been changed |
|
||||||
**/ |
|
||||||
- (void)rootViewFrameDidChange:(CGRect)frame; |
|
||||||
|
|
||||||
///--------------------------------------
|
|
||||||
/// @name Component Tree Building
|
|
||||||
///--------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract create root component |
|
||||||
**/ |
|
||||||
- (void)createBody:(NSString*)ref |
|
||||||
type:(NSString*)type |
|
||||||
styles:(NSDictionary*)styles |
|
||||||
attributes:(NSDictionary*)attributes |
|
||||||
events:(NSArray*)events |
|
||||||
renderObject:(void*)renderObject; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract add a component to its parent |
|
||||||
**/ |
|
||||||
- (void)addComponent:(NSString*)ref |
|
||||||
type:(NSString*)type |
|
||||||
parentRef:(NSString*)parentRef |
|
||||||
styles:(NSDictionary*)styles |
|
||||||
attributes:(NSDictionary*)attributes |
|
||||||
events:(NSArray*)events |
|
||||||
index:(NSInteger)index |
|
||||||
renderObject:(void*)renderObject; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract move component |
|
||||||
**/ |
|
||||||
- (void)moveComponent:(NSString *)ref toSuper:(NSString *)superRef atIndex:(NSInteger)index; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract remove component |
|
||||||
**/ |
|
||||||
- (void)removeComponent:(NSString *)ref; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract notify that a component tree is built and trigger layout, |
|
||||||
may be called several times rendering a page. |
|
||||||
**/ |
|
||||||
- (void)appendTreeCreateFinish:(NSString*)ref; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract return component for specific ref, must be called on component thread by calling WXPerformBlockOnComponentThread |
|
||||||
*/ |
|
||||||
- (WXComponent *)componentForRef:(NSString *)ref; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract return root component |
|
||||||
*/ |
|
||||||
- (WXComponent *)componentForRoot; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract number of components created, must be called on component thread by calling WXPerformBlockOnComponentThread |
|
||||||
*/ |
|
||||||
- (NSUInteger)numberOfComponents; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract add an existing component to references look-up map |
|
||||||
*/ |
|
||||||
- (void)addComponent:(WXComponent *)component toIndexDictForRef:(NSString *)ref; |
|
||||||
|
|
||||||
///--------------------------------------
|
|
||||||
/// @name Updating
|
|
||||||
///--------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract update styles |
|
||||||
**/ |
|
||||||
- (void)updateStyles:(NSDictionary *)styles forComponent:(NSString *)ref; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract update pseudo class styles |
|
||||||
**/ |
|
||||||
- (void)updatePseudoClassStyles:(NSDictionary *)styles forComponent:(NSString *)ref; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract update attributes |
|
||||||
**/ |
|
||||||
- (void)updateAttributes:(NSDictionary *)attributes forComponent:(NSString *)ref; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract quick check that if a component has non transition properties |
|
||||||
**/ |
|
||||||
- (BOOL)isTransitionNoneOfComponent:(NSString*)ref; // for quick access
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract check if component with @ref has any style in @styles which is animated |
|
||||||
**/ |
|
||||||
- (BOOL)hasTransitionPropertyInStyles:(NSDictionary*)styles forComponent:(NSString*)ref; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract layout a component with frame output by weex core layout engine |
|
||||||
**/ |
|
||||||
- (void)layoutComponent:(WXComponent*)component frame:(CGRect)frame isRTL:(BOOL)isRTL innerMainSize:(CGFloat)innerMainSize; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract layout a component on platform side |
|
||||||
**/ |
|
||||||
- (void)layoutComponent:(WXComponent*)component; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract add event |
|
||||||
**/ |
|
||||||
- (void)addEvent:(NSString *)event toComponent:(NSString *)ref; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract remove event |
|
||||||
**/ |
|
||||||
- (void)removeEvent:(NSString *)event fromComponent:(NSString *)ref; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract scroll to specific component |
|
||||||
**/ |
|
||||||
- (void)scrollToComponent:(NSString *)ref options:(NSDictionary *)options; |
|
||||||
|
|
||||||
///--------------------------------------
|
|
||||||
/// @name Life Cycle
|
|
||||||
///--------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract called when all doms are created |
|
||||||
**/ |
|
||||||
- (void)createFinish; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract called when all doms are refreshed |
|
||||||
**/ |
|
||||||
- (void)refreshFinish; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract called when all doms are updated |
|
||||||
**/ |
|
||||||
- (void)updateFinish; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract called when all doms are created and layout finished |
|
||||||
**/ |
|
||||||
- (void)renderFinish; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract called when render failed |
|
||||||
**/ |
|
||||||
- (void)renderFailed:(NSError *)error; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract unload |
|
||||||
**/ |
|
||||||
- (void)unload; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract invalidate component management, this can be called on main thread. |
|
||||||
**/ |
|
||||||
- (void)invalidate; |
|
||||||
|
|
||||||
///--------------------------------------
|
|
||||||
/// @name Fixed
|
|
||||||
///--------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract add a component which has a fixed position |
|
||||||
* |
|
||||||
* @param fixComponent the fixed component to add |
|
||||||
*/ |
|
||||||
- (void)addFixedComponent:(WXComponent *)fixComponent; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract remove a component which has a fixed position |
|
||||||
* |
|
||||||
* @param fixComponent the fixed component to remove |
|
||||||
*/ |
|
||||||
- (void)removeFixedComponent:(WXComponent *)fixComponent; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract add a task to UI thread |
|
||||||
**/ |
|
||||||
- (void)_addUITask:(void (^)(void))block; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract execute a task to UI thread |
|
||||||
**/ |
|
||||||
- (void)executePrerenderUITask:(NSString *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @param styles a NSDictionary value, styles which will resolve |
|
||||||
* @param component a WXComponent value, the target which you want to resolve |
|
||||||
* @param isUpdateStyles a BOOL value, YES will udpate the component style property, NO will notifiy the lifeStyle of compoenent to handle, default value is NO. |
|
||||||
* @abstract handleStyle will be add to a queue to be executed every frame, but handleStyleOnMainThread will switch to main thread and execute imediately, you can call this for your execution time sequence. |
|
||||||
*/ |
|
||||||
- (void)handleStyleOnMainThread:(NSDictionary*)styles forComponent:(WXComponent *)component isUpdateStyles:(BOOL)isUpdateStyles; |
|
||||||
|
|
||||||
///--------------------------------------
|
|
||||||
/// @name Enumerating
|
|
||||||
///--------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enumerate components using breadth-first search algorithm, |
|
||||||
must be called on component thread by calling WXPerformBlockOnComponentThread |
|
||||||
*/ |
|
||||||
- (void)enumerateComponentsUsingBlock:(void (^)(WXComponent *, BOOL *stop))block; |
|
||||||
|
|
||||||
#pragma mark batch mark |
|
||||||
|
|
||||||
/**
|
|
||||||
a start native batch tag for a group of UI operations, company with performBatchEnd |
|
||||||
@see performBatchEnd |
|
||||||
*/ |
|
||||||
- (void)performBatchBegin; |
|
||||||
|
|
||||||
/**
|
|
||||||
an end native batch tag for a group of UI operations, company with performBatchBegin |
|
||||||
@see performBatchBegin |
|
||||||
*/ |
|
||||||
- (void)performBatchEnd; |
|
||||||
|
|
||||||
@end |
|
@ -1,39 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
@protocol WXConfigCenterProtocol <NSObject> |
|
||||||
|
|
||||||
/**
|
|
||||||
get config from config center handler |
|
||||||
@param key the key for config |
|
||||||
@param defaultValue default value for key if the key does not exist. |
|
||||||
@param isDefault whether the value is default value |
|
||||||
@return the value for config key |
|
||||||
*/ |
|
||||||
- (id)configForKey:(NSString*)key defaultValue:(id)defaultValue isDefault:(BOOL*)isDefault; |
|
||||||
|
|
||||||
@optional |
|
||||||
/**
|
|
||||||
get group config from config center handler |
|
||||||
@param group the groupName for config |
|
||||||
*/ |
|
||||||
|
|
||||||
- (id)configForGroup:(NSString*)group; |
|
||||||
|
|
||||||
@end |
|
@ -1,104 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
#import <objc/runtime.h> |
|
||||||
#import "WXType.h" |
|
||||||
|
|
||||||
@class WXLength; |
|
||||||
@class WXBoxShadow; |
|
||||||
@interface WXConvert : NSObject |
|
||||||
|
|
||||||
+ (BOOL)BOOL:(id)value; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract convert value to CGFloat value |
|
||||||
* @param value value |
|
||||||
* @return CGFloat value |
|
||||||
*/ |
|
||||||
+ (CGFloat)CGFloat:(id)value; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract convert value to CGFloat value, notice that it will return nan if input value is unsupported |
|
||||||
* @param value value |
|
||||||
* @return CGFloat value or nan(unsupported input) |
|
||||||
*/ |
|
||||||
+ (CGFloat)flexCGFloat:(id)value; |
|
||||||
|
|
||||||
+ (NSUInteger)NSUInteger:(id)value; |
|
||||||
+ (NSInteger)NSInteger:(id)value; |
|
||||||
+ (NSString *)NSString:(id)value; |
|
||||||
|
|
||||||
/**
|
|
||||||
* 750px Adaptive |
|
||||||
*/ |
|
||||||
typedef CGFloat WXPixelType; |
|
||||||
// @parameter scaleFactor: please use weexInstance's pixelScaleFactor property
|
|
||||||
+ (WXPixelType)WXPixelType:(id)value scaleFactor:(CGFloat)scaleFactor; |
|
||||||
// WXPixelType that use flexCGFloat to convert
|
|
||||||
+ (WXPixelType)WXFlexPixelType:(id)value scaleFactor:(CGFloat)scaleFactor; |
|
||||||
|
|
||||||
|
|
||||||
+ (UIViewContentMode)UIViewContentMode:(id)value; |
|
||||||
+ (WXImageQuality)WXImageQuality:(id)value; |
|
||||||
+ (WXImageSharp)WXImageSharp:(id)value; |
|
||||||
+ (UIAccessibilityTraits)WXUIAccessibilityTraits:(id)value; |
|
||||||
|
|
||||||
+ (UIColor *)UIColor:(id)value; |
|
||||||
+ (CGColorRef)CGColor:(id)value; |
|
||||||
+ (NSString *)HexWithColor:(UIColor *)color; |
|
||||||
+ (WXBorderStyle)WXBorderStyle:(id)value; |
|
||||||
typedef BOOL WXClipType; |
|
||||||
+ (WXClipType)WXClipType:(id)value; |
|
||||||
+ (WXPositionType)WXPositionType:(id)value; |
|
||||||
|
|
||||||
+ (WXTextStyle)WXTextStyle:(id)value; |
|
||||||
/**
|
|
||||||
* @abstract UIFontWeightRegular ,UIFontWeightBold,etc are not support by the system which is less than 8.2. weex sdk set the float value. |
|
||||||
* |
|
||||||
* @param value support normal,blod,100,200,300,400,500,600,700,800,900 |
|
||||||
* |
|
||||||
* @return A float value. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (CGFloat)WXTextWeight:(id)value; |
|
||||||
+ (WXTextDecoration)WXTextDecoration:(id)value; |
|
||||||
+ (NSTextAlignment)NSTextAlignment:(id)value; |
|
||||||
+ (UIReturnKeyType)UIReturnKeyType:(id)value; |
|
||||||
|
|
||||||
+ (WXScrollDirection)WXScrollDirection:(id)value; |
|
||||||
+ (UITableViewRowAnimation)UITableViewRowAnimation:(id)value; |
|
||||||
|
|
||||||
+ (UIViewAnimationOptions)UIViewAnimationTimingFunction:(id)value; |
|
||||||
+ (CAMediaTimingFunction *)CAMediaTimingFunction:(id)value; |
|
||||||
|
|
||||||
+ (WXVisibility)WXVisibility:(id)value; |
|
||||||
|
|
||||||
+ (WXGradientType)gradientType:(id)value; |
|
||||||
|
|
||||||
+ (WXLength *)WXLength:(id)value isFloat:(BOOL)isFloat scaleFactor:(CGFloat)scaleFactor; |
|
||||||
+ (WXBoxShadow *)WXBoxShadow:(id)value scaleFactor:(CGFloat)scaleFactor; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@interface WXConvert (Deprecated) |
|
||||||
|
|
||||||
+ (WXPixelType)WXPixelType:(id)value DEPRECATED_MSG_ATTRIBUTE("Use [WXConvert WXPixelType:scaleFactor:] instead"); |
|
||||||
|
|
||||||
@end |
|
@ -1,55 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXModuleProtocol.h" |
|
||||||
|
|
||||||
@interface WXDebugTool : NSObject<WXModuleProtocol> |
|
||||||
|
|
||||||
+ (instancetype)sharedInstance; |
|
||||||
|
|
||||||
//+ (void)showFPS;
|
|
||||||
|
|
||||||
+ (void)setDebug:(BOOL)isDebug; |
|
||||||
|
|
||||||
+ (BOOL)isDebug; |
|
||||||
|
|
||||||
+ (void)setDevToolDebug:(BOOL)isDevToolDebug; |
|
||||||
|
|
||||||
+ (BOOL)isDevToolDebug; |
|
||||||
|
|
||||||
+ (void)setReplacedBundleJS:(NSURL*)url; |
|
||||||
|
|
||||||
+ (NSString*)getReplacedBundleJS; |
|
||||||
|
|
||||||
+ (void)setReplacedJSFramework:(NSURL*)url; |
|
||||||
|
|
||||||
+ (NSString*)getReplacedJSFramework; |
|
||||||
|
|
||||||
+ (BOOL) cacheJsService: (NSString *)name withScript: (NSString *)script withOptions: (NSDictionary *) options; |
|
||||||
|
|
||||||
+ (BOOL) removeCacheJsService: (NSString *)name; |
|
||||||
|
|
||||||
+ (NSDictionary *) jsServiceCache; |
|
||||||
|
|
||||||
+ (BOOL)isRemoteTracing; |
|
||||||
|
|
||||||
+ (void)setRemoteTracing:(BOOL)isRemoteTracing; |
|
||||||
|
|
||||||
@end |
|
@ -1,193 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#ifndef __WX_DEFINE_H__ |
|
||||||
#define __WX_DEFINE_H__ |
|
||||||
|
|
||||||
#define WX_SDK_VERSION @"0.20.0" |
|
||||||
|
|
||||||
#if defined(__cplusplus) |
|
||||||
#define WX_EXTERN extern "C" __attribute__((visibility("default"))) |
|
||||||
#else |
|
||||||
#define WX_EXTERN extern __attribute__((visibility("default"))) |
|
||||||
#endif |
|
||||||
|
|
||||||
/*
|
|
||||||
* Concatenate preprocessor tokens a and b without expanding macro definitions |
|
||||||
* (however, if invoked from a macro, macro arguments are expanded). |
|
||||||
*/ |
|
||||||
#define WX_CONCAT(a, b) a ## b |
|
||||||
/*
|
|
||||||
* Concatenate preprocessor tokens a and b after macro-expanding them. |
|
||||||
*/ |
|
||||||
#define WX_CONCAT_WRAPPER(a, b) WX_CONCAT(a, b) |
|
||||||
|
|
||||||
#define WX_CONCAT_TRIPLE(a, b, c) a ## b ## c |
|
||||||
|
|
||||||
#define WX_NSSTRING_HELPER(x) #x |
|
||||||
#define WX_NSSTRING(x) @WX_NSSTRING_HELPER(x) |
|
||||||
|
|
||||||
#define WX_SDK_ROOT_REF @"_root" |
|
||||||
|
|
||||||
#define WX_TEXT_FONT_SIZE (32.0 * self.weexInstance.pixelScaleFactor) |
|
||||||
|
|
||||||
#define WX_UPDATE_CONFIG(prefix, name, configs) \ |
|
||||||
NSString *selStr = [NSString stringWithFormat:@"%@_%@", prefix, name];\
|
|
||||||
SEL selector = NSSelectorFromString(selStr);\
|
|
||||||
Class clazz = WX_COMPONENT_CLASS(_properties[@"type"]);\
|
|
||||||
if ([clazz respondsToSelector:selector]) {\
|
|
||||||
configs = ((NSArray *(*)(id, SEL))objc_msgSend)(clazz, selector);\
|
|
||||||
}\
|
|
||||||
|
|
||||||
#define WX_TYPE_KEYPATH(config, name, type, parts, vKey) \ |
|
||||||
type = [config[0] stringByAppendingString:@":"];\
|
|
||||||
NSString *keyPath = config.count > 1 ? config[1] : nil;\
|
|
||||||
if(keyPath){\
|
|
||||||
parts = [keyPath componentsSeparatedByString:@"."];\
|
|
||||||
vKey = parts.lastObject;\
|
|
||||||
parts = [parts subarrayWithRange:(NSRange){0, parts.count - 1}];\
|
|
||||||
} else {\
|
|
||||||
vKey = name;\
|
|
||||||
} |
|
||||||
|
|
||||||
#define RGB(r, g, b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0] |
|
||||||
#define RGB_A(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a] |
|
||||||
|
|
||||||
#define ScreenWidth ([[UIScreen mainScreen] bounds].size.width) |
|
||||||
|
|
||||||
#define WX_ERROR_DOMAIN @"WXErrorDomain" |
|
||||||
|
|
||||||
#define WX_APPLICATION_WILL_RESIGN_ACTIVE @"WXApplicationWillResignActiveEvent" |
|
||||||
|
|
||||||
#define WX_APPLICATION_DID_BECOME_ACTIVE @"WXApplicationDidBecomeActiveEvent" |
|
||||||
|
|
||||||
#define WX_INSTANCE_NOTIFICATION_UPDATE_STATE @"WXInstUpdateState" |
|
||||||
|
|
||||||
#define WX_COMPONENT_NOTIFICATION_VIEW_LOADED @"WXComponentViewLoaded" |
|
||||||
|
|
||||||
#define WX_INSTANCE_WILL_DESTROY_NOTIFICATION @"WXSDKInstanceWillDestroyNotification" |
|
||||||
|
|
||||||
#define WX_SDKINSTANCE_WILL_RENDER @"WXSDKInstanceWillRender" |
|
||||||
|
|
||||||
#define WX_COMPONENT_THREAD_NAME @"com.taobao.weex.component" |
|
||||||
|
|
||||||
#define WX_BRIDGE_THREAD_NAME @"com.taobao.weex.bridge" |
|
||||||
|
|
||||||
#define WX_FONT_DOWNLOAD_DIR [[WXUtility cacheDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"wxdownload"]] |
|
||||||
|
|
||||||
#define WX_EXPORT_METHOD_INTERNAL(method, token) \ |
|
||||||
+ (NSString *)WX_CONCAT_WRAPPER(token, __LINE__) { \
|
|
||||||
return NSStringFromSelector(method); \
|
|
||||||
} |
|
||||||
|
|
||||||
#define WX_MODULE_EVENT_FIRE_NOTIFICATION @"WX_MODULE_EVENT_FIRE_NOTIFICATION" |
|
||||||
#define WX_ICONFONT_DOWNLOAD_NOTIFICATION @"WX_ICONFONT_DOWNLOAD_FINISH_NOTIFICATION" |
|
||||||
|
|
||||||
#define WX_INSTANCE_JSCONTEXT_CREATE_NOTIFICATION @"WX_INSTANCE_JSCONTEXT_CREATE_NOTIFICATION" |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract export public method |
|
||||||
*/ |
|
||||||
#define WX_EXPORT_METHOD(method) WX_EXPORT_METHOD_INTERNAL(method,wx_export_method_) |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract export public method, support sync return value |
|
||||||
* @warning the method can only be called on js thread |
|
||||||
*/ |
|
||||||
#define WX_EXPORT_METHOD_SYNC(method) WX_EXPORT_METHOD_INTERNAL(method,wx_export_method_sync_) |
|
||||||
|
|
||||||
/** extern "C" makes a function-name in C++ have 'C' linkage (compiler does not mangle the name)
|
|
||||||
* so that client C code can link to (i.e use) your function using a 'C' compatible header file that contains just the declaration of your function. |
|
||||||
* http://stackoverflow.com/questions/1041866/in-c-source-what-is-the-effect-of-extern-c
|
|
||||||
*/ |
|
||||||
#ifdef __cplusplus |
|
||||||
# define WX_EXTERN_C_BEGIN extern "C" { |
|
||||||
# define WX_EXTERN_C_END } |
|
||||||
#else |
|
||||||
# define WX_EXTERN_C_BEGIN |
|
||||||
# define WX_EXTERN_C_END |
|
||||||
#endif |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Compared with system version of current device |
|
||||||
* |
|
||||||
* @return YES if greater than or equal to the system verison, otherwise, NO. |
|
||||||
* |
|
||||||
*/ |
|
||||||
#define WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Compared with system version of current device |
|
||||||
* |
|
||||||
* @return YES if greater than the system verison, otherwise, NO. |
|
||||||
* |
|
||||||
*/ |
|
||||||
#define WX_SYS_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Compared with system version of current device |
|
||||||
* |
|
||||||
* @return YES if equal to the system verison, otherwise, NO. |
|
||||||
* |
|
||||||
*/ |
|
||||||
#define WX_SYS_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Compared with system version of current device |
|
||||||
* |
|
||||||
* @return YES if less than the system verison, otherwise, NO. |
|
||||||
* |
|
||||||
*/ |
|
||||||
#define WX_SYS_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Compared with system version of current device |
|
||||||
* |
|
||||||
* @return YES if less than or equal to the system verison, otherwise, NO. |
|
||||||
* |
|
||||||
*/ |
|
||||||
#define WX_SYS_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Estimate component's type. If the type isn't equal to WXComponentTypeCommon, then return. |
|
||||||
*/ |
|
||||||
#define WX_CHECK_COMPONENT_TYPE(type)\ |
|
||||||
do {\
|
|
||||||
if (type != WXComponentTypeCommon) {\
|
|
||||||
return;\
|
|
||||||
}\
|
|
||||||
} while (0); |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if __has_attribute(objc_requires_super) |
|
||||||
#define WX_REQUIRES_SUPER __attribute__((objc_requires_super)) |
|
||||||
#else |
|
||||||
#define WX_REQUIRES_SUPER |
|
||||||
#endif |
|
||||||
|
|
||||||
#endif |
|
||||||
|
|
||||||
WX_EXTERN_C_BEGIN |
|
||||||
|
|
||||||
NSString* GetWeexSDKVersion(void); |
|
||||||
NSString* GetWeexSDKBuildTime(void); |
|
||||||
unsigned long GetWeexSDKBuildTimestamp(void); |
|
||||||
|
|
||||||
WX_EXTERN_C_END |
|
@ -1,48 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
@protocol WXDisplayLinkClient <NSObject> |
|
||||||
/**
|
|
||||||
* @abstract defalut is NO |
|
||||||
**/ |
|
||||||
@property (nonatomic) BOOL suspend; |
|
||||||
|
|
||||||
- (void)handleDisplayLink; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@interface WXDisplayLinkManager : NSObject |
|
||||||
/**
|
|
||||||
* @abstract create WXDisplayLinkManager instance |
|
||||||
**/ |
|
||||||
+ (instancetype)sharedInstance; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract add WXDisplayLinkClient to array |
|
||||||
**/ |
|
||||||
- (void)registerDisplayClient:(id<WXDisplayLinkClient>)client; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract remove WXDisplayLinkClient to array |
|
||||||
**/ |
|
||||||
- (void)unregisterDisplayClient:(id<WXDisplayLinkClient>)client; |
|
||||||
|
|
||||||
@end |
|
@ -1,32 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
|
|
||||||
@protocol WXErrorViewDelegate <NSObject> |
|
||||||
|
|
||||||
- (void)onclickErrorView; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@interface WXErrorView : UIView |
|
||||||
|
|
||||||
@property (nonatomic, weak) id<WXErrorViewDelegate> delegate; |
|
||||||
|
|
||||||
@end |
|
@ -1,26 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXModuleProtocol.h" |
|
||||||
|
|
||||||
@protocol WXEventModuleProtocol<WXModuleProtocol> |
|
||||||
|
|
||||||
- (void)openURL:(NSString *)url; |
|
||||||
|
|
||||||
@end |
|
@ -1,29 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXJSExceptionInfo.h" |
|
||||||
|
|
||||||
@interface WXExceptionUtils : NSObject |
|
||||||
|
|
||||||
+ (void)commitCriticalExceptionRT:(NSString *)instanceId errCode:(NSString *)errCode function:(NSString *)function exception:(NSString *)exception extParams:(NSDictionary *)extParams; |
|
||||||
|
|
||||||
+ (void)commitCriticalExceptionRT:(WXJSExceptionInfo*)jsExceptionInfo; |
|
||||||
@end |
|
||||||
|
|
@ -1,47 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
@protocol WXExtendCallNativeProtocol <NSObject> |
|
||||||
|
|
||||||
@required |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract check parameters |
|
||||||
* |
|
||||||
* @param parameters the checked parameters. |
|
||||||
* |
|
||||||
* @return YES or NO. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (BOOL)checkParameters:(NSDictionary *)parameters; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract excuteCallNative |
|
||||||
* |
|
||||||
* @param parameters the checked parameters. |
|
||||||
* |
|
||||||
* @return A value. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (id)excuteCallNative:(NSDictionary *)parameters; |
|
||||||
|
|
||||||
@end |
|
@ -1,94 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXModuleProtocol.h" |
|
||||||
#import "WXType.h" |
|
||||||
|
|
||||||
@protocol WXImageOperationProtocol <NSObject> |
|
||||||
|
|
||||||
- (void)cancel; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, WXImageLoaderCacheType) { |
|
||||||
/**
|
|
||||||
* The image wasn't available the imageLoad caches, but was downloaded from the web. |
|
||||||
*/ |
|
||||||
WXImageLoaderCacheTypeNone, |
|
||||||
/**
|
|
||||||
* The image was obtained from the disk cache. |
|
||||||
*/ |
|
||||||
WXImageLoaderCacheTypeDisk, |
|
||||||
/**
|
|
||||||
* The image was obtained from the memory cache. |
|
||||||
*/ |
|
||||||
WXImageLoaderCacheTypeMemory |
|
||||||
}; |
|
||||||
|
|
||||||
@protocol WXImgLoaderProtocol <WXModuleProtocol> |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Creates a image download handler with a given URL |
|
||||||
* |
|
||||||
* @param url The URL of the image to download |
|
||||||
* |
|
||||||
* @param imageFrame The frame of the image you want to set |
|
||||||
* |
|
||||||
* @param options : The options to be used for this download |
|
||||||
* |
|
||||||
* @param completedBlock : A block called once the download is completed. |
|
||||||
* image : the image which has been download to local. |
|
||||||
* error : the error which has happened in download. |
|
||||||
* finished : a Boolean value indicating whether download action has finished. |
|
||||||
*/ |
|
||||||
- (id<WXImageOperationProtocol>)downloadImageWithURL:(NSString *)url imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)options completed:(void(^)(UIImage *image, NSError *error, BOOL finished))completedBlock; |
|
||||||
|
|
||||||
@optional |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Creates a image download handler with a given URL |
|
||||||
* |
|
||||||
* @param imageView UIImageView to display the image |
|
||||||
* |
|
||||||
* @param url The URL of the image to download |
|
||||||
* |
|
||||||
* @param placeholder The image to be set initially, until the image request finishes. |
|
||||||
* |
|
||||||
* @param options : The options to be used for download operation |
|
||||||
* |
|
||||||
* @param progressBlock : A block called while the download start |
|
||||||
* |
|
||||||
* @param completedBlock : A block called once the download is completed. |
|
||||||
* image : the image which has been download to local. |
|
||||||
* error : the error which has happened in download. |
|
||||||
* finished : a Boolean value indicating whether download action has finished. |
|
||||||
*/ |
|
||||||
- (void)setImageViewWithURL:(UIImageView*)imageView |
|
||||||
url:(NSURL *)url |
|
||||||
placeholderImage:(UIImage *)placeholder |
|
||||||
options:(NSDictionary*)options |
|
||||||
progress:(void(^)(NSInteger receivedSize, NSInteger expectedSize))progressBlock |
|
||||||
completed:(void(^)(UIImage *image, NSError *error, WXImageLoaderCacheType cacheType, NSURL *imageURL))completedBlock; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Cancel the current download image |
|
||||||
*/ |
|
||||||
- (void)cancelCurrentImageLoad:(UIImageView*)imageView; |
|
||||||
|
|
||||||
@end |
|
@ -1,52 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXComponent.h" |
|
||||||
|
|
||||||
typedef enum |
|
||||||
{ |
|
||||||
WXPointIndicatorAlignCenter, // point indicator align center
|
|
||||||
WXPointIndicatorAlignLeft, // point indicator align left
|
|
||||||
WXPointIndicatorAlignRight, // point indicator align right
|
|
||||||
} WXPointIndicatorAlignStyle; |
|
||||||
|
|
||||||
@interface WXIndicatorView : UIView |
|
||||||
|
|
||||||
@property (nonatomic, assign) NSInteger pointCount; // total count point of point indicator
|
|
||||||
@property (nonatomic, assign) NSInteger currentPoint; // current light index of point at point indicator
|
|
||||||
@property (nonatomic, strong) UIColor *pointColor; // normal point color of point indicator
|
|
||||||
@property (nonatomic, strong) UIColor *lightColor; // highlight point color of point indicator
|
|
||||||
@property (nonatomic, assign) WXPointIndicatorAlignStyle alignStyle; //align style of point indicator
|
|
||||||
@property (nonatomic, assign) CGFloat pointSize; // point size of point indicator
|
|
||||||
@property (nonatomic, assign) CGFloat pointSpace; // point space of point indicator
|
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
|
|
||||||
@protocol WXIndicatorComponentDelegate <NSObject> |
|
||||||
|
|
||||||
-(void)setIndicatorView:(WXIndicatorView *)indicatorView; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@interface WXIndicatorComponent : WXComponent |
|
||||||
|
|
||||||
@property (nonatomic, weak) id<WXIndicatorComponentDelegate> delegate; |
|
||||||
|
|
||||||
@end |
|
@ -1,72 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
@interface WXJSExceptionInfo : NSObject |
|
||||||
/**
|
|
||||||
* instance id |
|
||||||
*/ |
|
||||||
@property(nonatomic,strong) NSString * instanceId; |
|
||||||
/**
|
|
||||||
* the URL where the exception occurred |
|
||||||
*/ |
|
||||||
@property(nonatomic,strong) NSString * bundleUrl; |
|
||||||
/**
|
|
||||||
* error code |
|
||||||
*/ |
|
||||||
@property(nonatomic,strong) NSString * errorCode; |
|
||||||
/**
|
|
||||||
* the function name of exception |
|
||||||
*/ |
|
||||||
@property(nonatomic,strong) NSString * functionName; |
|
||||||
/**
|
|
||||||
* exception detail; |
|
||||||
*/ |
|
||||||
@property(nonatomic,strong) NSString * exception; |
|
||||||
/**
|
|
||||||
* extend filed |
|
||||||
*/ |
|
||||||
@property(nonatomic,strong) NSMutableDictionary * userInfo; |
|
||||||
/**
|
|
||||||
* weex sdk version |
|
||||||
*/ |
|
||||||
@property(nonatomic,strong, readonly) NSString * sdkVersion; |
|
||||||
/**
|
|
||||||
* js framework verison |
|
||||||
*/ |
|
||||||
@property(nonatomic,strong, readonly) NSString * jsfmVersion; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Initializes a WXJSException instance |
|
||||||
* @param instanceId the id of instance |
|
||||||
* @param bundleUrl the page URL where the exception occurred |
|
||||||
* @param errorCode error Code |
|
||||||
* @param exception exception detail |
|
||||||
* @param userInfo extend field |
|
||||||
*/ |
|
||||||
- (instancetype)initWithInstanceId:(NSString *)instanceId |
|
||||||
bundleUrl:(NSString *)bundleUrl |
|
||||||
errorCode:(NSString *)errorCode |
|
||||||
functionName:(NSString *)functionName |
|
||||||
exception:(NSString *)exception |
|
||||||
userInfo:(NSMutableDictionary *)userInfo; |
|
||||||
|
|
||||||
@end |
|
@ -1,42 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXJSExceptionInfo.h" |
|
||||||
|
|
||||||
typedef WXJSExceptionInfo WXRuntimeCheckException; |
|
||||||
|
|
||||||
@protocol WXJSExceptionProtocol <NSObject> |
|
||||||
|
|
||||||
/**
|
|
||||||
* report js exception |
|
||||||
* |
|
||||||
* @param exception WXJSExceptionInfo |
|
||||||
*/ |
|
||||||
|
|
||||||
- (void)onJSException:(WXJSExceptionInfo*) exception; |
|
||||||
|
|
||||||
|
|
||||||
@optional |
|
||||||
|
|
||||||
/**
|
|
||||||
* report runtime check exception, this is optional for this protocol |
|
||||||
*/ |
|
||||||
- (void)onRuntimeCheckException:(WXRuntimeCheckException*)exception; |
|
||||||
|
|
||||||
@end |
|
@ -1,29 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
typedef void (^WXJSFrameworkLoadBlock)(NSString *path, NSString *script); |
|
||||||
|
|
||||||
@protocol WXJSFrameworkLoadProtocol <NSObject> |
|
||||||
|
|
||||||
- (void)loadRaxFramework:(WXJSFrameworkLoadBlock)block; |
|
||||||
- (void)loadPolyfillFramework:(WXJSFrameworkLoadBlock)block; |
|
||||||
|
|
||||||
@end |
|
@ -1,24 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXScrollerComponent.h" |
|
||||||
|
|
||||||
@interface WXListComponent : WXScrollerComponent |
|
||||||
|
|
||||||
@end |
|
@ -1,25 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXModuleProtocol.h" |
|
||||||
|
|
||||||
@interface WXModalUIModule : NSObject <WXModuleProtocol> |
|
||||||
|
|
||||||
@end |
|
@ -1,78 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
#import "WXDefine.h" |
|
||||||
#import "WXSDKInstance.h" |
|
||||||
|
|
||||||
#define MSG_SUCCESS @"WX_SUCCESS" |
|
||||||
#define MSG_NO_HANDLER @"WX_NO_HANDLER" |
|
||||||
#define MSG_NO_PERMIT @"WX_NO_PERMISSION" |
|
||||||
#define MSG_FAILED @"WX_FAILED" |
|
||||||
#define MSG_PARAM_ERR @"WX_PARAM_ERR" |
|
||||||
#define MSG_EXP @"WX_EXCEPTION" |
|
||||||
|
|
||||||
@protocol WXModuleProtocol <NSObject> |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract the module callback , result can be string or dictionary. |
|
||||||
* @discussion callback data to js, the id of callback function will be removed to save memory. |
|
||||||
*/ |
|
||||||
typedef void (^WXModuleCallback)(id result); |
|
||||||
//DEPRECATED_MSG_ATTRIBUTE("use WXModuleKeepAliveCallback, you can specify keep the callback or not, if keeped, it can be called multi times, or it will be removed after called.")
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract the module callback , result can be string or dictionary. |
|
||||||
* @discussion callback data to js, you can specify the keepAlive parameter to keep callback function id keepalive or not. If the keepAlive is true, it won't be removed until instance destroyed, so you can call it repetitious. |
|
||||||
*/ |
|
||||||
typedef void (^WXModuleKeepAliveCallback)(id result, BOOL keepAlive); |
|
||||||
|
|
||||||
#define WX_EXPORT_MODULE(module) |
|
||||||
|
|
||||||
@optional |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract returns the execute queue for the module |
|
||||||
* |
|
||||||
* @return dispatch queue that module's methods will be invoked on |
|
||||||
* |
|
||||||
* @discussion the implementation is optional. Implement it if you want to execute module actions in the special queue. |
|
||||||
* Default dispatch queue will be the main queue. |
|
||||||
* |
|
||||||
*/ |
|
||||||
- (dispatch_queue_t)targetExecuteQueue; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract returns the execute thread for the module |
|
||||||
* |
|
||||||
* @return thread that module's methods will be invoked on |
|
||||||
* |
|
||||||
* @discussion the implementation is optional. If you want to execute module actions in the special thread, you can create a new one.
|
|
||||||
* If `targetExecuteQueue` is implemented, the queue returned will be respected first. |
|
||||||
* Default is the main thread. |
|
||||||
* |
|
||||||
*/ |
|
||||||
- (NSThread *)targetExecuteThread; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract the instance bind to this module. It helps you to get many useful properties related to the instance. |
|
||||||
*/ |
|
||||||
@property (nonatomic, weak) WXSDKInstance *weexInstance; |
|
||||||
|
|
||||||
@end |
|
@ -1,113 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXDefine.h" |
|
||||||
#import "WXSDKError.h" |
|
||||||
|
|
||||||
@class WXSDKInstance; |
|
||||||
|
|
||||||
typedef enum : NSUInteger { |
|
||||||
// global
|
|
||||||
WXPTInitalize = 0, |
|
||||||
WXPTInitalizeSync, |
|
||||||
WXPTFrameworkExecute, |
|
||||||
// instance
|
|
||||||
WXPTJSDownload, |
|
||||||
WXPTJSCreateInstance, |
|
||||||
WXFirstScreenJSFExecuteTime, |
|
||||||
WXPTFirstScreenRender, |
|
||||||
WXPTAllRender, |
|
||||||
WXPTBundleSize, |
|
||||||
//new point
|
|
||||||
//doc see @WXPerformance
|
|
||||||
WXPTFsCallJsTime, |
|
||||||
WXPTFsCallJsNum, |
|
||||||
WXPTFsCallNativeTime, |
|
||||||
WXPTFsCallNativeNum, |
|
||||||
WXPTFsCallEventNum, |
|
||||||
WXPTFsReqNetNum, |
|
||||||
WXPTCellExceedNum, |
|
||||||
WXPTMaxDeepVDom, |
|
||||||
WXPTImgWrongSizeNum, |
|
||||||
WXPTTimerNum, |
|
||||||
WXPTInteractionTime, |
|
||||||
WXPTWrongImgSize, |
|
||||||
WXPTInteractionAddCount, |
|
||||||
WXPTInteractionLimitAddCount, |
|
||||||
WXPTComponentCount, |
|
||||||
WXPTComponentCreateTime, |
|
||||||
WXPNewFSRenderTime, |
|
||||||
//end
|
|
||||||
WXPTEnd |
|
||||||
} WXPerformanceTag; |
|
||||||
|
|
||||||
typedef enum : NSUInteger { |
|
||||||
WXMTJSFramework, |
|
||||||
WXMTJSDownload, |
|
||||||
WXMTJSBridge, |
|
||||||
WXMTNativeRender, |
|
||||||
WXMTJSService, |
|
||||||
} WXMonitorTag; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, CommitState) |
|
||||||
{ |
|
||||||
MonitorCommit, |
|
||||||
|
|
||||||
//just use on Debug mode
|
|
||||||
DebugAfterRequest, |
|
||||||
DebugAfterFSFinish, |
|
||||||
DebugAfterExist, |
|
||||||
DebugOnRealTime |
|
||||||
}; |
|
||||||
|
|
||||||
#define WX_MONITOR_SUCCESS_ON_PAGE(tag, pageName) [WXMonitor monitoringPointDidSuccess:tag onPage:pageName]; |
|
||||||
#define WX_MONITOR_FAIL_ON_PAGE(tag, errorCode, errorMessage, pageName) \ |
|
||||||
NSError *error = [NSError errorWithDomain:WX_ERROR_DOMAIN \
|
|
||||||
code:errorCode \
|
|
||||||
userInfo:@{NSLocalizedDescriptionKey:(errorMessage?:@"No message")}]; \
|
|
||||||
[WXMonitor monitoringPoint:tag didFailWithError:error onPage:pageName]; |
|
||||||
|
|
||||||
#define WX_MONITOR_SUCCESS(tag) WX_MONITOR_SUCCESS_ON_PAGE(tag, nil) |
|
||||||
#define WX_MONITOR_FAIL(tag, errorCode, errorMessage) WX_MONITOR_FAIL_ON_PAGE(tag, errorCode, errorMessage, nil) |
|
||||||
|
|
||||||
#define WX_MONITOR_PERF_START(tag) [WXMonitor performancePoint:tag willStartWithInstance:nil]; |
|
||||||
#define WX_MONITOR_PERF_END(tag) [WXMonitor performancePoint:tag didEndWithInstance:nil]; |
|
||||||
#define WX_MONITOR_INSTANCE_PERF_START(tag, instance) [WXMonitor performancePoint:tag willStartWithInstance:instance]; |
|
||||||
#define WX_MONITOR_INSTANCE_PERF_END(tag, instance) [WXMonitor performancePoint:tag didEndWithInstance:instance]; |
|
||||||
#define WX_MONITOR_PERF_SET(tag, value, instance) [WXMonitor performancePoint:tag didSetValue:value withInstance:instance]; |
|
||||||
#define WX_MONITOR_INSTANCE_PERF_IS_RECORDED(tag, instance) [WXMonitor performancePoint:tag isRecordedWithInstance:instance] |
|
||||||
#define WX_MONITOR_INSTANCE_PERF_COMMIT(instance) [WXMonitor performanceFinish:instance] |
|
||||||
|
|
||||||
//DEPRECATED_ATTRIBUTE
|
|
||||||
@interface WXMonitor : NSObject |
|
||||||
|
|
||||||
+ (void)performancePoint:(WXPerformanceTag)tag willStartWithInstance:(WXSDKInstance *)instance; |
|
||||||
+ (void)performancePoint:(WXPerformanceTag)tag didEndWithInstance:(WXSDKInstance *)instance; |
|
||||||
+ (void)performancePoint:(WXPerformanceTag)tag didSetValue:(double)value withInstance:(WXSDKInstance *)instance; |
|
||||||
+ (BOOL)performancePoint:(WXPerformanceTag)tag isRecordedWithInstance:(WXSDKInstance *)instance; |
|
||||||
+ (void)performanceFinish:(WXSDKInstance *)instance; |
|
||||||
|
|
||||||
+ (void)monitoringPointDidSuccess:(WXMonitorTag)tag onPage:(NSString *)pageName; |
|
||||||
+ (void)monitoringPoint:(WXMonitorTag)tag didFailWithError:(NSError *)error onPage:(NSString *)pageName; |
|
||||||
|
|
||||||
+ (void)performanceFinishWithState:(CommitState) state instance:(WXSDKInstance *)instance; |
|
||||||
|
|
||||||
@end |
|
@ -1,168 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXModuleProtocol.h" |
|
||||||
|
|
||||||
/**
|
|
||||||
* This enum is used to define the position of navbar item. |
|
||||||
*/ |
|
||||||
typedef NS_ENUM(NSInteger, WXNavigationItemPosition) { |
|
||||||
WXNavigationItemPositionCenter = 0x00, |
|
||||||
WXNavigationItemPositionRight, |
|
||||||
WXNavigationItemPositionLeft, |
|
||||||
WXNavigationItemPositionMore |
|
||||||
}; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract The callback after executing navigator operations. The code has some status such as 'WX_SUCCESS'、'WX_FAILED' etc. The responseData |
|
||||||
* contains some useful info you can handle. |
|
||||||
*/ |
|
||||||
typedef void (^WXNavigationResultBlock)(NSString *code, NSDictionary * responseData); |
|
||||||
|
|
||||||
@protocol WXNavigationProtocol <WXModuleProtocol> |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns the navigation controller. |
|
||||||
* |
|
||||||
* @param container The target controller. |
|
||||||
*/ |
|
||||||
- (id)navigationControllerOfContainer:(UIViewController *)container; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Sets the navigation bar hidden. |
|
||||||
* |
|
||||||
* @param hidden If YES, the navigation bar is hidden. |
|
||||||
* |
|
||||||
* @param animated Specify YES to animate the transition or NO if you do not want the transition to be animated. |
|
||||||
* |
|
||||||
* @param container The navigation controller. |
|
||||||
* |
|
||||||
*/ |
|
||||||
- (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated |
|
||||||
withContainer:(UIViewController *)container; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Sets the background color of navigation bar. |
|
||||||
* |
|
||||||
* @param backgroundColor The background color of navigation bar. |
|
||||||
* |
|
||||||
* @param container The target controller. |
|
||||||
* |
|
||||||
*/ |
|
||||||
- (void)setNavigationBackgroundColor:(UIColor *)backgroundColor |
|
||||||
withContainer:(UIViewController *)container; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Sets the item in navigation bar. |
|
||||||
* |
|
||||||
* @param param The data which is passed to the implementation of the protocol. |
|
||||||
* |
|
||||||
* @param position The value indicates the position of item. |
|
||||||
* |
|
||||||
* @param block A block called once the action is completed. |
|
||||||
* |
|
||||||
* @param container The target controller. |
|
||||||
* |
|
||||||
*/ |
|
||||||
- (void)setNavigationItemWithParam:(NSDictionary *)param |
|
||||||
position:(WXNavigationItemPosition)position |
|
||||||
completion:(WXNavigationResultBlock)block |
|
||||||
withContainer:(UIViewController *)container; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Clears the item in navigation bar. |
|
||||||
* |
|
||||||
* @param param The data which is passed to the implementation of the protocol. |
|
||||||
* |
|
||||||
* @param position The value indicates the position of item. |
|
||||||
* |
|
||||||
* @param block A block called once the action is completed. |
|
||||||
* |
|
||||||
* @param container The target controller. |
|
||||||
* |
|
||||||
*/ |
|
||||||
- (void)clearNavigationItemWithParam:(NSDictionary *)param |
|
||||||
position:(WXNavigationItemPosition)position |
|
||||||
completion:(WXNavigationResultBlock)block |
|
||||||
withContainer:(UIViewController *)container; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Pushes a view controller onto the receiver’s stack. |
|
||||||
* |
|
||||||
* @param param The data which is passed to the implementation of the protocol. |
|
||||||
* |
|
||||||
* @param block A block called once the action is completed. |
|
||||||
* |
|
||||||
* @param container The target controller. |
|
||||||
* |
|
||||||
*/ |
|
||||||
- (void)pushViewControllerWithParam:(NSDictionary *)param |
|
||||||
completion:(WXNavigationResultBlock)block |
|
||||||
withContainer:(UIViewController *)container; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Pops the top view controller from the navigation stack. |
|
||||||
* |
|
||||||
* @param param The data which is passed to the implementation of the protocol. |
|
||||||
* |
|
||||||
* @param block A block called once the action is completed. |
|
||||||
* |
|
||||||
* @param container The target controller. |
|
||||||
* |
|
||||||
*/ |
|
||||||
- (void)popViewControllerWithParam:(NSDictionary *)param |
|
||||||
completion:(WXNavigationResultBlock)block |
|
||||||
withContainer:(UIViewController *)container; |
|
||||||
|
|
||||||
|
|
||||||
@optional |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract open the resource at the specified URL which supports many common schemes, including the http, https, tel and mailto schemes. |
|
||||||
* |
|
||||||
* @param param The data which is passed to the implementation of the protocol. |
|
||||||
* |
|
||||||
* @param success A block called once the action is completed successfully. |
|
||||||
* |
|
||||||
* @param failure A block called once the action failed to be completed. |
|
||||||
* |
|
||||||
* @param container The target controller. |
|
||||||
* |
|
||||||
*/ |
|
||||||
- (void)open:(NSDictionary *)param success:(WXModuleCallback)success |
|
||||||
failure:(WXModuleCallback)failure |
|
||||||
withContainer:(UIViewController *)container; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract close the current weex page |
|
||||||
* |
|
||||||
* @param param The data which is passed to the implementation of the protocol. |
|
||||||
* |
|
||||||
* @param success A block called once the action is completed successfully. |
|
||||||
* |
|
||||||
* @param failure A block called once the action failed to be completed. |
|
||||||
* |
|
||||||
* @param container The target controller. |
|
||||||
* |
|
||||||
*/ |
|
||||||
- (void)close:(NSDictionary *)param success:(WXModuleCallback)success |
|
||||||
failure:(WXModuleCallback)failure |
|
||||||
withContainer:(UIViewController *)container; |
|
||||||
@end |
|
@ -1,44 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXModuleProtocol.h" |
|
||||||
|
|
||||||
__attribute__ ((deprecated("Use WXResourceRequestHandler instead"))) |
|
||||||
@protocol WXNetworkProtocol <NSObject> |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract send request |
|
||||||
* |
|
||||||
* @param request The URL Request |
|
||||||
* |
|
||||||
* @param sendDataCallback This block is called periodically to notify the progress. |
|
||||||
* |
|
||||||
* @param responseCallback This block is called when receiving a response and no further messages will be received until the completion block is called.
|
|
||||||
* |
|
||||||
* @param receiveDataCallback This block is called when data is available. |
|
||||||
* |
|
||||||
* @param completionCallback This block is called when the last message related to a specific task is sent. |
|
||||||
*/ |
|
||||||
- (id)sendRequest:(NSURLRequest *)request withSendingData:(void (^)(int64_t bytesSent, int64_t totalBytes))sendDataCallback |
|
||||||
withResponse:(void (^)(NSURLResponse *response))responseCallback |
|
||||||
withReceiveData:(void (^)(NSData *data))receiveDataCallback |
|
||||||
withCompeletion:(void (^)(NSData *totalData, NSError *error))completionCallback; |
|
||||||
|
|
||||||
@end |
|
@ -1,32 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXJSExceptionInfo.h" |
|
||||||
|
|
||||||
@protocol WXPageEventNotifyEventProtocol <NSObject> |
|
||||||
|
|
||||||
- (void)hitTest:(CGPoint)point withEvent:(UIEvent *)event withView:(UIView*)view; |
|
||||||
|
|
||||||
- (void)notifyScrollEvent:(NSString*)instanceId from:(CGPoint)from to:(CGPoint)to; |
|
||||||
|
|
||||||
- (void)pageStart:(NSString*)instanceId; |
|
||||||
|
|
||||||
- (void)pageDestroy:(NSString*)instanceId; |
|
||||||
|
|
||||||
@end |
|
@ -1,110 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXModuleProtocol.h" |
|
||||||
|
|
||||||
@class WXModuleMethod; |
|
||||||
|
|
||||||
@interface WXPrerenderManager : NSObject |
|
||||||
|
|
||||||
- (instancetype) init NS_UNAVAILABLE; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract add prerender task |
|
||||||
* |
|
||||||
* @param url The prerender url string |
|
||||||
* |
|
||||||
* @param instanceId The instanceId that its instance add prerender task |
|
||||||
* |
|
||||||
* @param callback the module method callback |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void) addTask:(NSString *) url instanceId:(NSString *)instanceId callback:(WXModuleKeepAliveCallback)callback; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract add prerender task |
|
||||||
* |
|
||||||
* @param url The prerender url string |
|
||||||
* |
|
||||||
* @param callback the module method callback |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void) addGlobalTask:(NSString *) url callback:(WXModuleKeepAliveCallback)callback; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns true if url is exist in task . |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (BOOL) isTaskExist:(NSString *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns true if task ready. |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (BOOL)isTaskReady:(NSString *)url; |
|
||||||
/**
|
|
||||||
* @abstract Returns key from url . |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (NSString *)getTaskKeyFromUrl:(NSString *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns error if url is prerender fail . |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (NSError *)errorFromUrl:(NSString *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract excute render from prerender cache . |
|
||||||
* @discussion this method should be excuted after oncreat and onfail block created |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void) renderFromCache:(NSString *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns prerender root view . |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (UIView *)viewFromUrl:(NSString *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns prerender instance . |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (id)instanceFromUrl:(NSString *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Remove prerender task by url . |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void)removePrerenderTaskforUrl:(NSString *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract store prerender module task by url . |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void)storePrerenderModuleTasks:(WXModuleMethod *)prerenderModuleTask forUrl:(NSString *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract destroy task , it will destroy instance also. |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void)destroyTask:(NSString *)parentInstanceId; |
|
||||||
@end |
|
@ -1,24 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXScrollerComponent.h" |
|
||||||
|
|
||||||
@interface WXRecyclerComponent : WXScrollerComponent |
|
||||||
|
|
||||||
@end |
|
@ -1,41 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXResourceRequest.h" |
|
||||||
#import "WXResourceResponse.h" |
|
||||||
|
|
||||||
|
|
||||||
@interface WXResourceLoader : NSObject |
|
||||||
|
|
||||||
@property (nonatomic, strong) WXResourceRequest *request; |
|
||||||
|
|
||||||
@property (nonatomic, copy) void (^onDataSent)(unsigned long long /* bytesSent */, unsigned long long /* totalBytesToBeSent */); |
|
||||||
@property (nonatomic, copy) void (^onResponseReceived)(const WXResourceResponse *); |
|
||||||
@property (nonatomic, copy) void (^onDataReceived)(NSData *); |
|
||||||
@property (nonatomic, copy) void (^onFinished)(const WXResourceResponse *, NSData *); |
|
||||||
@property (nonatomic, copy) void (^onFailed)(NSError *); |
|
||||||
|
|
||||||
- (instancetype)initWithRequest:(WXResourceRequest *)request; |
|
||||||
|
|
||||||
- (void)start; |
|
||||||
|
|
||||||
- (void)cancel:(NSError **)error; |
|
||||||
|
|
||||||
@end |
|
@ -1,46 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
typedef enum : NSUInteger { |
|
||||||
WXResourceTypeMainBundle, |
|
||||||
WXResourceTypeServiceBundle, |
|
||||||
WXResourceTypeImage, |
|
||||||
WXResourceTypeFont, |
|
||||||
WXResourceTypeVideo, |
|
||||||
WXResourceTypeLink, |
|
||||||
WXResourceTypeOthers |
|
||||||
} WXResourceType; |
|
||||||
|
|
||||||
|
|
||||||
@interface WXResourceRequest : NSMutableURLRequest |
|
||||||
|
|
||||||
@property (nonatomic, strong) id taskIdentifier; |
|
||||||
@property (nonatomic, assign) WXResourceType type; |
|
||||||
|
|
||||||
@property (nonatomic, strong) NSString *referrer; |
|
||||||
@property (nonatomic, strong) NSString *userAgent; |
|
||||||
|
|
||||||
+ (instancetype)requestWithURL:(NSURL *)url |
|
||||||
resourceType:(WXResourceType)type |
|
||||||
referrer:(NSString *)referrer |
|
||||||
cachePolicy:(NSURLRequestCachePolicy)cachePolicy; |
|
||||||
|
|
||||||
@end |
|
@ -1,61 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXResourceRequest.h" |
|
||||||
#import "WXResourceResponse.h" |
|
||||||
|
|
||||||
@protocol WXResourceRequestDelegate <NSObject> |
|
||||||
|
|
||||||
// Periodically informs the delegate of the progress of sending content to the server.
|
|
||||||
- (void)request:(WXResourceRequest *)request didSendData:(unsigned long long)bytesSent totalBytesToBeSent:(unsigned long long)totalBytesToBeSent; |
|
||||||
|
|
||||||
// Tells the delegate that the request received the initial reply (headers) from the server.
|
|
||||||
- (void)request:(WXResourceRequest *)request didReceiveResponse:(WXResourceResponse *)response; |
|
||||||
|
|
||||||
// Tells the delegate that the request has received some of the expected data.
|
|
||||||
- (void)request:(WXResourceRequest *)request didReceiveData:(NSData *)data; |
|
||||||
|
|
||||||
// Tells the delegate that the request finished transferring data.
|
|
||||||
- (void)requestDidFinishLoading:(WXResourceRequest *)request; |
|
||||||
|
|
||||||
// Tells the delegate that the request failed to load successfully.
|
|
||||||
- (void)request:(WXResourceRequest *)request didFailWithError:(NSError *)error; |
|
||||||
|
|
||||||
// Tells the delegate that when complete statistics information has been collected for the task.
|
|
||||||
#ifdef __IPHONE_10_0 |
|
||||||
- (void)request:(WXResourceRequest *)request didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)); |
|
||||||
#endif |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@protocol WXResourceRequestHandler <NSObject> |
|
||||||
|
|
||||||
// Send a resource request with a delegate
|
|
||||||
- (void)sendRequest:(WXResourceRequest *)request withDelegate:(id<WXResourceRequestDelegate>)delegate; |
|
||||||
|
|
||||||
@optional |
|
||||||
|
|
||||||
// Cancel the ongoing request
|
|
||||||
- (void)cancelRequest:(WXResourceRequest *)request; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
|
|
@ -1,25 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
@interface WXResourceResponse : NSHTTPURLResponse |
|
||||||
|
|
||||||
@end |
|
@ -1,24 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXComponent.h" |
|
||||||
|
|
||||||
@interface WXRichText : WXComponent<UITextViewDelegate> |
|
||||||
|
|
||||||
@end |
|
@ -1,29 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
|
|
||||||
@class WXSDKInstance; |
|
||||||
@interface WXRootView : UIScrollView |
|
||||||
|
|
||||||
@property (nonatomic, weak) WXSDKInstance *instance; |
|
||||||
|
|
||||||
- (BOOL)isHasEvent; |
|
||||||
|
|
||||||
@end |
|
@ -1,44 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
|
|
||||||
/**
|
|
||||||
* The WXRootViewController class inherited from UINavigationController class which implements a specialized |
|
||||||
* view controller that manages the navigation of hierarchical content. Developing an iOS application, you |
|
||||||
* need a series of customer pages which will be render by weex bundle. Sometimes, these pages are embedded in |
|
||||||
* viewcontroller. This navigation controller makes it possible to present your page efficiently and makes it |
|
||||||
* easier for the user to navigate that content. |
|
||||||
*/ |
|
||||||
|
|
||||||
@interface WXRootViewController : UINavigationController |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract initialize the RootViewController with bundle url. |
|
||||||
* |
|
||||||
* @param sourceURL The bundle url which can be render to a weex view. |
|
||||||
* |
|
||||||
* @return a object the class of WXRootViewController. |
|
||||||
* |
|
||||||
* @discussion initialize this controller in function 'application:didFinishLaunchingWithOptions', and make it as rootViewController of window. In the |
|
||||||
* weex application, all page content can be managed by the navigation, such as push or pop. |
|
||||||
*/ |
|
||||||
- (id)initWithSourceURL:(NSURL *)sourceURL; |
|
||||||
|
|
||||||
@end |
|
@ -1,225 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
@class WXSDKInstance; |
|
||||||
|
|
||||||
@interface WXSDKEngine : NSObject |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Register default modules/components/handlers, they will be registered only once. |
|
||||||
**/ |
|
||||||
+ (void)registerDefaults; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Register a module for a given name |
|
||||||
* |
|
||||||
* @param name The module name to register |
|
||||||
* |
|
||||||
* @param clazz The module class to register |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void)registerModule:(NSString *)name withClass:(Class)clazz; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Registers a component for a given name |
|
||||||
* |
|
||||||
* @param name The component name to register |
|
||||||
* |
|
||||||
* @param clazz The WXComponent subclass to register |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void)registerComponent:(NSString *)name withClass:(Class)clazz; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Registers a extendCallNative Class for a given name |
|
||||||
* |
|
||||||
* @param name The extendCallNative name to register |
|
||||||
* |
|
||||||
* @param clazz The extendCallNative subclass to register |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void)registerExtendCallNative:(NSString *)name withClass:(Class)clazz; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Registers a component for a given name and specific properties |
|
||||||
* |
|
||||||
* @param name The component name to register |
|
||||||
* |
|
||||||
* @param clazz The WXComponent subclass to register |
|
||||||
* |
|
||||||
* @param properties properties to apply to the component |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (void)registerComponent:(NSString *)name withClass:(Class)clazz withProperties:(NSDictionary *)properties; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Registers a component for a given name, options and js code |
|
||||||
* |
|
||||||
* @param name The service name to register |
|
||||||
* |
|
||||||
* @param options The service options to register |
|
||||||
* |
|
||||||
* @param serviceScript service js code to invoke |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (void)registerService:(NSString *)name withScript:(NSString *)serviceScript withOptions:(NSDictionary *)options; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Registers a component for a given name, options and js code |
|
||||||
* |
|
||||||
* @param name The service name to register |
|
||||||
* |
|
||||||
* @param options The service options to register |
|
||||||
* |
|
||||||
* @param serviceScript service js code to invoke |
|
||||||
* |
|
||||||
* @param completion Completion callback. JS is executed in asynchronously. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (void)registerService:(NSString *)name withScript:(NSString *)serviceScript withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Registers a component for a given name, options and js url |
|
||||||
* |
|
||||||
* @param name The service name to register |
|
||||||
* |
|
||||||
* @param options The service options to register |
|
||||||
* |
|
||||||
* @param serviceScriptUrl The service url to register |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (void)registerService:(NSString *)name withScriptUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Registers a component for a given name, options and js url |
|
||||||
* |
|
||||||
* @param name The service name to register |
|
||||||
* |
|
||||||
* @param options The service options to register |
|
||||||
* |
|
||||||
* @param serviceScriptUrl The service url to register |
|
||||||
* |
|
||||||
* @param completion Completion callback. JS is executed in asynchronously. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (void)registerService:(NSString *)name withScriptUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Registers a component for a given name, options and js code |
|
||||||
* |
|
||||||
* @param name The name of register service |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (void)unregisterService:(NSString *)name; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Registers a handler for a given handler instance and specific protocol |
|
||||||
* |
|
||||||
* @param handler The handler instance to register |
|
||||||
* |
|
||||||
* @param protocol The protocol to confirm |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (void)registerHandler:(id)handler withProtocol:(Protocol *)protocol; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns a given handler instance for specific protocol |
|
||||||
* |
|
||||||
* @param protocol The protocol to confirm |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (id)handlerForProtocol:(Protocol *)protocol; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Initializes the global sdk environment |
|
||||||
* |
|
||||||
* @discussion Injects main.js in app bundle as default JSFramework script. |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void)initSDKEnvironment; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Initializes the environment with a given JSFramework script. |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void)initSDKEnvironment:(NSString *)script; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Unloads the bridge context |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void)unload; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract restart Weex Engine. |
|
||||||
**/ |
|
||||||
+ (void)restart; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract restart Weex Engine with specify jsfm. |
|
||||||
**/ |
|
||||||
+ (void)restartWithScript:(NSString*)script; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns the version of SDK |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (NSString*)SDKEngineVersion; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract The Instance at the top of the rendering stack.
|
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (WXSDKInstance *)topInstance; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Add custom environment variables |
|
||||||
* @discuss These variables can be obtained by $getConfig().env |
|
||||||
* |
|
||||||
**/ |
|
||||||
+ (void)setCustomEnvironment:(NSDictionary *)environment; |
|
||||||
+ (NSDictionary *)customEnvironment; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Connects to websocket for collecting log |
|
||||||
* |
|
||||||
* @param URL The URL of websocket to connect |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (void)connectDebugServer:(NSString*)URL; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Connects to websocket for devtool debug |
|
||||||
* |
|
||||||
* @param URL The URL of websocket to connect |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (void)connectDevToolServer:(NSString *)URL; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@interface WXSDKEngine (Deprecated) |
|
||||||
|
|
||||||
+ (void)initSDKEnviroment DEPRECATED_MSG_ATTRIBUTE("To fix typo, use initSDKEnvironment method instead."); |
|
||||||
+ (void)initSDKEnviroment:(NSString *)script DEPRECATED_MSG_ATTRIBUTE("To fix typo, use initSDKEnvironment: method instead."); |
|
||||||
|
|
||||||
@end |
|
@ -1,111 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXSDKInstance.h" |
|
||||||
|
|
||||||
#define WX_ERROR_GROUP_NATIVE @"NATIVE" |
|
||||||
#define WX_ERROR_GROUP_JS @"JS" |
|
||||||
#define WX_ERROR_GROUP_NET @"NET" |
|
||||||
|
|
||||||
#define WX_ERROR_TYPE_NATIVE @"NATIVE_ERROR" |
|
||||||
#define WX_ERROR_TYPE_JS @"JS_ERROR" |
|
||||||
#define WX_ERROR_TYPE_DEGRADE @"DEGRAD_ERROR" |
|
||||||
#define WX_ERROR_TYPE_RENDER @"RENDER_ERROR" |
|
||||||
#define WX_ERROR_TYPE_DOWNLOAD @"DOWN_LOAD_ERROR" |
|
||||||
|
|
||||||
|
|
||||||
typedef NS_ENUM(int, WXSDKErrCode) |
|
||||||
{ |
|
||||||
WX_ERR_JSFRAMEWORK_START = -1001, |
|
||||||
WX_ERR_JSFRAMEWORK_LOAD = -1002, |
|
||||||
WX_ERR_JSFRAMEWORK_EXECUTE = -1003, |
|
||||||
WX_ERR_JSFRAMEWORK_END = -1099, |
|
||||||
|
|
||||||
WX_ERR_JSBRIDGE_START = -2001, |
|
||||||
WX_ERR_JSFUNC_PARAM = -2009, |
|
||||||
WX_ERR_INVOKE_NATIVE = -2012, |
|
||||||
WX_ERR_JS_EXECUTE = -2013, |
|
||||||
WX_ERR_JSBRIDGE_END = -2099, |
|
||||||
|
|
||||||
WX_ERR_RENDER_START = -2100, |
|
||||||
WX_ERR_RENDER_CREATEBODY = -2100, |
|
||||||
WX_ERR_RENDER_UPDATTR = -2101, |
|
||||||
WX_ERR_RENDER_UPDSTYLE = -2102, |
|
||||||
WX_ERR_RENDER_ADDELEMENT = -2103, |
|
||||||
WX_ERR_RENDER_REMOVEELEMENT = -2104, |
|
||||||
WX_ERR_RENDER_MOVEELEMENT = -2105, |
|
||||||
WX_ERR_RENDER_ADDEVENT = -2106, |
|
||||||
WX_ERR_RENDER_REMOVEEVENT = -2107, |
|
||||||
WX_ERR_RENDER_SCROLLTOELEMENT = -2110, |
|
||||||
WX_ERR_RENDER_TWICE = -2111, |
|
||||||
WX_ERR_RENDER_END = -2199, |
|
||||||
|
|
||||||
WX_ERR_DOWNLOAD_START = -2201, |
|
||||||
WX_ERR_JSBUNDLE_DOWNLOAD = -2202, |
|
||||||
WX_ERR_JSBUNDLE_STRING_CONVERT = -2203, |
|
||||||
WX_ERR_NOT_CONNECTED_TO_INTERNET = -2205, |
|
||||||
WX_ERR_CANCEL = -2204, |
|
||||||
WX_ERR_DOWNLOAD_END = -2299, |
|
||||||
|
|
||||||
WX_KEY_EXCEPTION_SDK_INIT = -9000, |
|
||||||
WX_KEY_EXCEPTION_INVOKE = -9100, |
|
||||||
WX_KEY_EXCEPTION_JS_DOWNLOAD =-9200, |
|
||||||
WX_KEY_EXCEPTION_DOM = -9300, |
|
||||||
WX_KEY_EXCEPTION_WXBRIDGE=-9400, |
|
||||||
|
|
||||||
WX_KEY_EXCEPTION_DEGRADE = -9500, |
|
||||||
WX_KEY_EXCEPTION_DEGRADE_CHECK_CONTENT_LENGTH_FAILED = -9501, |
|
||||||
WX_KEY_EXCEPTION_DEGRADE_BUNDLE_CONTENTTYPE_ERROR = -9502, |
|
||||||
WX_KEY_EXCEPTION_DEGRADE_OTHER_CAUSE = -9503, |
|
||||||
WX_KEY_EXCEPTION_DEGRADE_NET_CODE_CAUSE = -9504, |
|
||||||
|
|
||||||
WX_KEY_EXCEPTION_ABILITY_DOWN = -9600, |
|
||||||
WX_KEY_EXCEPTION_ABILITY_DOWN_IMAGE = -9601, |
|
||||||
WX_KEY_EXCEPTION_ABILITY_DOWN_TOH5 = -9602, |
|
||||||
WX_KEY_EXCEPTION_ABILITY_DOWN_ = -9603, |
|
||||||
|
|
||||||
WX_KEY_EXCEPTION_EMPTY_SCREEN_JS = -9700, |
|
||||||
WX_KEY_EXCEPTION_EMPTY_SCREEN_NATIVE = -9701 |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM (NSInteger,WXSDKErrorType) |
|
||||||
{ |
|
||||||
WX_JS_ERROR, |
|
||||||
WX_NATIVE_ERROR, |
|
||||||
WX_RENDER_ERROR, |
|
||||||
WX_DEGRADE_ERROR, |
|
||||||
WX_DOWN_LOAD_ERROR |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM (NSInteger,WXSDKErrorGroup){ |
|
||||||
WX_JS, |
|
||||||
WX_NATIVE, |
|
||||||
WX_NET |
|
||||||
}; |
|
||||||
|
|
||||||
@interface WXSDKErrCodeUtil :NSObject |
|
||||||
|
|
||||||
+ (WXSDKErrorType) getErrorTypeByCode:(WXSDKErrCode) code; |
|
||||||
+ (WXSDKErrorGroup) getErrorGroupByCode:(WXSDKErrCode) code; |
|
||||||
+ (NSString *) convertGroupToStringName:(WXSDKErrorGroup) group; |
|
||||||
+ (NSString *) convertTypeToStringName:(WXSDKErrorType)type; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
@ -1,34 +0,0 @@ |
|||||||
//
|
|
||||||
// WXSDKInstance+Bridge.h
|
|
||||||
// libWeex
|
|
||||||
//
|
|
||||||
// Created by dcloud on 2019/3/4.
|
|
||||||
// Copyright © 2019 DCloud. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXSDKInstance.h" |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN |
|
||||||
|
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, WXSDKInstanceBridgeEvent) { |
|
||||||
WXSDKInstanceBridgeEventExec, |
|
||||||
WXSDKInstanceBridgeEventExecSync, |
|
||||||
WXSDKInstanceBridgeEventUniappFrameworkReady, |
|
||||||
WXSDKInstanceBridgeEventPostMessage, |
|
||||||
WXSDKInstanceBridgeEventGeInfo |
|
||||||
}; |
|
||||||
|
|
||||||
@interface WXSDKInstance(DCPlusBridge) |
|
||||||
@property (nonatomic, copy) id __nullable (^onMessage)(WXSDKInstanceBridgeEvent evt, id __nullable param); |
|
||||||
- (void)postMessage:(NSDictionary*)message; |
|
||||||
- (void)exec:(NSString*)message; |
|
||||||
- (NSData*)execSync:(NSString*)message; |
|
||||||
- (void)onUniappFramworkReady:(NSString*)message; |
|
||||||
- (NSDictionary*)getConfigInfo; |
|
||||||
- (void)dc_executeJavascript:(NSString*)javaScriptString; |
|
||||||
- (void)clearOnMessage; |
|
||||||
@end |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END |
|
@ -1,23 +0,0 @@ |
|||||||
//
|
|
||||||
// WXSDKInstance+DCExtend.h
|
|
||||||
// libWeex
|
|
||||||
//
|
|
||||||
// Created by XHY on 2019/2/18.
|
|
||||||
// Copyright © 2019 DCloud. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "WXSDKInstance.h" |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN |
|
||||||
|
|
||||||
@interface WXSDKInstance (DCExtend) |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
交换原方法,在options中添加一些自定义参数 |
|
||||||
*/ |
|
||||||
- (void)_dc_renderWithURL:(NSURL *)url options:(NSDictionary *)options data:(id)data; |
|
||||||
- (void)_dc_renderView:(id)source options:(NSDictionary *)options data:(id)data; |
|
||||||
@end |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END |
|
@ -1,450 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
#import "WXComponent.h" |
|
||||||
#import "WXJSExceptionInfo.h" |
|
||||||
#import "WXResourceResponse.h" |
|
||||||
#import "WXResourceRequest.h" |
|
||||||
#import "WXBridgeProtocol.h" |
|
||||||
#import "WXApmForInstance.h" |
|
||||||
#import "WXComponentManager.h" |
|
||||||
|
|
||||||
extern NSString *const bundleUrlOptionKey; |
|
||||||
|
|
||||||
@interface WXSDKInstance : NSObject |
|
||||||
|
|
||||||
/**
|
|
||||||
* Init instance and render it using iOS native views. |
|
||||||
* It is the same as initWithRenderType:@"platform" |
|
||||||
**/ |
|
||||||
- (instancetype)init; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Init instance with custom render type. |
|
||||||
**/ |
|
||||||
- (instancetype)initWithRenderType:(NSString*)renderType; |
|
||||||
|
|
||||||
/**
|
|
||||||
* The render type. Default is "platform" |
|
||||||
**/ |
|
||||||
@property (nonatomic, strong, readonly) NSString* renderType; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns YES when self.renderType != "platform" |
|
||||||
**/ |
|
||||||
@property (nonatomic, assign, readonly) BOOL isCustomRenderType; |
|
||||||
|
|
||||||
/*
|
|
||||||
* For weex containers in view controller(main containers), we may need to release render buffer |
|
||||||
* of custom render type page to save memory. |
|
||||||
*/ |
|
||||||
@property (nonatomic, assign) BOOL isMainContainerStack; |
|
||||||
|
|
||||||
/**
|
|
||||||
* The viewControler which the weex bundle is rendered in. |
|
||||||
**/ |
|
||||||
@property (nonatomic, weak) UIViewController *viewController; |
|
||||||
|
|
||||||
/**
|
|
||||||
* The Native root container used to bear the view rendered by weex file.
|
|
||||||
* The root view is controlled by WXSDKInstance, so you can only get it, but not change it. |
|
||||||
**/ |
|
||||||
@property (nonatomic, strong) UIView *rootView; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Component can freeze the rootview frame through the variable isRootViewFrozen |
|
||||||
* If Component want to freeze the rootview frame, set isRootViewFrozen YES, weex will not change the rootview frame when layout,or set NO. |
|
||||||
**/ |
|
||||||
@property (nonatomic, assign) BOOL isRootViewFrozen; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Which indicates current instance needs to be validated or not to load,default value is false. |
|
||||||
**/ |
|
||||||
@property (nonatomic, assign) BOOL needValidate; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Which indicates current instance use backup JS thread run,default value is false. |
|
||||||
**/ |
|
||||||
@property (nonatomic, assign) BOOL useBackupJsThread; |
|
||||||
|
|
||||||
/**
|
|
||||||
* The scriptURL of weex bundle. |
|
||||||
**/ |
|
||||||
@property (nonatomic, strong) NSURL *scriptURL; |
|
||||||
|
|
||||||
/**
|
|
||||||
* The parent instance. |
|
||||||
**/ |
|
||||||
@property (nonatomic, weak) WXSDKInstance *parentInstance; |
|
||||||
|
|
||||||
/**
|
|
||||||
* The node reference of parent instance. |
|
||||||
**/ |
|
||||||
@property (nonatomic, weak) NSString *parentNodeRef; |
|
||||||
|
|
||||||
/**
|
|
||||||
* The unique id to identify current weex instance. |
|
||||||
**/ |
|
||||||
@property (nonatomic, strong) NSString *instanceId; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Which indicates current instance needs to be prerender or not,default value is false. |
|
||||||
**/ |
|
||||||
@property (nonatomic, assign) BOOL needPrerender; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom info. |
|
||||||
**/ |
|
||||||
@property (nonatomic, strong) NSDictionary* containerInfo; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether this instance is rendered or not. Please MUST not render an instance twice even if you have called destroyInstance. |
|
||||||
**/ |
|
||||||
@property (nonatomic, assign, readonly) BOOL isRendered; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Get component manager of this instance. You can manipulate components then. |
|
||||||
**/ |
|
||||||
@property (nonatomic, readonly, strong) WXComponentManager *componentManager; |
|
||||||
|
|
||||||
/**
|
|
||||||
* The state of current instance. |
|
||||||
**/ |
|
||||||
typedef NS_ENUM(NSInteger, WXState) {//state.code
|
|
||||||
WeexInstanceAppear = 100, |
|
||||||
WeexInstanceDisappear, |
|
||||||
WeexInstanceForeground, |
|
||||||
WeexInstanceBackground, |
|
||||||
WeexInstanceMemoryWarning, |
|
||||||
WeexInstanceBindChanged, |
|
||||||
WeexInstanceDestroy |
|
||||||
}; |
|
||||||
|
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, WXErrorType) {//error.domain
|
|
||||||
TemplateErrorType = 1, |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, WXErrorCode) {//error.code
|
|
||||||
PlatformErrorCode = 1000, |
|
||||||
OSVersionErrorCode, |
|
||||||
AppVersionErrorCode, |
|
||||||
WeexSDKVersionErrorCode, |
|
||||||
DeviceModelErrorCode, |
|
||||||
FrameworkVersionErrorCode, |
|
||||||
}; |
|
||||||
|
|
||||||
@property (nonatomic, assign) WXState state; |
|
||||||
|
|
||||||
/**
|
|
||||||
* The callback triggered when the instance finishes creating the body. |
|
||||||
* |
|
||||||
* @return A block that takes a UIView argument, which is the root view |
|
||||||
**/ |
|
||||||
@property (nonatomic, copy) void (^onCreate)(UIView *); |
|
||||||
|
|
||||||
/**
|
|
||||||
* The callback triggered when the root container's frame has changed. |
|
||||||
* |
|
||||||
* @return A block that takes a UIView argument, which is the root view |
|
||||||
**/ |
|
||||||
@property (nonatomic, copy) void (^onLayoutChange)(UIView *); |
|
||||||
|
|
||||||
/**
|
|
||||||
* The callback triggered when the instance finishes rendering. |
|
||||||
* |
|
||||||
* @return A block that takes a UIView argument, which is the root view |
|
||||||
**/ |
|
||||||
@property (nonatomic, copy) void (^renderFinish)(UIView *); |
|
||||||
|
|
||||||
/**
|
|
||||||
* The callback triggered when the instance finishes refreshing weex view. |
|
||||||
* |
|
||||||
* @return A block that takes a UIView argument, which is the root view |
|
||||||
**/ |
|
||||||
@property (nonatomic, copy) void (^refreshFinish)(UIView *); |
|
||||||
/**
|
|
||||||
* bundleType is the DSL type |
|
||||||
*/ |
|
||||||
@property (nonatomic, strong) NSString * bundleType; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Which decide whether to use data render,default value is false |
|
||||||
*/ |
|
||||||
@property (nonatomic, assign, readonly) BOOL dataRender; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Which decide whether to use binary code render, default value is false |
|
||||||
*/ |
|
||||||
@property (nonatomic, assign, readonly) BOOL wlasmRender; |
|
||||||
|
|
||||||
/**
|
|
||||||
* The callback triggered when the instance fails to render. |
|
||||||
* |
|
||||||
* @return A block that takes a NSError argument, which is the error occured |
|
||||||
**/ |
|
||||||
@property (nonatomic, copy) void (^onFailed)(NSError *error); |
|
||||||
|
|
||||||
/**
|
|
||||||
* |
|
||||||
* @return instance runtime JavaScript. |
|
||||||
* you must call it in brige thread. Learn more at WXPerformBlockOnBridgeThread |
|
||||||
**/ |
|
||||||
- (id<WXBridgeProtocol>)instanceJavaScriptContext; |
|
||||||
|
|
||||||
/**
|
|
||||||
* The callback triggered when js occurs runtime error while executing. |
|
||||||
* |
|
||||||
* @return A block that takes a WXJSExceptionInfo argument, which is the exception info |
|
||||||
**/ |
|
||||||
@property (nonatomic, copy) void (^onJSRuntimeException)(WXJSExceptionInfo * jsException); |
|
||||||
|
|
||||||
/**
|
|
||||||
* The callback triggered when the instacne executes scrolling . |
|
||||||
* |
|
||||||
* @return A block that takes a CGPoint argument, which is content offset of the scroller |
|
||||||
**/ |
|
||||||
@property (nonatomic, copy) void (^onScroll)(CGPoint contentOffset); |
|
||||||
|
|
||||||
/**
|
|
||||||
* the callback to be run repeatedly while the instance is rendering. |
|
||||||
* |
|
||||||
* @return A block that takes a CGRect argument, which is the rect rendered |
|
||||||
**/ |
|
||||||
@property (nonatomic, copy) void (^onRenderProgress)(CGRect renderRect); |
|
||||||
|
|
||||||
/**
|
|
||||||
* The callback triggered when the bundleJS request finished in the renderWithURL. |
|
||||||
* @return A block that takes response which the server response,request which send to server,data which the server returned and an error |
|
||||||
*/ |
|
||||||
@property (nonatomic, copy) void(^onJSDownloadedFinish)(WXResourceResponse *response,WXResourceRequest *request,NSData *data, NSError* error); |
|
||||||
|
|
||||||
/**
|
|
||||||
* The callback triggered when the bundleJS request finished in the renderWithURL. If the callback returns YES, the render process will terminate. |
|
||||||
* @return A block that takes response which the server response,request which send to server,data which the server returned and an error |
|
||||||
*/ |
|
||||||
@property (nonatomic, copy) BOOL (^onRenderTerminateWhenJSDownloadedFinish)(WXResourceResponse *response,WXResourceRequest *request,NSData *data, NSError* error); |
|
||||||
|
|
||||||
@property(nonatomic,strong) NSDictionary* continerInfo; |
|
||||||
|
|
||||||
/**
|
|
||||||
* the frame of current instance. |
|
||||||
**/ |
|
||||||
@property (nonatomic, assign) CGRect frame; |
|
||||||
|
|
||||||
/**
|
|
||||||
* the info stored by user. |
|
||||||
*/ |
|
||||||
@property (atomic, strong) NSMutableDictionary *userInfo; |
|
||||||
|
|
||||||
/**
|
|
||||||
* scale factor from css unit to device pixel. |
|
||||||
*/ |
|
||||||
@property (nonatomic, assign, readonly) CGFloat pixelScaleFactor; |
|
||||||
/**
|
|
||||||
* track component render |
|
||||||
*/ |
|
||||||
@property (nonatomic, assign)BOOL trackComponent; |
|
||||||
/**
|
|
||||||
* Renders weex view with bundle url. |
|
||||||
* |
|
||||||
* @param url The url of bundle rendered to a weex view. |
|
||||||
**/ |
|
||||||
- (void)renderWithURL:(NSURL *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders weex view with bundle url and some others. |
|
||||||
* |
|
||||||
* @param url The url of bundle rendered to a weex view. |
|
||||||
* |
|
||||||
* @param options The params passed by user |
|
||||||
* |
|
||||||
* @param data The data the bundle needs when rendered. Defalut is nil. |
|
||||||
**/ |
|
||||||
- (void)renderWithURL:(NSURL *)url options:(NSDictionary *)options data:(id)data; |
|
||||||
|
|
||||||
///**
|
|
||||||
// * Renders weex view with resource request.
|
|
||||||
// *
|
|
||||||
// * @param request The resource request specifying the URL to render with.
|
|
||||||
// *
|
|
||||||
// * @param options The params passed by user.
|
|
||||||
// *
|
|
||||||
// * @param data The data the bundle needs when rendered. Defalut is nil.
|
|
||||||
// **/
|
|
||||||
//- (void)renderWithRequest:(WXResourceRequest *)request options:(NSDictionary *)options data:(id)data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders weex view with source string of bundle and some others. |
|
||||||
* |
|
||||||
* @param options The params passed by user. |
|
||||||
* |
|
||||||
* @param data The data the bundle needs when rendered. Defalut is nil. |
|
||||||
**/ |
|
||||||
- (void)renderView:(id)source options:(NSDictionary *)options data:(id)data; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Reload the js bundle from the current URL and rerender. |
|
||||||
* |
|
||||||
* @param forcedReload when this parameter is true, the js bundle will always be reloaded from the server. If it is false, the instance may reload the js bundle from its cache. Default is false. |
|
||||||
* |
|
||||||
**/ |
|
||||||
- (void)reload:(BOOL)forcedReload; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Refreshes current instance components' layout after setting custom view port/device width. |
|
||||||
**/ |
|
||||||
- (void)reloadLayout; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Refreshes current instance with data. |
|
||||||
* |
|
||||||
* @param data The data the bundle needs when rendered. |
|
||||||
**/ |
|
||||||
- (void)refreshInstance:(id)data; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Destroys current instance. An instance destroyed should not be used for rendering again, please create another instance. |
|
||||||
**/ |
|
||||||
- (void)destroyInstance; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Trigger full GC, for dev and debug only. |
|
||||||
**/ |
|
||||||
- (void)forceGarbageCollection; |
|
||||||
|
|
||||||
/**
|
|
||||||
* get module instance by class |
|
||||||
*/ |
|
||||||
- (id)moduleForClass:(Class)moduleClass; |
|
||||||
|
|
||||||
/**
|
|
||||||
* get Component instance by ref, must be called on component thread by calling WXPerformBlockOnComponentThread |
|
||||||
*/ |
|
||||||
- (WXComponent *)componentForRef:(NSString *)ref; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Number of components created, must be called on component thread by calling WXPerformBlockOnComponentThread |
|
||||||
*/ |
|
||||||
- (NSUInteger)numberOfComponents; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Enumerate components using breadth-first search algorithm, |
|
||||||
must be called on component thread by calling WXPerformBlockOnComponentThread |
|
||||||
*/ |
|
||||||
- (void)enumerateComponentsUsingBlock:(void (^)(WXComponent *component, BOOL *stop))block; |
|
||||||
|
|
||||||
/**
|
|
||||||
* check whether the module eventName is registered |
|
||||||
*/ |
|
||||||
- (BOOL)checkModuleEventRegistered:(NSString*)event moduleClassName:(NSString*)moduleClassName; |
|
||||||
|
|
||||||
/**
|
|
||||||
* fire module event; |
|
||||||
* @param module which module you fire event to |
|
||||||
* @param eventName the event name |
|
||||||
* @param params event params |
|
||||||
*/ |
|
||||||
- (void)fireModuleEvent:(Class)module eventName:(NSString *)eventName params:(NSDictionary*)params; |
|
||||||
|
|
||||||
/**
|
|
||||||
* fire global event |
|
||||||
*/ |
|
||||||
- (void)fireGlobalEvent:(NSString *)eventName params:(NSDictionary *)params; |
|
||||||
|
|
||||||
/**
|
|
||||||
* complete url based with bundle url |
|
||||||
*/ |
|
||||||
- (NSURL *)completeURL:(NSString *)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* jsbundle str ,may be nil (weak) |
|
||||||
*/ |
|
||||||
- (NSString*) bundleTemplate; |
|
||||||
|
|
||||||
/**
|
|
||||||
* application performance statistics |
|
||||||
*/ |
|
||||||
@property (nonatomic, strong) NSString *bizType; |
|
||||||
@property (nonatomic, strong) NSString *pageName; |
|
||||||
@property (nonatomic, weak) id pageObject; |
|
||||||
|
|
||||||
//Deprecated, use @WXApmForInstance
|
|
||||||
@property (nonatomic, strong) NSMutableDictionary *performanceDict; |
|
||||||
@property (nonatomic, strong) WXApmForInstance* apmInstance; |
|
||||||
|
|
||||||
@property (nonatomic, assign) BOOL appearState; |
|
||||||
|
|
||||||
/*
|
|
||||||
* For custom render page to release/restore OpenGL resources, etc. |
|
||||||
*/ |
|
||||||
- (void)willAppear; |
|
||||||
- (void)didDisappear; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Raw css styles are dropped after applied to layout nodes in WeexCore. |
|
||||||
* If a page needs hot refresh(without recreating instance and reload js) after screen orientation changes or |
|
||||||
* after setting custom view-port-width/screen-width/, you need to call setPageNeedsRawCssStyles to store all css styles |
|
||||||
* internally for later use. Or you can use MetaModule's setPageArguments method and provide "reserveCssStyles" as "true" before rendering the page. |
|
||||||
*/ |
|
||||||
- (void)setPageKeepRawCssStyles; |
|
||||||
- (void)isKeepingRawCssStyles:(void(^)(BOOL))callback; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Set additional argument value for WeexCore |
|
||||||
*/ |
|
||||||
- (void)setPageArgument:(NSString*)key value:(NSString*)value; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Set specific required page width and height to prevent this page using global values. |
|
||||||
*/ |
|
||||||
- (void)setPageRequiredWidth:(CGFloat)width height:(CGFloat)height; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Set specific required view port width prevent this page using global value (750px). |
|
||||||
*/ |
|
||||||
- (void)setViewportWidth:(CGFloat)width; |
|
||||||
|
|
||||||
#pragma mark - dc extend |
|
||||||
//-----------↓↓↓↓ uni extend ↓↓↓↓---------------------------------------------------------
|
|
||||||
@property(nonatomic, assign)BOOL dc_transparentEvent; |
|
||||||
@property (nonatomic, copy) void (^bundleJsExecFinish)(void); |
|
||||||
@property (nonatomic, copy) UIView* (^dc_customRootView)(CGRect); |
|
||||||
@property (nonatomic, assign, readonly) CGFloat dc_textFontSize; |
|
||||||
@property (nonatomic, strong) NSString *dc_docPath; |
|
||||||
@property(nonatomic, strong) NSString *dc_webviewId; |
|
||||||
- (void)dc_setDefalutFontSize:(CGFloat)defaultFontSize; |
|
||||||
//-----------↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑---------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* Deprecated
|
|
||||||
*/ |
|
||||||
@property (nonatomic, strong) NSDictionary *properties DEPRECATED_MSG_ATTRIBUTE(); |
|
||||||
@property (nonatomic, assign) NSTimeInterval networkTime DEPRECATED_MSG_ATTRIBUTE(); |
|
||||||
@property (nonatomic, copy) void (^updateFinish)(UIView *); |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@interface WXSDKInstance (Deprecated) |
|
||||||
|
|
||||||
- (void)finishPerformance DEPRECATED_MSG_ATTRIBUTE(); |
|
||||||
- (void)reloadData:(id)data DEPRECATED_MSG_ATTRIBUTE("Use refreshInstance: method instead."); |
|
||||||
- (void)creatFinish DEPRECATED_MSG_ATTRIBUTE(); |
|
||||||
|
|
||||||
@end |
|
@ -1,62 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXSDKInstance.h" |
|
||||||
#import "WXBridgeManager.h" |
|
||||||
|
|
||||||
@class WXModuleManager; |
|
||||||
|
|
||||||
@interface WXSDKManager : NSObject |
|
||||||
|
|
||||||
/**
|
|
||||||
*@abstract Returns sdk manager |
|
||||||
*/ |
|
||||||
+ (WXSDKManager *)sharedInstance; |
|
||||||
/**
|
|
||||||
* @abstract Returns bridge manager |
|
||||||
**/ |
|
||||||
+ (WXBridgeManager *)bridgeMgr; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns weex instance for specific identifier |
|
||||||
**/ |
|
||||||
+ (WXSDKInstance *)instanceForID:(NSString *)identifier; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns weex instance for specific identifier |
|
||||||
**/ |
|
||||||
+ (void)storeInstance:(WXSDKInstance *)instance forID:(NSString *)identifier; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns weex instance for specific identifier |
|
||||||
**/ |
|
||||||
+ (void)removeInstanceforID:(NSString *)identifier; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract unload |
|
||||||
**/ |
|
||||||
+ (void)unload; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns module manager |
|
||||||
**/ |
|
||||||
+ (WXModuleManager *)moduleMgr DEPRECATED_MSG_ATTRIBUTE(); |
|
||||||
|
|
||||||
@end |
|
@ -1,38 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXScrollerProtocol.h" |
|
||||||
#import "WXComponent.h" |
|
||||||
|
|
||||||
@interface WXScrollerComponent : WXComponent <WXScrollerProtocol, UIScrollViewDelegate> |
|
||||||
|
|
||||||
@property (nonatomic, copy) void (^onScroll)(UIScrollView *scrollView); |
|
||||||
|
|
||||||
@property (nonatomic, copy) void (^scrollEventListener)(WXScrollerComponent* sender, NSString* event, NSDictionary* params); |
|
||||||
|
|
||||||
@property (nonatomic, assign) NSUInteger loadmoreretry; |
|
||||||
|
|
||||||
@property (nonatomic, assign) CGSize contentSize; |
|
||||||
|
|
||||||
- (void)handleAppear; |
|
||||||
|
|
||||||
- (CGPoint)absolutePositionForComponent:(WXComponent *)component; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
@ -1,85 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXType.h" |
|
||||||
|
|
||||||
@class WXComponent; |
|
||||||
@protocol WXScrollerProtocol <NSObject> |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract add sticky component |
|
||||||
*/ |
|
||||||
- (void)addStickyComponent:(WXComponent *)sticky; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract remove sticky component |
|
||||||
*/ |
|
||||||
- (void)removeStickyComponent:(WXComponent *)sticky; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract adjust sticky components |
|
||||||
*/ |
|
||||||
- (void)adjustSticky; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract add scroll listener |
|
||||||
*/ |
|
||||||
- (void)addScrollToListener:(WXComponent *)target; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract remove scroll listener |
|
||||||
*/ |
|
||||||
- (void)removeScrollToListener:(WXComponent *)target; |
|
||||||
|
|
||||||
- (void)scrollToComponent:(WXComponent *)component withOffset:(CGFloat)offset animated:(BOOL)animated; |
|
||||||
|
|
||||||
- (BOOL)isNeedLoadMore; |
|
||||||
|
|
||||||
- (void)loadMore; |
|
||||||
|
|
||||||
- (CGPoint)contentOffset; |
|
||||||
|
|
||||||
- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated; |
|
||||||
|
|
||||||
- (CGSize)contentSize; |
|
||||||
|
|
||||||
- (void)setContentSize:(CGSize)size; |
|
||||||
|
|
||||||
- (UIEdgeInsets)contentInset; |
|
||||||
|
|
||||||
- (void)setContentInset:(UIEdgeInsets)contentInset; |
|
||||||
|
|
||||||
- (void)resetLoadmore; |
|
||||||
|
|
||||||
- (void)addScrollDelegate:(id<UIScrollViewDelegate>)delegate; |
|
||||||
- (void)removeScrollDelegate:(id<UIScrollViewDelegate>)delegate; |
|
||||||
|
|
||||||
- (WXScrollDirection)scrollDirection; |
|
||||||
|
|
||||||
@optional |
|
||||||
|
|
||||||
- (NSString*)refreshType; |
|
||||||
- (BOOL)requestGestureShouldStopPropagation:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch; |
|
||||||
/**
|
|
||||||
* @abstract adjust for RTL |
|
||||||
*/ |
|
||||||
- (void)adjustForRTL; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
@ -1,156 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXSDKInstance.h" |
|
||||||
|
|
||||||
#define WXTNetworkHanding @"loadJS" |
|
||||||
#define WXTExecJS @"execJS" |
|
||||||
#define WXTJSCall @"jsCall" |
|
||||||
#define WXTDomCall @"domCall" |
|
||||||
#define WXTRender @"render" |
|
||||||
#define WXTRenderFinish @"renderFinish" |
|
||||||
|
|
||||||
#define WXTJSBridgeThread @"JSThread" |
|
||||||
#define WXTDOMThread @"DOMThread" |
|
||||||
#define WXTUIThread @"UIThread" |
|
||||||
#define WXTMainThread @"MainThread" |
|
||||||
|
|
||||||
#define WXTracingBegin @"B" |
|
||||||
#define WXTracingEnd @"E" |
|
||||||
#define WXTracingDuration @"D" |
|
||||||
#define WXTracingInstant @"i" |
|
||||||
|
|
||||||
#define WXTracingDurationDefault 0 |
|
||||||
|
|
||||||
typedef enum : NSUInteger { |
|
||||||
// global
|
|
||||||
WXTracingNetworkHanding = 0, |
|
||||||
WXTracingDataHanding, |
|
||||||
WXTracingRender |
|
||||||
} WXTracingTag; |
|
||||||
|
|
||||||
|
|
||||||
@interface WXTracingApi:NSObject |
|
||||||
|
|
||||||
@property (nonatomic, copy) NSString *name; //
|
|
||||||
@property (nonatomic, copy) NSString *className; //
|
|
||||||
@property (nonatomic, copy) NSString *method; //
|
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@interface WXTracing:NSObject |
|
||||||
|
|
||||||
@property (nonatomic, copy) NSString *ref; // compnonet id
|
|
||||||
@property (nonatomic, copy) NSString *parentRef; // compnonet id
|
|
||||||
@property (nonatomic, copy) NSString *className; // compnonet class name or module class name
|
|
||||||
@property (nonatomic, copy) NSString *name; // register name
|
|
||||||
@property (nonatomic, copy) NSString *ph; // phase
|
|
||||||
@property (nonatomic) NSTimeInterval ts; // time
|
|
||||||
@property (nonatomic) long long traceId; |
|
||||||
@property (nonatomic) NSTimeInterval duration; |
|
||||||
@property (nonatomic, copy) NSString *fName; // functionName
|
|
||||||
@property (nonatomic, copy) NSString *iid; // instance id
|
|
||||||
@property (nonatomic) long long parentId;// parent event id
|
|
||||||
@property (nonatomic, copy) NSString *bundleUrl; |
|
||||||
@property (nonatomic, copy) NSString *threadName; |
|
||||||
@property (nonatomic, strong) NSMutableArray *childrenRefs; // children ids
|
|
||||||
-(NSDictionary *)dictionary; |
|
||||||
@end |
|
||||||
|
|
||||||
@interface WXTracingTask:NSObject |
|
||||||
|
|
||||||
@property (nonatomic, copy) NSString *iid; |
|
||||||
@property (nonatomic) long long counter; |
|
||||||
@property (nonatomic, copy) NSString *tag; |
|
||||||
@property (nonatomic, copy) NSString *bundleUrl; |
|
||||||
@property (nonatomic, strong) NSMutableArray *tracings; |
|
||||||
@property (nonatomic, copy) NSString *bundleJSType; //
|
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@interface WXTracingManager : NSObject |
|
||||||
|
|
||||||
/**
|
|
||||||
* @discusstion weex perfermance tracing state |
|
||||||
* @return isTracing , NO in the release environment. |
|
||||||
*/ |
|
||||||
+(BOOL)isTracing; |
|
||||||
/**
|
|
||||||
* @discusstion set weex perfermance tracing state , you should use in debug environment |
|
||||||
* @param isTracing YES weex will be traced, NO weex will not be traced . |
|
||||||
*/ |
|
||||||
+(void)switchTracing:(BOOL)isTracing; |
|
||||||
/**
|
|
||||||
* @discusstion weex perfermance tracing state |
|
||||||
* @param iid the instance id. |
|
||||||
* @param ref the component ref |
|
||||||
* @param className the module or component class name |
|
||||||
* @param name the module or component name |
|
||||||
* @param phase the trace phase |
|
||||||
* @param functionName function name |
|
||||||
* @param options the optional refer:support ts,duration,parentRef |
|
||||||
*/ |
|
||||||
+(void)startTracingWithInstanceId:(NSString *)iid ref:(NSString*)ref className:(NSString *)className name:(NSString *)name phase:(NSString *)phase functionName:(NSString *)functionName options:(NSDictionary *)options; |
|
||||||
/**
|
|
||||||
* @discusstion fetch tracing data |
|
||||||
* @return the tracing data |
|
||||||
*/ |
|
||||||
+(NSMutableDictionary*)getTracingData; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @discusstion clear tracing data |
|
||||||
*/ |
|
||||||
+(void)clearTracingData; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @discusstion get current time |
|
||||||
*/ |
|
||||||
+(NSTimeInterval)getCurrentTime; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @discusstion set bundle type |
|
||||||
* @param jsBundleString the bundle source. |
|
||||||
* @param iid the instance id. |
|
||||||
*/ |
|
||||||
+(void)setBundleJSType:(NSString *)jsBundleString instanceId:(NSString *)iid; |
|
||||||
/**
|
|
||||||
* @discusstion fetch the weex moudle component handler info |
|
||||||
* @return the weex moudle component handler info |
|
||||||
*/ |
|
||||||
+(NSDictionary *)getTacingApi; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @discusstion commit tracing info |
|
||||||
* @param instanceId the instance id. |
|
||||||
*/ |
|
||||||
+(void )commitTracing:(NSString *)instanceId; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @discusstion commit summary info |
|
||||||
* @param instanceId the instance id. |
|
||||||
*/ |
|
||||||
+ (void)commitTracingSummaryInfo:(NSDictionary *)info withInstanceId:(NSString *)instanceId; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @discusstion destroy Traincg Task by Instance |
|
||||||
* @param instanceId the instanceId. |
|
||||||
*/ |
|
||||||
+(void)destroyTraincgTaskWithInstance:(NSString *)instanceId; |
|
||||||
@end |
|
@ -1,29 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import "WXTracingProtocol.h" |
|
||||||
#import "WXTracingManager.h" |
|
||||||
|
|
||||||
@protocol WXTracingProtocol <NSObject> |
|
||||||
|
|
||||||
- (void)commitTracingInfo:(WXTracingTask *)task; |
|
||||||
|
|
||||||
- (void)commitTracingSummaryInfo:(NSDictionary *)info; |
|
||||||
|
|
||||||
@end |
|
@ -1,90 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, WXLayoutDirection) { |
|
||||||
WXLayoutDirectionLTR, |
|
||||||
WXLayoutDirectionRTL, |
|
||||||
WXLayoutDirectionAuto, |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, WXComponentType) { |
|
||||||
WXComponentTypeCommon = 0, |
|
||||||
WXComponentTypeVirtual |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, WXScrollDirection) { |
|
||||||
WXScrollDirectionVertical, |
|
||||||
WXScrollDirectionHorizontal, |
|
||||||
WXScrollDirectionNone, |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, WXTextStyle) { |
|
||||||
WXTextStyleNormal = 0, |
|
||||||
WXTextStyleItalic |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, WXTextDecoration) { |
|
||||||
WXTextDecorationNone = 0, |
|
||||||
WXTextDecorationUnderline, |
|
||||||
WXTextDecorationLineThrough |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, WXImageQuality) { |
|
||||||
WXImageQualityOriginal = -1, |
|
||||||
WXImageQualityLow = 0, |
|
||||||
WXImageQualityNormal, |
|
||||||
WXImageQualityHigh, |
|
||||||
WXImageQualityNone, |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, WXImageSharp) { |
|
||||||
WXImageSharpeningNone = 0, |
|
||||||
WXImageSharpening |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, WXVisibility) { |
|
||||||
WXVisibilityShow = 0, |
|
||||||
WXVisibilityHidden |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, WXBorderStyle) { |
|
||||||
WXBorderStyleNone = 0, |
|
||||||
WXBorderStyleDotted, |
|
||||||
WXBorderStyleDashed, |
|
||||||
WXBorderStyleSolid |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, WXPositionType) { |
|
||||||
WXPositionTypeRelative = 0, |
|
||||||
WXPositionTypeAbsolute, |
|
||||||
WXPositionTypeSticky, |
|
||||||
WXPositionTypeFixed |
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, WXGradientType) { |
|
||||||
WXGradientTypeToTop = 0, |
|
||||||
WXGradientTypeToBottom, |
|
||||||
WXGradientTypeToLeft, |
|
||||||
WXGradientTypeToRight, |
|
||||||
WXGradientTypeToTopleft, |
|
||||||
WXGradientTypeToBottomright, |
|
||||||
}; |
|
@ -1,49 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXResourceRequest.h" |
|
||||||
|
|
||||||
@class WXSDKInstance; |
|
||||||
|
|
||||||
#define WX_REWRITE_URL(url, resourceType, instance)\ |
|
||||||
do {\
|
|
||||||
id<WXURLRewriteProtocol> rewriteHandler = [WXSDKEngine handlerForProtocol:@protocol(WXURLRewriteProtocol)];\
|
|
||||||
if ([rewriteHandler respondsToSelector:@selector(rewriteURL:withResourceType:withInstance:)]) {\
|
|
||||||
newURL = [[rewriteHandler rewriteURL:url withResourceType:resourceType withInstance:instance].absoluteString copy];\
|
|
||||||
}\
|
|
||||||
} while(0); |
|
||||||
|
|
||||||
|
|
||||||
@protocol WXURLRewriteProtocol <NSObject> |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract rewrite and complete URL |
|
||||||
* |
|
||||||
* @param url The original URL to be rewritten |
|
||||||
* |
|
||||||
* @param resourceType resource type which the url is sent for |
|
||||||
* |
|
||||||
* @param instance related instance |
|
||||||
* |
|
||||||
* @return a new url |
|
||||||
*/ |
|
||||||
- (NSURL *)rewriteURL:(NSString *)url withResourceType:(WXResourceType)resourceType withInstance:(WXSDKInstance *)instance; |
|
||||||
|
|
||||||
@end |
|
@ -1,501 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
#import "WXDefine.h" |
|
||||||
#import "WXType.h" |
|
||||||
#import "WXSDKInstance.h" |
|
||||||
|
|
||||||
// The default screen width which helps us to calculate the real size or scale in different devices.
|
|
||||||
static const CGFloat WXDefaultScreenWidth = 750.0; |
|
||||||
|
|
||||||
#define WX_ENUMBER_CASE(_invoke, idx, code, obj, _type, op, _flist) \ |
|
||||||
case code:{\
|
|
||||||
_type *_tmp = malloc(sizeof(_type));\
|
|
||||||
memset(_tmp, 0, sizeof(_type));\
|
|
||||||
*_tmp = [obj op];\
|
|
||||||
[_invoke setArgument:_tmp atIndex:(idx) + 2];\
|
|
||||||
*(_flist + idx) = _tmp;\
|
|
||||||
break;\
|
|
||||||
} |
|
||||||
#define WX_EPCHAR_CASE(_invoke, idx, code, obj, _type, op, _flist) \ |
|
||||||
case code:{\
|
|
||||||
_type *_tmp = (_type *)[obj op];\
|
|
||||||
[_invoke setArgument:&_tmp atIndex:(idx) + 2];\
|
|
||||||
*(_flist + idx) = 0;\
|
|
||||||
break;\
|
|
||||||
}\
|
|
||||||
|
|
||||||
#define WX_ALLOC_FLIST(_ppFree, _count) \ |
|
||||||
do {\
|
|
||||||
_ppFree = (void *)malloc(sizeof(void *) * (_count));\
|
|
||||||
memset(_ppFree, 0, sizeof(void *) * (_count));\
|
|
||||||
} while(0) |
|
||||||
|
|
||||||
#define WX_FREE_FLIST(_ppFree, _count) \ |
|
||||||
do {\
|
|
||||||
for(int i = 0; i < _count; i++){\
|
|
||||||
if(*(_ppFree + i ) != 0) {\
|
|
||||||
free(*(_ppFree + i));\
|
|
||||||
}\
|
|
||||||
}\
|
|
||||||
free(_ppFree);\
|
|
||||||
}while(0) |
|
||||||
|
|
||||||
#define WX_ARGUMENTS_SET(_invocation, _sig, idx, _obj, _ppFree) \ |
|
||||||
do {\
|
|
||||||
const char *encode = [_sig getArgumentTypeAtIndex:(idx) + 2];\
|
|
||||||
switch(encode[0]){\
|
|
||||||
WX_EPCHAR_CASE(_invocation, idx, _C_CHARPTR, _obj, char *, UTF8String, _ppFree)\
|
|
||||||
WX_ENUMBER_CASE(_invocation, idx, _C_INT, _obj, int, intValue, _ppFree)\
|
|
||||||
WX_ENUMBER_CASE(_invocation, idx, _C_SHT, _obj, short, shortValue, _ppFree)\
|
|
||||||
WX_ENUMBER_CASE(_invocation, idx, _C_LNG, _obj, long, longValue, _ppFree)\
|
|
||||||
WX_ENUMBER_CASE(_invocation, idx, _C_LNG_LNG, _obj, long long, longLongValue, _ppFree)\
|
|
||||||
WX_ENUMBER_CASE(_invocation, idx, _C_UCHR, _obj, unsigned char, unsignedCharValue, _ppFree)\
|
|
||||||
WX_ENUMBER_CASE(_invocation, idx, _C_UINT, _obj, unsigned int, unsignedIntValue, _ppFree)\
|
|
||||||
WX_ENUMBER_CASE(_invocation, idx, _C_USHT, _obj, unsigned short, unsignedShortValue, _ppFree)\
|
|
||||||
WX_ENUMBER_CASE(_invocation, idx, _C_ULNG, _obj, unsigned long, unsignedLongValue, _ppFree)\
|
|
||||||
WX_ENUMBER_CASE(_invocation, idx, _C_ULNG_LNG, _obj,unsigned long long, unsignedLongLongValue, _ppFree)\
|
|
||||||
WX_ENUMBER_CASE(_invocation, idx, _C_FLT, _obj, float, floatValue, _ppFree)\
|
|
||||||
WX_ENUMBER_CASE(_invocation, idx, _C_DBL, _obj, double, doubleValue, _ppFree)\
|
|
||||||
WX_ENUMBER_CASE(_invocation, idx, _C_BOOL, _obj, bool, boolValue, _ppFree)\
|
|
||||||
default: { [_invocation setArgument:&_obj atIndex:(idx) + 2]; *(_ppFree + idx) = 0; break;}\
|
|
||||||
}\
|
|
||||||
}while(0) |
|
||||||
|
|
||||||
#ifdef __cplusplus |
|
||||||
extern "C" { |
|
||||||
#endif |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract execute asynchronous action block on the main thread. |
|
||||||
* |
|
||||||
*/ |
|
||||||
void WXPerformBlockOnMainThread( void (^ _Nonnull block)(void)); |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract execute synchronous action block on the main thread. |
|
||||||
* |
|
||||||
*/ |
|
||||||
void WXPerformBlockSyncOnMainThread( void (^ _Nonnull block)(void)); |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract execute action block on the specific thread. |
|
||||||
* |
|
||||||
*/ |
|
||||||
void WXPerformBlockOnThread(void (^ _Nonnull block)(void), NSThread *_Nonnull thread); |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract swizzling methods. |
|
||||||
* |
|
||||||
*/ |
|
||||||
void WXSwizzleInstanceMethod(_Nonnull Class className, _Nonnull SEL original, _Nonnull SEL replaced); |
|
||||||
|
|
||||||
void WXSwizzleInstanceMethodWithBlock(_Nonnull Class className, _Nonnull SEL original, _Nonnull id block, _Nonnull SEL replaced); |
|
||||||
|
|
||||||
_Nonnull SEL WXSwizzledSelectorForSelector(_Nonnull SEL selector); |
|
||||||
|
|
||||||
#ifdef __cplusplus |
|
||||||
} |
|
||||||
#endif |
|
||||||
|
|
||||||
@interface WXUtility : NSObject |
|
||||||
|
|
||||||
+ (void)performBlock:(void (^_Nonnull)(void))block onThread:(NSThread *_Nonnull)thread; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns the environment of current application, you can get some necessary properties such as appVersion、sdkVersion、appName etc. |
|
||||||
* |
|
||||||
* @return A dictionary object which contains these properties. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSDictionary *_Nonnull)getEnvironment; |
|
||||||
|
|
||||||
+ (NSDictionary *_Nonnull)getDebugEnvironment; |
|
||||||
|
|
||||||
+ (WXLayoutDirection)getEnvLayoutDirection; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract UserAgent Generation |
|
||||||
* |
|
||||||
* @return A ua string by splicing (deviceName、appVersion、sdkVersion、externalField、screenSize) |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSString *_Nonnull)userAgent; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract JSON Decode Method |
|
||||||
* |
|
||||||
* @param json String. |
|
||||||
* |
|
||||||
* @return A json object by decoding json string. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (id _Nullable)objectFromJSON:(NSString * _Nonnull)json; |
|
||||||
|
|
||||||
#define WXDecodeJson(json) [WXUtility objectFromJSON:json] |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract JSON Encode Method |
|
||||||
* |
|
||||||
* @param object Object. |
|
||||||
* |
|
||||||
* @return A json string by encoding json object. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSString * _Nullable)JSONString:(id _Nonnull)object; |
|
||||||
|
|
||||||
#define WXEncodeJson(obj) [WXUtility JSONString:obj] |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns a Foundation object from given JSON data. A Foundation object from the JSON data in data, or nil if an error occurs. |
|
||||||
* |
|
||||||
* @param data A data object containing JSON data. |
|
||||||
* @param error If an error occurs, upon return contains an NSError object that describes the problem. |
|
||||||
* |
|
||||||
* @return A Foundation object from the JSON data in data, or nil if an error occurs. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (id _Nullable)JSONObject:(NSData * _Nonnull)data error:(NSError * __nullable * __nullable)error; |
|
||||||
|
|
||||||
#define WXJSONObjectFromData(data) [WXUtility JSONObject:data error:nil] |
|
||||||
/**
|
|
||||||
* @abstract JSON Object Copy Method |
|
||||||
* |
|
||||||
* @param object Object. |
|
||||||
* |
|
||||||
* @return A json object by copying. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (id _Nullable)copyJSONObject:(id _Nonnull)object; |
|
||||||
|
|
||||||
#define WXCopyJson(obj) [WXUtility copyJSONObject:obj] |
|
||||||
|
|
||||||
/**
|
|
||||||
* |
|
||||||
* Checks if a String is whitespace, empty ("") or nil |
|
||||||
* @code |
|
||||||
* [WXUtility isBlankString: nil] = true |
|
||||||
* [WXUtility isBlankString: ""] = true |
|
||||||
* [WXUtility isBlankString: " "] = true |
|
||||||
* [WXUtility isBlankString: "bob"] = false |
|
||||||
* [WXUtility isBlankString: " bob "] = false |
|
||||||
* @endcode |
|
||||||
* @param string the String to check, may be null |
|
||||||
* |
|
||||||
* @return true if the String is null, empty or whitespace |
|
||||||
*/ |
|
||||||
+ (BOOL)isBlankString:(NSString * _Nullable)string ; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
check a point is valid or not. A zero point is also valid |
|
||||||
|
|
||||||
@param point a point value to check |
|
||||||
@return true if point.x and point.y are all valid value for a number. |
|
||||||
*/ |
|
||||||
+ (BOOL)isValidPoint:(CGPoint)point; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns a standard error object |
|
||||||
* |
|
||||||
* @param code code. |
|
||||||
* |
|
||||||
* @param message message. |
|
||||||
* |
|
||||||
* @return A error object type of NSError. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSError * _Nonnull)errorWithCode:(NSInteger)code message:(NSString * _Nullable)message; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns a Font Object by setting some properties such as size、weight、style and fontFamily. |
|
||||||
* |
|
||||||
* @param size font size |
|
||||||
* |
|
||||||
* @param textWeight font weight |
|
||||||
* |
|
||||||
* @param textStyle The type of WXTextStyle (Normal or Italic). |
|
||||||
* |
|
||||||
* @param fontFamily font family |
|
||||||
* |
|
||||||
* @param scaleFactor please use instance's scale factor |
|
||||||
* |
|
||||||
* @return A font object according to the above params. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (UIFont *_Nonnull)fontWithSize:(CGFloat)size textWeight:(CGFloat)textWeight textStyle:(WXTextStyle)textStyle fontFamily:(NSString *_Nullable)fontFamily scaleFactor:(CGFloat)scaleFactor; |
|
||||||
|
|
||||||
+ (UIFont *_Nonnull)fontWithSize:(CGFloat)size textWeight:(CGFloat)textWeight textStyle:(WXTextStyle)textStyle fontFamily:(NSString *_Nullable)fontFamily scaleFactor:(CGFloat)scaleFactor useCoreText:(BOOL)useCoreText; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract download remote font from specified url |
|
||||||
* @param fontURL for remote font |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (void)getIconfont:(NSURL * _Nonnull)fontURL completion:( void(^ _Nullable )(NSURL * _Nonnull url, NSError * _Nullable error)) completionBlock; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns the main screen's size when the device is in portrait mode,. |
|
||||||
*/ |
|
||||||
+ (CGSize)portraitScreenSize; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns the default pixel scale factor |
|
||||||
* @discussion If orientation is equal to landscape, the value is caculated as follows: WXScreenSize().height / WXDefaultScreenWidth, otherwise, WXScreenSize().width / WXDefaultScreenWidth. |
|
||||||
*/ |
|
||||||
+ (CGFloat)defaultPixelScaleFactor; |
|
||||||
|
|
||||||
#if defined __cplusplus |
|
||||||
extern "C" { |
|
||||||
#endif |
|
||||||
/**
|
|
||||||
* @abstract Returns the scale of the main screen. |
|
||||||
* |
|
||||||
*/ |
|
||||||
CGFloat WXScreenScale(void); |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns a Round float coordinates to the main screen pixel. |
|
||||||
* |
|
||||||
*/ |
|
||||||
CGFloat WXRoundPixelValue(CGFloat value); |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns a Floor float coordinates to the main screen pixel. |
|
||||||
* |
|
||||||
*/ |
|
||||||
CGFloat WXFloorPixelValue(CGFloat value); |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns a Ceil float coordinates to the main screen pixel. |
|
||||||
* |
|
||||||
*/ |
|
||||||
CGFloat WXCeilPixelValue(CGFloat value); |
|
||||||
|
|
||||||
#if defined __cplusplus |
|
||||||
}; |
|
||||||
#endif |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract check whether the file is exist |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
+ (BOOL)isFileExist:(NSString * _Nonnull)filePath; |
|
||||||
/**
|
|
||||||
* @abstract Returns the document directory path. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSString *_Nonnull)documentDirectory; |
|
||||||
|
|
||||||
#define WXDocumentPath [WXUtility documentDirectory] |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns the system cache directory path. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSString *_Nonnull)cacheDirectory; |
|
||||||
|
|
||||||
#define WXCachePath [WXUtility cacheDirectory] |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns the system library directory path. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSString *_Nonnull)libraryDirectory; |
|
||||||
|
|
||||||
#define WXLibraryPath [WXUtility libraryDirectory] |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns the global cache whose size is 5M. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSCache *_Nonnull)globalCache; |
|
||||||
|
|
||||||
#define WXGlobalCache [WXUtility globalCache] |
|
||||||
|
|
||||||
+ (NSURL *_Nonnull)urlByDeletingParameters:(NSURL *_Nonnull)url; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns the contents of file. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSString *_Nullable)stringWithContentsOfFile:(NSString *_Nonnull)filePath; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns md5 string. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSString *_Nullable)md5:(NSString *_Nullable)string; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns Creates a Universally Unique Identifier (UUID) string. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSString *_Nullable)uuidString; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract convert date string with formatter yyyy-MM-dd to date. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSDate *_Nullable)dateStringToDate:(NSString *_Nullable)dateString; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract convert time string with formatter HH:mm to date. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSDate *_Nullable)timeStringToDate:(NSString *_Nullable)timeString; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract convert date to date string with formatter yyyy-MM-dd . |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSString *_Nullable)dateToString:(NSDate *_Nullable)date; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract convert date to time string with formatter HH:mm . |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSString *_Nullable)timeToString:(NSDate *_Nullable)date; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract get the repeat substring number of string. |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSUInteger)getSubStringNumber:(NSString *_Nullable)string subString:(NSString *_Nullable)subString; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract Returns a resized pixel which is calculated according to the WXScreenResizeRadio. |
|
||||||
* |
|
||||||
*/ |
|
||||||
CGFloat WXPixelScale(CGFloat value, CGFloat scaleFactor); |
|
||||||
|
|
||||||
CGFloat WXScreenResizeRadio(void) DEPRECATED_MSG_ATTRIBUTE("Use [WXUtility defaultPixelScaleFactor] instead"); |
|
||||||
CGFloat WXPixelResize(CGFloat value) DEPRECATED_MSG_ATTRIBUTE("Use WXPixelScale Instead"); |
|
||||||
CGRect WXPixelFrameResize(CGRect value) DEPRECATED_MSG_ATTRIBUTE("Use WXPixelScale Instead"); |
|
||||||
CGPoint WXPixelPointResize(CGPoint value) DEPRECATED_MSG_ATTRIBUTE("Use WXPixelScale Instead"); |
|
||||||
+ (UIFont * _Nullable )fontWithSize:(CGFloat)size textWeight:(CGFloat)textWeight textStyle:(WXTextStyle)textStyle fontFamily:(NSString * _Nullable)fontFamily DEPRECATED_MSG_ATTRIBUTE("Use +[WXUtility fontWithSize:textWeight:textStyle:fontFamily:scaleFactor:]"); |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@discusstion construct a gradientLayer from the colors locations, gradientType |
|
||||||
@param colors The array of UIColor objects defining the color of each gradient |
|
||||||
stop. Defaults to nil |
|
||||||
@param locations An optional array of NSNumber objects defining the location of each |
|
||||||
gradient stop as a value in the range [0,1]. |
|
||||||
@param frame the layer frame |
|
||||||
@param gradientType WXGradientType value specify the gradient location |
|
||||||
@return gradient layer |
|
||||||
*/ |
|
||||||
+ (CAGradientLayer *_Nullable)gradientLayerFromColors:(NSArray*_Nullable)colors |
|
||||||
locations:(NSArray*_Nullable)locations |
|
||||||
frame:(CGRect)frame |
|
||||||
gradientType:(WXGradientType)gradientType; |
|
||||||
|
|
||||||
/**
|
|
||||||
@discusstion parse gradient-color string to a dictionary, then you can get gradientLayer from @see gradientLayerFromColors:colors:locations:frame:locations |
|
||||||
@param backgroundImage linear-gradient string like linear-gradient(to right, #a80077,rgba(200, 54, 54, 0.5)) |
|
||||||
@return dictionary with endColor, startColor and gradientType value |
|
||||||
@code |
|
||||||
NSDictionary * linearGradient = [self linearGradientWithBackgroundImage:@"linear-gradient(to right, #a80077,rgba(200, 54, 54, 0.5))"]; |
|
||||||
CAGradientLayer * gradientLayer = [self gradientLayerFromColors:@[linearGradient[@"startColor"], linearGradient[@"endColor"]],nil,bounds,[linearGradient[@"gradientType"] integerValue]]; |
|
||||||
@endcode |
|
||||||
*/ |
|
||||||
+ (NSDictionary *_Nullable)linearGradientWithBackgroundImage:(NSString *_Nullable)backgroundImage; |
|
||||||
|
|
||||||
#if defined __cplusplus |
|
||||||
extern "C" { |
|
||||||
#endif |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract compare float a and b, if a equal b, return true,or reture false. |
|
||||||
* |
|
||||||
*/ |
|
||||||
BOOL WXFloatEqual(CGFloat a, CGFloat b); |
|
||||||
/**
|
|
||||||
* @abstract compare float a and b, user give the compare precision, if a equal b, return true,or reture false. |
|
||||||
* |
|
||||||
*/ |
|
||||||
BOOL WXFloatEqualWithPrecision(CGFloat a, CGFloat b ,double precision); |
|
||||||
/**
|
|
||||||
* @abstract compare float a and b, if a less than b, return true,or reture false. |
|
||||||
* |
|
||||||
*/ |
|
||||||
BOOL WXFloatLessThan(CGFloat a, CGFloat b); |
|
||||||
/**
|
|
||||||
* @abstract compare float a and b,user give the compare precision, if a less than b,return true,or reture false. |
|
||||||
* |
|
||||||
*/ |
|
||||||
BOOL WXFloatLessThanWithPrecision(CGFloat a, CGFloat b,double precision); |
|
||||||
/**
|
|
||||||
* @abstract compare float a and b, if a great than b, return true,or reture false. |
|
||||||
* |
|
||||||
*/ |
|
||||||
BOOL WXFloatGreaterThan(CGFloat a, CGFloat b); |
|
||||||
/**
|
|
||||||
* @abstract compare float a and b, user give the compare precision,if a great than b, return true,or reture false. |
|
||||||
* |
|
||||||
*/ |
|
||||||
BOOL WXFloatGreaterThanWithPrecision(CGFloat a,CGFloat b,double precision); |
|
||||||
|
|
||||||
#if defined __cplusplus |
|
||||||
}; |
|
||||||
#endif |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract convert returnKeyType to type string . |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSString *_Nullable)returnKeyType:(UIReturnKeyType)type; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract custorm monitor info |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (void)customMonitorInfo:(WXSDKInstance *_Nullable)instance key:(NSString * _Nonnull)key value:(id _Nonnull)value; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract format to base64 dictionary |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSDictionary *_Nonnull)dataToBase64Dict:(NSData *_Nullable)data; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @abstract format to data |
|
||||||
* |
|
||||||
*/ |
|
||||||
+ (NSData *_Nonnull)base64DictToData:(NSDictionary *_Nullable)base64Dict; |
|
||||||
|
|
||||||
+ (void)setUnregisterFontWhenCollision:(BOOL)value; |
|
||||||
|
|
||||||
+ (void)setUseJSCApiForCreateInstance:(BOOL)value; |
|
||||||
|
|
||||||
+ (BOOL)useJSCApiForCreateInstance; |
|
||||||
|
|
||||||
+ (void)setEnableRTLLayoutDirection:(BOOL)value; |
|
||||||
|
|
||||||
+ (BOOL)enableRTLLayoutDirection; |
|
||||||
|
|
||||||
+ (long) getUnixFixTimeMillis; |
|
||||||
|
|
||||||
+ (NSArray<NSString *> *_Nullable)extractPropertyNamesOfJSValueObject:(JSValue *_Nullable)jsvalue; |
|
||||||
|
|
||||||
@end |
|
@ -1,50 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXSDKInstance.h" |
|
||||||
|
|
||||||
|
|
||||||
@interface WXValidateResult : NSObject |
|
||||||
|
|
||||||
@property(nonatomic,assign)BOOL isSuccess; |
|
||||||
@property(nonatomic,strong)NSError* error; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@interface WXModuleValidateResult : WXValidateResult |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
@interface WXComponentValidateResult :WXValidateResult |
|
||||||
|
|
||||||
@property(nonatomic,copy)NSString* replacedComponent; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
|
|
||||||
@protocol WXValidateProtocol <NSObject> |
|
||||||
|
|
||||||
-(BOOL)needValidate:(NSURL*) bundleUrl; |
|
||||||
|
|
||||||
-(WXModuleValidateResult *)validateWithWXSDKInstance:(WXSDKInstance *)wxsdkInstance module:(NSString*) moduel method:(NSString *)method args:(NSArray *)args options:(NSDictionary *)options; |
|
||||||
|
|
||||||
-(WXComponentValidateResult *)validateWithWXSDKInstance:(WXSDKInstance *)wxsdkInstance component:(NSString *)componentName supercomponent:(WXComponent *)supercomponent; |
|
||||||
|
|
||||||
@end |
|
@ -1,24 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
|
|
||||||
@interface WXView : UIView |
|
||||||
|
|
||||||
@end |
|
@ -1,25 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXModuleProtocol.h" |
|
||||||
|
|
||||||
@interface WXVoiceOverModule : NSObject<WXModuleProtocol> |
|
||||||
|
|
||||||
@end |
|
@ -1,37 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "WXModuleProtocol.h" |
|
||||||
|
|
||||||
@protocol WXWebSocketDelegate<NSObject> |
|
||||||
- (void)didOpen; |
|
||||||
- (void)didFailWithError:(NSError *)error; |
|
||||||
- (void)didReceiveMessage:(id)message; |
|
||||||
- (void)didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean; |
|
||||||
@end |
|
||||||
|
|
||||||
@protocol WXWebSocketHandler<NSObject> |
|
||||||
|
|
||||||
- (void)open:(NSString *)url protocol:(NSString *)protocol identifier:(NSString *)identifier withDelegate:(id<WXWebSocketDelegate>)delegate; |
|
||||||
- (void)send:(NSString *)identifier data:(NSString *)data; |
|
||||||
- (void)close:(NSString *)identifier; |
|
||||||
- (void)close:(NSString *)identifier code:(NSInteger)code reason:(NSString *)reason; |
|
||||||
- (void)clear:(NSString *)identifier; |
|
||||||
@end |
|
@ -1,36 +0,0 @@ |
|||||||
//
|
|
||||||
// WeexProtocol.h
|
|
||||||
// libPDRCore
|
|
||||||
//
|
|
||||||
// Created by DCloud on 2018/6/7.
|
|
||||||
// Copyright © 2018年 DCloud. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
extern NSString* kWeexImportClassName; |
|
||||||
#import "WXSDKInstance.h" |
|
||||||
#import "WXSDKManager.h" |
|
||||||
#import "WXDefine.h" |
|
||||||
|
|
||||||
@class WXRootView; |
|
||||||
|
|
||||||
extern NSString* const kWeexOptionsRenderKey; |
|
||||||
extern NSString* const kWeexOptionsFrameworkKey; |
|
||||||
|
|
||||||
@protocol WeexProtocol <NSObject> |
|
||||||
- (void)initWeexWithOptions:(NSDictionary*)options; |
|
||||||
- (NSDictionary *)getWeexOptions; |
|
||||||
- (void)destoryWeex; |
|
||||||
- (id)newWXSDKInstance; |
|
||||||
- (NSString*)getweexExposedModuleJs; |
|
||||||
- (WXRootView*)weexInstanceRootView:(CGRect)frame; |
|
||||||
- (WXBridgeManager*)bridgeMgr; |
|
||||||
- (void)restart; |
|
||||||
- (void)restartWithOptions:(NSDictionary*)options; |
|
||||||
- (void)refreshDefaultFlexDirection; |
|
||||||
- (BOOL)weexDebugMode; |
|
||||||
- (void)evaljs:(NSString*)js inSDKInstance:(NSString*)instance; |
|
||||||
- (void)postWeexMessageWithPayload:(NSDictionary*)payload inWeexInstance:(NSString*)instanceId; |
|
||||||
- (id)callNativeModulSyncWithPayload:(NSDictionary*)payload inWeexInstance:(NSString*)instanceId; |
|
||||||
@end |
|
@ -1,85 +0,0 @@ |
|||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#ifdef __OBJC__ |
|
||||||
|
|
||||||
#import "style.h" |
|
||||||
#import "layout.h" |
|
||||||
#import "flex_enum.h" |
|
||||||
#import "WXWebSocketHandler.h" |
|
||||||
#import "WXVoiceOverModule.h" |
|
||||||
#import "WXView.h" |
|
||||||
#import "WXValidateProtocol.h" |
|
||||||
#import "WXUtility.h" |
|
||||||
#import "WXURLRewriteProtocol.h" |
|
||||||
#import "WXType.h" |
|
||||||
#import "WXTracingProtocol.h" |
|
||||||
#import "WXTracingManager.h" |
|
||||||
#import "WXScrollerProtocol.h" |
|
||||||
#import "WXScrollerComponent.h" |
|
||||||
#import "WXSDKManager.h" |
|
||||||
#import "WXSDKInstance.h" |
|
||||||
#import "WXSDKError.h" |
|
||||||
#import "WXSDKEngine.h" |
|
||||||
#import "WXRootViewController.h" |
|
||||||
#import "WXRichText.h" |
|
||||||
#import "WXResourceResponse.h" |
|
||||||
#import "WXResourceRequestHandler.h" |
|
||||||
#import "WXResourceRequest.h" |
|
||||||
#import "WXResourceLoader.h" |
|
||||||
#import "WXRecyclerComponent.h" |
|
||||||
#import "WXPrerenderManager.h" |
|
||||||
#import "WXPageEventNotifyEvent.h" |
|
||||||
#import "WXNetworkProtocol.h" |
|
||||||
#import "WXNavigationProtocol.h" |
|
||||||
#import "WXMonitor.h" |
|
||||||
#import "WXModuleProtocol.h" |
|
||||||
#import "WXModalUIModule.h" |
|
||||||
#import "WXListComponent.h" |
|
||||||
#import "WXJSFrameworkLoadProtocol.h" |
|
||||||
#import "WXJSExceptionProtocol.h" |
|
||||||
#import "WXJSExceptionInfo.h" |
|
||||||
#import "WXIndicatorComponent.h" |
|
||||||
#import "WXImgLoaderProtocol.h" |
|
||||||
#import "WXExtendCallNativeProtocol.h" |
|
||||||
#import "WXExceptionUtils.h" |
|
||||||
#import "WXEventModuleProtocol.h" |
|
||||||
#import "WXErrorView.h" |
|
||||||
#import "WXDisplayLinkManager.h" |
|
||||||
#import "WXDefine.h" |
|
||||||
#import "WXDebugTool.h" |
|
||||||
#import "WXConvert.h" |
|
||||||
#import "WXConfigCenterProtocol.h" |
|
||||||
#import "WXComponentManager.h" |
|
||||||
#import "WXComponent.h" |
|
||||||
#import "WXComponent+Layout.h" |
|
||||||
#import "WXBridgeProtocol.h" |
|
||||||
#import "WXBridgeManager.h" |
|
||||||
#import "WXBaseViewController.h" |
|
||||||
#import "WXAppMonitorProtocol.h" |
|
||||||
#import "WXAppConfiguration.h" |
|
||||||
#import "WXApmProtocol.h" |
|
||||||
#import "WXApmForInstance.h" |
|
||||||
#import "WXAnalyzerProtocol.h" |
|
||||||
#import "WXAnalyzerCenter.h" |
|
||||||
#import "WXAComponent.h" |
|
||||||
#import "NSObject+WXSwizzle.h" |
|
||||||
#import "JSContext+Weex.h" |
|
||||||
|
|
||||||
#endif /* __OBJC__ */ |
|
@ -1,139 +0,0 @@ |
|||||||
/**
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
#ifndef WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUM_H |
|
||||||
#define WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUM_H |
|
||||||
|
|
||||||
#define WEEXCORE_CSS_DEFAULT_DIRECTION kDirectionLTR |
|
||||||
|
|
||||||
/* These enum definitions may also be used by C files. */ |
|
||||||
#ifdef __cplusplus |
|
||||||
namespace WeexCore { |
|
||||||
#endif |
|
||||||
|
|
||||||
/**
|
|
||||||
* MainAxis direction |
|
||||||
*/ |
|
||||||
enum WXCoreDirection { |
|
||||||
kDirectionInherit, |
|
||||||
kDirectionLTR, |
|
||||||
kDirectionRTL |
|
||||||
}; |
|
||||||
/**
|
|
||||||
* MainAxis direction |
|
||||||
*/ |
|
||||||
enum WXCoreFlexDirection { |
|
||||||
kFlexDirectionColumn, |
|
||||||
kFlexDirectionColumnReverse, |
|
||||||
kFlexDirectionRow, |
|
||||||
kFlexDirectionRowReverse, |
|
||||||
}; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Controls the position of the element on the MainAxis |
|
||||||
*/ |
|
||||||
enum WXCoreJustifyContent { |
|
||||||
kJustifyFlexStart, |
|
||||||
kJustifyCenter, |
|
||||||
kJustifyFlexEnd, |
|
||||||
kJustifySpaceBetween, |
|
||||||
kJustifySpaceAround, |
|
||||||
}; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Controls the position of the element on the CrossAxis and whether Stretch |
|
||||||
*/ |
|
||||||
enum WXCoreAlignItems { |
|
||||||
kAlignItemsFlexStart, |
|
||||||
kAlignItemsCenter, |
|
||||||
kAlignItemsFlexEnd, |
|
||||||
kAlignItemsStretch, |
|
||||||
}; |
|
||||||
|
|
||||||
/**
|
|
||||||
* Controls the count of flexlines |
|
||||||
*/ |
|
||||||
enum WXCoreFlexWrap { |
|
||||||
kNoWrap, |
|
||||||
kWrap, |
|
||||||
kWrapReverse, |
|
||||||
}; |
|
||||||
|
|
||||||
/**
|
|
||||||
* The align-self will overrides the align-items specified by the Flex container. |
|
||||||
* The two attributes have the same range of values. |
|
||||||
*/ |
|
||||||
enum WXCoreAlignSelf { |
|
||||||
kAlignSelfAuto = -1, |
|
||||||
kAlignSelfFlexStart = kAlignItemsFlexStart, |
|
||||||
kAlignSelfCenter = kAlignItemsCenter, |
|
||||||
kAlignSelfFlexEnd = kAlignItemsFlexEnd, |
|
||||||
kAlignSelfStretch = kAlignItemsStretch, |
|
||||||
}; |
|
||||||
|
|
||||||
enum WXCorePositionType { |
|
||||||
kRelative, |
|
||||||
kAbsolute, |
|
||||||
kFixed, |
|
||||||
kSticky = kRelative |
|
||||||
}; |
|
||||||
|
|
||||||
enum WXCorePositionEdge { |
|
||||||
kPositionEdgeTop, |
|
||||||
kPositionEdgeBottom, |
|
||||||
kPositionEdgeLeft, |
|
||||||
kPositionEdgeRight, |
|
||||||
}; |
|
||||||
|
|
||||||
enum WXCoreMarginEdge { |
|
||||||
kMarginALL, |
|
||||||
kMarginTop, |
|
||||||
kMarginBottom, |
|
||||||
kMarginLeft, |
|
||||||
kMarginRight, |
|
||||||
}; |
|
||||||
|
|
||||||
enum WXCorePaddingEdge { |
|
||||||
kPaddingALL, |
|
||||||
kPaddingTop, |
|
||||||
kPaddingBottom, |
|
||||||
kPaddingLeft, |
|
||||||
kPaddingRight, |
|
||||||
}; |
|
||||||
|
|
||||||
enum WXCoreBorderWidthEdge { |
|
||||||
kBorderWidthALL, |
|
||||||
kBorderWidthTop, |
|
||||||
kBorderWidthBottom, |
|
||||||
kBorderWidthLeft, |
|
||||||
kBorderWidthRight, |
|
||||||
}; |
|
||||||
|
|
||||||
enum WXCoreEdge{ |
|
||||||
kTop, |
|
||||||
kRight, |
|
||||||
kBottom, |
|
||||||
kLeft, |
|
||||||
}; |
|
||||||
|
|
||||||
#ifdef __cplusplus |
|
||||||
} |
|
||||||
#endif |
|
||||||
|
|
||||||
#endif //WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUM_H
|
|
File diff suppressed because it is too large
Load Diff
@ -1,310 +0,0 @@ |
|||||||
/**
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
* or more contributor license agreements. See the NOTICE file |
|
||||||
* distributed with this work for additional information |
|
||||||
* regarding copyright ownership. The ASF licenses this file |
|
||||||
* to you under the Apache License, Version 2.0 (the |
|
||||||
* "License"); you may not use this file except in compliance |
|
||||||
* with the License. You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, |
|
||||||
* software distributed under the License is distributed on an |
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
* KIND, either express or implied. See the License for the |
|
||||||
* specific language governing permissions and limitations |
|
||||||
* under the License. |
|
||||||
*/ |
|
||||||
#ifdef __cplusplus |
|
||||||
|
|
||||||
#ifndef WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUMS_H |
|
||||||
#define WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUMS_H |
|
||||||
|
|
||||||
|
|
||||||
#include "flex_enum.h" |
|
||||||
#include <math.h> |
|
||||||
#include <cmath> |
|
||||||
|
|
||||||
namespace WeexCore { |
|
||||||
|
|
||||||
/**
|
|
||||||
* Margin: margin-left、margin-right、margin-top、margin-bottom |
|
||||||
*/ |
|
||||||
class WXCoreMargin { |
|
||||||
private: |
|
||||||
float mMarginTop; |
|
||||||
float mMarginBottom; |
|
||||||
float mMarginLeft; |
|
||||||
float mMarginRight; |
|
||||||
|
|
||||||
public: |
|
||||||
WXCoreMargin() : mMarginTop(0), |
|
||||||
mMarginBottom(0), |
|
||||||
mMarginLeft(0), |
|
||||||
mMarginRight(0) {} |
|
||||||
|
|
||||||
~WXCoreMargin() { |
|
||||||
mMarginTop = 0; |
|
||||||
mMarginBottom = 0; |
|
||||||
mMarginLeft = 0; |
|
||||||
mMarginRight = 0; |
|
||||||
} |
|
||||||
|
|
||||||
bool setMargin(const WXCoreMarginEdge &edge, float margin); |
|
||||||
|
|
||||||
float getMargin(const WXCoreMarginEdge &edge)const; |
|
||||||
}; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Padding:padding-left、padding-right、padding-top、padding-bottom |
|
||||||
*/ |
|
||||||
class WXCorePadding { |
|
||||||
private: |
|
||||||
float mPaddingTop; |
|
||||||
float mPaddingBottom; |
|
||||||
float mPaddingLeft; |
|
||||||
float mPaddingRight; |
|
||||||
|
|
||||||
public: |
|
||||||
WXCorePadding() : mPaddingTop(0), |
|
||||||
mPaddingBottom(0), |
|
||||||
mPaddingLeft(0), |
|
||||||
mPaddingRight(0) {} |
|
||||||
|
|
||||||
~WXCorePadding() { |
|
||||||
mPaddingTop = 0; |
|
||||||
mPaddingBottom = 0; |
|
||||||
mPaddingLeft = 0; |
|
||||||
mPaddingRight = 0; |
|
||||||
} |
|
||||||
|
|
||||||
bool setPadding(const WXCorePaddingEdge &edge, float padding); |
|
||||||
|
|
||||||
float getPadding(const WXCorePaddingEdge &edge)const; |
|
||||||
}; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BorderWidth:borderwidth-left、borderwidth-right、borderwidth-top、borderwidth-bottom |
|
||||||
*/ |
|
||||||
class WXCoreBorderWidth { |
|
||||||
private: |
|
||||||
float mBorderWidthTop; |
|
||||||
float mBorderWidthBottom; |
|
||||||
float mBorderWidthLeft; |
|
||||||
float mBorderWidthRight; |
|
||||||
|
|
||||||
public: |
|
||||||
WXCoreBorderWidth() : mBorderWidthTop(0), |
|
||||||
mBorderWidthBottom(0), |
|
||||||
mBorderWidthLeft(0), |
|
||||||
mBorderWidthRight(0) {} |
|
||||||
|
|
||||||
~WXCoreBorderWidth() { |
|
||||||
mBorderWidthTop = 0; |
|
||||||
mBorderWidthBottom = 0; |
|
||||||
mBorderWidthLeft = 0; |
|
||||||
mBorderWidthRight = 0; |
|
||||||
} |
|
||||||
|
|
||||||
bool setBorderWidth(const WXCoreBorderWidthEdge &edge, float borderWidth); |
|
||||||
|
|
||||||
float getBorderWidth(const WXCoreBorderWidthEdge &edge)const; |
|
||||||
}; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* position:left、right、top、bottom |
|
||||||
*/ |
|
||||||
class WXCorePosition { |
|
||||||
private: |
|
||||||
float mTop; |
|
||||||
float mBottom; |
|
||||||
float mLeft; |
|
||||||
float mRight; |
|
||||||
|
|
||||||
public: |
|
||||||
WXCorePosition() : mTop(NAN), |
|
||||||
mBottom(NAN), |
|
||||||
mLeft(NAN), |
|
||||||
mRight(NAN) {} |
|
||||||
|
|
||||||
~WXCorePosition() { |
|
||||||
reset(); |
|
||||||
} |
|
||||||
|
|
||||||
inline bool isNAN() { |
|
||||||
return isnan(mTop) || isnan(mBottom) || isnan(mLeft) || isnan(mRight); |
|
||||||
} |
|
||||||
|
|
||||||
inline void reset() { |
|
||||||
mTop = 0; |
|
||||||
mBottom = 0; |
|
||||||
mLeft = 0; |
|
||||||
mRight = 0; |
|
||||||
} |
|
||||||
|
|
||||||
bool setPosition(const WXCorePositionEdge &edge, float position); |
|
||||||
|
|
||||||
float getPosition(const WXCorePositionEdge &edge); |
|
||||||
}; |
|
||||||
|
|
||||||
enum DimensionLevel{ |
|
||||||
CSS_STYLE = 1, |
|
||||||
INSTANCE_STYLE = 2, |
|
||||||
FALLBACK_STYLE = 3 |
|
||||||
}; |
|
||||||
|
|
||||||
/**
|
|
||||||
* css-style |
|
||||||
*/ |
|
||||||
class WXCoreCSSStyle { |
|
||||||
public: |
|
||||||
/**
|
|
||||||
* The direction children items are placed inside the Flexbox layout, it determines the |
|
||||||
* direction of the main axis (and the cross axis, perpendicular to the main axis). |
|
||||||
* The default value is {@link WXCoreFlexDirection #WXCore_Flex_Direction_Row}. |
|
||||||
*/ |
|
||||||
WXCoreFlexDirection mFlexDirection; |
|
||||||
|
|
||||||
/**
|
|
||||||
* This attribute controls whether the flex container is single-line or multi-line, and the |
|
||||||
* direction of the cross axis. |
|
||||||
* <ul> |
|
||||||
* <li>{@link WXCoreFlexWrap}: The flex container is single-line.</li> |
|
||||||
* <li>{@link WXCoreFlexWrap}: The flex container is multi-line.</li> |
|
||||||
* <li>{@link WXCoreFlexWrap}: The flex container is multi-line. The direction of the |
|
||||||
* cross axis is opposed to the direction as the {@link WXCoreFlexWrap}</li> |
|
||||||
* </ul> |
|
||||||
* The default value is {@link WXCoreFlexWrap #WXCore_Wrap_NoWrap}. |
|
||||||
*/ |
|
||||||
WXCoreFlexWrap mFlexWrap; |
|
||||||
|
|
||||||
/**
|
|
||||||
* This attribute controls the alignment along the main axis. |
|
||||||
* The default value is {@link WXCoreJustifyContent #WXCore_Justify_Flex_Start}. |
|
||||||
*/ |
|
||||||
WXCoreJustifyContent mJustifyContent; |
|
||||||
|
|
||||||
/**
|
|
||||||
* This attribute controls the alignment along the cross axis. |
|
||||||
* The default value is {@link WXCoreAlignItems #WXCore_AlignItems_Stretch}. |
|
||||||
*/ |
|
||||||
WXCoreAlignItems mAlignItems; |
|
||||||
|
|
||||||
/**
|
|
||||||
* This attribute controls the alignment along the cross axis. |
|
||||||
* The default value is {@link WXCoreAlignSelf #WXCore_AlignSelf_Auto}. |
|
||||||
*/ |
|
||||||
WXCoreAlignSelf mAlignSelf; |
|
||||||
|
|
||||||
WXCorePositionType mPositionType; |
|
||||||
|
|
||||||
WXCoreDirection mDirection; |
|
||||||
|
|
||||||
float mFlexGrow; |
|
||||||
|
|
||||||
float mMinWidth; |
|
||||||
|
|
||||||
float mMinHeight; |
|
||||||
|
|
||||||
float mMaxWidth; |
|
||||||
|
|
||||||
float mMaxHeight; |
|
||||||
|
|
||||||
float mStyleWidth; |
|
||||||
|
|
||||||
float mStyleHeight; |
|
||||||
|
|
||||||
DimensionLevel mStyleWidthLevel; |
|
||||||
|
|
||||||
DimensionLevel mStyleHeightLevel; |
|
||||||
|
|
||||||
WXCoreMargin mMargin; |
|
||||||
|
|
||||||
WXCorePadding mPadding; |
|
||||||
|
|
||||||
WXCoreBorderWidth mBorderWidth; |
|
||||||
|
|
||||||
WXCorePosition mStylePosition; |
|
||||||
|
|
||||||
constexpr static float kFlexGrowDefault = 0; |
|
||||||
|
|
||||||
constexpr static WXCoreDirection kDirectionDefault = kDirectionLTR; |
|
||||||
|
|
||||||
constexpr static WXCoreFlexDirection kFlexDirectionDefault= kFlexDirectionColumn; |
|
||||||
|
|
||||||
constexpr static WXCoreFlexWrap kFlexWrapDefault = kNoWrap; |
|
||||||
|
|
||||||
constexpr static WXCoreJustifyContent kFlexJustifyContentDefault = kJustifyFlexStart; |
|
||||||
|
|
||||||
constexpr static WXCoreAlignItems kFlexAlignItemsDefault = kAlignItemsStretch; |
|
||||||
|
|
||||||
constexpr static WXCoreAlignSelf kFlexAlignSelfDefault = kAlignSelfAuto; |
|
||||||
|
|
||||||
constexpr static WXCorePositionType kWXCorePositionTypeDefault = kRelative; |
|
||||||
|
|
||||||
WXCoreCSSStyle() : mDirection(kDirectionInherit), |
|
||||||
mFlexDirection(kFlexDirectionDefault), |
|
||||||
mFlexWrap(kFlexWrapDefault), |
|
||||||
mJustifyContent(kFlexJustifyContentDefault), |
|
||||||
mAlignItems(kFlexAlignItemsDefault), |
|
||||||
mAlignSelf(kFlexAlignSelfDefault), |
|
||||||
mFlexGrow(kFlexGrowDefault), |
|
||||||
mPositionType(kWXCorePositionTypeDefault), |
|
||||||
mStyleWidth(NAN), mStyleHeight(NAN), |
|
||||||
mStyleHeightLevel(FALLBACK_STYLE), mStyleWidthLevel(FALLBACK_STYLE), |
|
||||||
mMaxWidth(NAN), mMaxHeight(NAN), |
|
||||||
mMinWidth(NAN), mMinHeight(NAN) { |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
~WXCoreCSSStyle() { |
|
||||||
mDirection = kDirectionInherit; |
|
||||||
mFlexDirection = kFlexDirectionDefault; |
|
||||||
mFlexWrap = kFlexWrapDefault; |
|
||||||
mJustifyContent = kFlexJustifyContentDefault; |
|
||||||
mAlignItems = kFlexAlignItemsDefault; |
|
||||||
mAlignSelf = kFlexAlignSelfDefault; |
|
||||||
mFlexGrow = kFlexGrowDefault; |
|
||||||
mStyleWidth = NAN; |
|
||||||
mStyleHeight = NAN; |
|
||||||
mStyleWidthLevel = FALLBACK_STYLE; |
|
||||||
mStyleHeightLevel = FALLBACK_STYLE; |
|
||||||
mMaxWidth = NAN; |
|
||||||
mMaxHeight = NAN; |
|
||||||
mMinWidth = NAN; |
|
||||||
mMinHeight = NAN; |
|
||||||
} |
|
||||||
|
|
||||||
inline float sumPaddingBorderOfEdge(const WXCoreEdge edge){ |
|
||||||
switch (edge) { |
|
||||||
case kTop: |
|
||||||
return mPadding.getPadding(kPaddingTop) |
|
||||||
+ mBorderWidth.getBorderWidth(kBorderWidthTop); |
|
||||||
case kRight: |
|
||||||
return mPadding.getPadding(kPaddingRight) |
|
||||||
+ mBorderWidth.getBorderWidth(kBorderWidthRight); |
|
||||||
case kBottom: |
|
||||||
return mPadding.getPadding(kPaddingBottom) |
|
||||||
+ mBorderWidth.getBorderWidth(kBorderWidthBottom); |
|
||||||
case kLeft: |
|
||||||
return mPadding.getPadding(kPaddingLeft) |
|
||||||
+ mBorderWidth.getBorderWidth(kBorderWidthLeft); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
float sumMarginOfDirection(bool horizontal){ |
|
||||||
if(horizontal){ |
|
||||||
return mMargin.getMargin(kMarginLeft) + mMargin.getMargin(kMarginRight); |
|
||||||
} |
|
||||||
else{ |
|
||||||
return mMargin.getMargin(kMarginTop) + mMargin.getMargin(kMarginBottom); |
|
||||||
} |
|
||||||
} |
|
||||||
}; |
|
||||||
} |
|
||||||
#endif //WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUMS_H
|
|
||||||
#endif |
|
Binary file not shown.
@ -1,48 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapFoundationConst.h
|
|
||||||
// AMapFoundationKit
|
|
||||||
//
|
|
||||||
// Created by JL on 2019/7/22.
|
|
||||||
// Copyright © 2019 Amap.com. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN |
|
||||||
|
|
||||||
typedef NSInteger AMapFoundationNSErrorCode; |
|
||||||
|
|
||||||
//ErrorDomain:文件不存在 错误码:-555555
|
|
||||||
extern NSErrorDomain const AMapFoundationNSErrorFileDonotExist; |
|
||||||
extern AMapFoundationNSErrorCode const AMapFoundationNSErrorFileDonotExistCode; |
|
||||||
|
|
||||||
//ErrorDomain:文件路径不合法 错误码:-555556
|
|
||||||
extern NSErrorDomain const AMapFoundationNSErrorFilePathInvaild; |
|
||||||
extern AMapFoundationNSErrorCode const AMapFoundationNSErrorFilePathInvaildCode; |
|
||||||
|
|
||||||
//ErrorDomain:指定类型的日志文件不存在 错误码:-555557
|
|
||||||
extern NSErrorDomain const AMapFoundationNSErrorTypeLogDonotExist; |
|
||||||
extern AMapFoundationNSErrorCode const AMapFoundationNSErrorTypeLogDonotExistCode; |
|
||||||
|
|
||||||
//ErrorDomain:待上传的数据为空(可能是组装/压缩时出错) 错误码:-555558
|
|
||||||
extern NSErrorDomain const AMapFoundationNSErrorUploadDataIsEmpty; |
|
||||||
extern AMapFoundationNSErrorCode const AMapFoundationNSErrorUploadDataIsEmptyCode; |
|
||||||
|
|
||||||
//ErrorDomain:参数错误 错误码:-444444
|
|
||||||
extern NSErrorDomain const AMapFoundationNSErrorParametersInvalid; |
|
||||||
extern AMapFoundationNSErrorCode const AMapFoundationNSErrorParametersInvalidCode; |
|
||||||
|
|
||||||
|
|
||||||
extern NSErrorDomain const AMapFoundationNSErrorCloudConfigDisable; |
|
||||||
extern AMapFoundationNSErrorCode const AMapFoundationNSErrorCloudConfigDisableCode; |
|
||||||
|
|
||||||
extern NSErrorDomain const AMapFoundationNSErrorNetworkUnusable; |
|
||||||
extern AMapFoundationNSErrorCode const AMapFoundationNSErrorNetworkUnusableCode; |
|
||||||
|
|
||||||
extern NSErrorDomain const AMapFoundationNSErrorCurrentworkIsRunning; |
|
||||||
extern AMapFoundationNSErrorCode const AMapFoundationNSErrorCurrentworkIsRunningCode; |
|
||||||
|
|
||||||
extern NSErrorDomain const AMapFoundationNSErrorCurrentUploadSizeHaveExcess; |
|
||||||
extern AMapFoundationNSErrorCode const AMapFoundationNSErrorCurrentUploadSizeHaveExcessCode; |
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END |
|
@ -1,16 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapFoundationKit.h
|
|
||||||
// AMapFoundationKit
|
|
||||||
//
|
|
||||||
// Created by xiaoming han on 15/10/28.
|
|
||||||
// Copyright © 2015年 Amap. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <AMapFoundationKit/AMapFoundationVersion.h> |
|
||||||
#import <AMapFoundationKit/AMapServices.h> |
|
||||||
#import <AMapFoundationKit/AMapURLSearchConfig.h> |
|
||||||
#import <AMapFoundationKit/AMapURLSearchType.h> |
|
||||||
#import <AMapFoundationKit/AMapURLSearch.h> |
|
||||||
#import <AMapFoundationKit/AMapFoundationConst.h> |
|
||||||
|
|
||||||
#import <AMapFoundationKit/AMapUtility.h> |
|
@ -1,19 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapFoundationVersion.h
|
|
||||||
// AMapFoundation
|
|
||||||
//
|
|
||||||
// Created by xiaoming han on 15/10/26.
|
|
||||||
// Copyright © 2015年 Amap. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
#ifndef AMapFoundationVersion_h |
|
||||||
#define AMapFoundationVersion_h |
|
||||||
|
|
||||||
#define AMapFoundationVersionNumber 10604 |
|
||||||
|
|
||||||
FOUNDATION_EXTERN NSString * const AMapFoundationVersion; |
|
||||||
FOUNDATION_EXTERN NSString * const AMapFoundationName; |
|
||||||
|
|
||||||
#endif /* AMapFoundationVersion_h */ |
|
@ -1,39 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapSearchServices.h
|
|
||||||
// AMapSearchKit
|
|
||||||
//
|
|
||||||
// Created by xiaoming han on 15/6/18.
|
|
||||||
// Copyright (c) 2015年 xiaoming han. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为海外用户...海外用户,SDK内部会屏蔽一些操作 默认为NO. |
|
||||||
* @warning AMapServices初始化之前,设置才能生效 |
|
||||||
*/ |
|
||||||
extern BOOL _amapLocationOverseas; |
|
||||||
|
|
||||||
///高德SDK服务类
|
|
||||||
@interface AMapServices : NSObject |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 获取单例 |
|
||||||
*/ |
|
||||||
+ (AMapServices *)sharedServices; |
|
||||||
|
|
||||||
|
|
||||||
///APIkey。设置key,需要在高德官网控制台绑定对应的bundleid。
|
|
||||||
@property (nonatomic, copy) NSString *apiKey; |
|
||||||
|
|
||||||
///是否开启HTTPS,从1.3.3版本开始默认为YES。
|
|
||||||
@property (nonatomic, assign) BOOL enableHTTPS; |
|
||||||
|
|
||||||
///是否启用崩溃日志上传。默认为YES, 只有在真机上设置有效。\n开启崩溃日志上传有助于我们更好的了解SDK的状况,可以帮助我们持续优化和改进SDK。需要注意的是,SDK内部是通过设置NSUncaughtExceptionHandler来捕获异常的,如果您的APP中使用了其他收集崩溃日志的SDK,或者自己有设置NSUncaughtExceptionHandler的话,请保证 AMapServices 的初始化是在其他设置NSUncaughtExceptionHandler操作之后进行的,我们的handler会再处理完异常后调用前一次设置的handler,保证之前设置的handler会被执行。
|
|
||||||
@property (nonatomic, assign) BOOL crashReportEnabled __attribute__((deprecated("从v1.5.7开始废弃,调用无任何作用"))); |
|
||||||
|
|
||||||
///设备标识,取自idfv。用于排查问题时提供。
|
|
||||||
@property (nonatomic, readonly) NSString *identifier; |
|
||||||
|
|
||||||
@end |
|
@ -1,41 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapURLSearch.h
|
|
||||||
// AMapFoundation
|
|
||||||
//
|
|
||||||
// Created by xiaoming han on 15/10/28.
|
|
||||||
// Copyright © 2015年 Amap. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "AMapURLSearchConfig.h" |
|
||||||
|
|
||||||
///调起高德地图URL进行搜索,若是调起失败,可使用`+ (void)getLatestAMapApp;`方法获取最新版高德地图app.
|
|
||||||
@interface AMapURLSearch : NSObject |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 打开高德地图AppStore页面 |
|
||||||
*/ |
|
||||||
+ (void)getLatestAMapApp; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 调起高德地图app驾车导航. |
|
||||||
* @param config 配置参数. |
|
||||||
* @return 是否成功.若为YES则成功调起,若为NO则无法调起. |
|
||||||
*/ |
|
||||||
+ (BOOL)openAMapNavigation:(AMapNaviConfig *)config; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 调起高德地图app进行路径规划. |
|
||||||
* @param config 配置参数. |
|
||||||
* @return 是否成功. |
|
||||||
*/ |
|
||||||
+ (BOOL)openAMapRouteSearch:(AMapRouteConfig *)config; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 调起高德地图app进行POI搜索. |
|
||||||
* @param config 配置参数. |
|
||||||
* @return 是否成功. |
|
||||||
*/ |
|
||||||
+ (BOOL)openAMapPOISearch:(AMapPOIConfig *)config; |
|
||||||
|
|
||||||
@end |
|
@ -1,79 +0,0 @@ |
|||||||
//
|
|
||||||
// MAMapURLSearchConfig.h
|
|
||||||
// MAMapKitNew
|
|
||||||
//
|
|
||||||
// Created by xiaoming han on 15/5/25.
|
|
||||||
// Copyright (c) 2015年 xiaoming han. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import <CoreLocation/CoreLocation.h> |
|
||||||
#import "AMapURLSearchType.h" |
|
||||||
|
|
||||||
///导航配置信息
|
|
||||||
@interface AMapNaviConfig : NSObject |
|
||||||
|
|
||||||
///应用返回的Scheme
|
|
||||||
@property (nonatomic, copy) NSString *appScheme; |
|
||||||
|
|
||||||
///应用名称
|
|
||||||
@property (nonatomic, copy) NSString *appName; |
|
||||||
|
|
||||||
///终点
|
|
||||||
@property (nonatomic, assign) CLLocationCoordinate2D destination; |
|
||||||
|
|
||||||
///导航策略
|
|
||||||
@property (nonatomic, assign) AMapDrivingStrategy strategy; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
#pragma mark - |
|
||||||
|
|
||||||
///路径搜索配置信息
|
|
||||||
@interface AMapRouteConfig : NSObject |
|
||||||
|
|
||||||
///应用返回的Scheme
|
|
||||||
@property (nonatomic, copy) NSString *appScheme; |
|
||||||
|
|
||||||
///应用名称
|
|
||||||
@property (nonatomic, copy) NSString *appName; |
|
||||||
|
|
||||||
///起点坐标
|
|
||||||
@property (nonatomic, assign) CLLocationCoordinate2D startCoordinate; |
|
||||||
|
|
||||||
///终点坐标
|
|
||||||
@property (nonatomic, assign) CLLocationCoordinate2D destinationCoordinate; |
|
||||||
|
|
||||||
///驾车策略
|
|
||||||
@property (nonatomic, assign) AMapDrivingStrategy drivingStrategy; |
|
||||||
|
|
||||||
///公交策略
|
|
||||||
@property (nonatomic, assign) AMapTransitStrategy transitStrategy; |
|
||||||
|
|
||||||
///路径规划类型
|
|
||||||
@property (nonatomic, assign) AMapRouteSearchType routeType; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
#pragma mark - |
|
||||||
|
|
||||||
///POI搜索配置信息
|
|
||||||
@interface AMapPOIConfig : NSObject |
|
||||||
|
|
||||||
///应用返回的Scheme
|
|
||||||
@property (nonatomic, copy) NSString *appScheme; |
|
||||||
|
|
||||||
///应用名称
|
|
||||||
@property (nonatomic, copy) NSString *appName; |
|
||||||
|
|
||||||
///搜索关键字
|
|
||||||
@property (nonatomic, copy) NSString *keywords; |
|
||||||
|
|
||||||
///左上角坐标
|
|
||||||
@property (nonatomic, assign) CLLocationCoordinate2D leftTopCoordinate; |
|
||||||
|
|
||||||
///右下角坐标
|
|
||||||
@property (nonatomic, assign) CLLocationCoordinate2D rightBottomCoordinate; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
@ -1,44 +0,0 @@ |
|||||||
//
|
|
||||||
// MAMapURLSearchType.h
|
|
||||||
// MAMapKitNew
|
|
||||||
//
|
|
||||||
// Created by xiaoming han on 15/5/25.
|
|
||||||
// Copyright (c) 2015年 xiaoming han. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
///驾车策略
|
|
||||||
typedef NS_ENUM(NSInteger, AMapDrivingStrategy) |
|
||||||
{ |
|
||||||
AMapDrivingStrategyFastest = 0, ///<速度最快
|
|
||||||
AMapDrivingStrategyMinFare = 1, ///<避免收费
|
|
||||||
AMapDrivingStrategyShortest = 2, ///<距离最短
|
|
||||||
|
|
||||||
AMapDrivingStrategyNoHighways = 3, ///<不走高速
|
|
||||||
AMapDrivingStrategyAvoidCongestion = 4, ///<躲避拥堵
|
|
||||||
|
|
||||||
AMapDrivingStrategyAvoidHighwaysAndFare = 5, ///<不走高速且避免收费
|
|
||||||
AMapDrivingStrategyAvoidHighwaysAndCongestion = 6, ///<不走高速且躲避拥堵
|
|
||||||
AMapDrivingStrategyAvoidFareAndCongestion = 7, ///<躲避收费和拥堵
|
|
||||||
AMapDrivingStrategyAvoidHighwaysAndFareAndCongestion = 8 ///<不走高速躲避收费和拥堵
|
|
||||||
}; |
|
||||||
|
|
||||||
///公交策略
|
|
||||||
typedef NS_ENUM(NSInteger, AMapTransitStrategy) |
|
||||||
{ |
|
||||||
AMapTransitStrategyFastest = 0,///<最快捷
|
|
||||||
AMapTransitStrategyMinFare = 1,///<最经济
|
|
||||||
AMapTransitStrategyMinTransfer = 2,///<最少换乘
|
|
||||||
AMapTransitStrategyMinWalk = 3,///<最少步行
|
|
||||||
AMapTransitStrategyMostComfortable = 4,///<最舒适
|
|
||||||
AMapTransitStrategyAvoidSubway = 5,///<不乘地铁
|
|
||||||
}; |
|
||||||
|
|
||||||
///路径规划类型
|
|
||||||
typedef NS_ENUM(NSInteger, AMapRouteSearchType) |
|
||||||
{ |
|
||||||
AMapRouteSearchTypeDriving = 0, ///<驾车
|
|
||||||
AMapRouteSearchTypeTransit = 1, ///<公交
|
|
||||||
AMapRouteSearchTypeWalking = 2, ///<步行
|
|
||||||
}; |
|
||||||
|
|
||||||
|
|
@ -1,50 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapUtility.h
|
|
||||||
// AMapFoundation
|
|
||||||
//
|
|
||||||
// Created by xiaoming han on 15/10/27.
|
|
||||||
// Copyright © 2015年 Amap. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import <CoreLocation/CoreLocation.h> |
|
||||||
|
|
||||||
//工具方法
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 如果字符串为nil则返回空字符串 |
|
||||||
*/ |
|
||||||
FOUNDATION_STATIC_INLINE NSString * AMapEmptyStringIfNil(NSString *s) |
|
||||||
{ |
|
||||||
return s ? s : @""; |
|
||||||
} |
|
||||||
|
|
||||||
///坐标类型枚举
|
|
||||||
typedef NS_ENUM(NSInteger, AMapCoordinateType) |
|
||||||
{ |
|
||||||
AMapCoordinateTypeAMap = -1, ///<AMap
|
|
||||||
AMapCoordinateTypeBaidu = 0, ///<Baidu
|
|
||||||
AMapCoordinateTypeMapBar, ///<MapBar
|
|
||||||
AMapCoordinateTypeMapABC, ///<MapABC
|
|
||||||
AMapCoordinateTypeSoSoMap, ///<SoSoMap
|
|
||||||
AMapCoordinateTypeAliYun, ///<AliYun
|
|
||||||
AMapCoordinateTypeGoogle, ///<Google
|
|
||||||
AMapCoordinateTypeGPS, ///<GPS
|
|
||||||
}; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 转换目标经纬度为高德坐标系,不在枚举范围内的经纬度将直接返回。 |
|
||||||
* @param coordinate 待转换的经纬度 |
|
||||||
* @param type 坐标系类型 |
|
||||||
* @return 高德坐标系经纬度 |
|
||||||
*/ |
|
||||||
FOUNDATION_EXTERN CLLocationCoordinate2D AMapCoordinateConvert(CLLocationCoordinate2D coordinate, AMapCoordinateType type); |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 判断目标经纬度处是否有高德数据。输入参数为高德坐标系。此方法为粗略判断,在边界地区可能会不准确。 |
|
||||||
* @param coordinate 待判断的目标经纬度 |
|
||||||
* @return 布尔值。YES:有数据,NO:没数据 |
|
||||||
*/ |
|
||||||
FOUNDATION_EXTERN BOOL AMapDataAvailableForCoordinate(CLLocationCoordinate2D coordinate); |
|
||||||
|
|
||||||
|
|
@ -1,6 +0,0 @@ |
|||||||
framework module AMapFoundationKit { |
|
||||||
umbrella header "AMapFoundationKit.h" |
|
||||||
|
|
||||||
export * |
|
||||||
module * { export * } |
|
||||||
} |
|
@ -1 +0,0 @@ |
|||||||
1.6.4+foundation-no-idfa.f7f9056 |
|
Binary file not shown.
@ -1,27 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapGeoFenceError.h
|
|
||||||
// AMapLocationKit
|
|
||||||
//
|
|
||||||
// Created by eidan on 16/12/15.
|
|
||||||
// Copyright © 2016年 Amap. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef AMapGeoFenceError_h |
|
||||||
#define AMapGeoFenceError_h |
|
||||||
|
|
||||||
|
|
||||||
///AMapGeoFence errorDomain
|
|
||||||
extern NSString * const AMapGeoFenceErrorDomain; |
|
||||||
|
|
||||||
///地理围栏错误码
|
|
||||||
typedef NS_ENUM(NSInteger, AMapGeoFenceErrorCode) { |
|
||||||
AMapGeoFenceErrorUnknown = 1, ///< 未知错误
|
|
||||||
AMapGeoFenceErrorInvalidParameter = 2, ///< 参数错误
|
|
||||||
AMapGeoFenceErrorFailureConnection = 3, ///< 网络连接异常
|
|
||||||
AMapGeoFenceErrorFailureAuth = 4, ///< 鉴权失败
|
|
||||||
AMapGeoFenceErrorNoValidFence = 5, ///< 无可用围栏
|
|
||||||
AMapGeoFenceErroFailureLocating = 6, ///< 定位错误
|
|
||||||
AMapGeoFenceErroFailureFullAccuracyLocating = 7, ///< 精确定位错误
|
|
||||||
}; |
|
||||||
|
|
||||||
#endif /* AMapGeoFenceError_h */ |
|
@ -1,234 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapGeoFenceManager.h
|
|
||||||
// AMapLocationKit
|
|
||||||
//
|
|
||||||
// Created by hanxiaoming on 16/12/5.
|
|
||||||
// Copyright © 2016年 Amap. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import "AMapGeoFenceRegionObj.h" |
|
||||||
|
|
||||||
// 以下类涉及的坐标需要使用高德坐标系坐标(GCJ02)
|
|
||||||
|
|
||||||
@protocol AMapGeoFenceManagerDelegate; |
|
||||||
|
|
||||||
///地理围栏监听状态类型
|
|
||||||
typedef NS_OPTIONS(NSUInteger, AMapGeoFenceActiveAction) |
|
||||||
{ |
|
||||||
AMapGeoFenceActiveActionNone = 0, ///< 不进行监听
|
|
||||||
AMapGeoFenceActiveActionInside = 1 << 0, ///< 在范围内
|
|
||||||
AMapGeoFenceActiveActionOutside = 1 << 1, ///< 在范围外
|
|
||||||
AMapGeoFenceActiveActionStayed = 1 << 2, ///< 停留(在范围内超过10分钟)
|
|
||||||
}; |
|
||||||
|
|
||||||
///地理围栏任务状态类型
|
|
||||||
typedef NS_OPTIONS(NSUInteger, AMapGeoFenceRegionActiveStatus) |
|
||||||
{ |
|
||||||
AMapGeoFenceRegionActiveUNMonitor = 0, ///< 未注册
|
|
||||||
AMapGeoFenceRegionActiveMonitoring = 1 << 0, ///< 正在监控
|
|
||||||
AMapGeoFenceRegionActivePaused = 1 << 1, ///< 暂停监控
|
|
||||||
}; |
|
||||||
|
|
||||||
///地理围栏管理类(since 2.3.0)
|
|
||||||
@interface AMapGeoFenceManager : NSObject |
|
||||||
|
|
||||||
|
|
||||||
///实现了 AMapGeoFenceManagerDelegate 协议的类指针。
|
|
||||||
@property (nonatomic, weak) id<AMapGeoFenceManagerDelegate> delegate; |
|
||||||
|
|
||||||
|
|
||||||
///需要进行通知的行为,默认为AMapGeoFenceActiveActionInside。
|
|
||||||
@property (nonatomic, assign) AMapGeoFenceActiveAction activeAction; |
|
||||||
|
|
||||||
|
|
||||||
///指定定位是否会被系统自动暂停。默认为NO。
|
|
||||||
@property (nonatomic, assign) BOOL pausesLocationUpdatesAutomatically; |
|
||||||
|
|
||||||
|
|
||||||
///是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。
|
|
||||||
@property (nonatomic, assign) BOOL allowsBackgroundLocationUpdates; |
|
||||||
|
|
||||||
///检测是否存在虚拟定位风险,默认为NO,即不检测。 \n如果设置为YES,检测到风险后,会通过amapGeoFenceManager:didGeoFencesStatusChangedForRegion:customID:error: 的error给出风险提示,error的格式为error.domain==AMapGeoFenceErrorDomain; error.code==AMapGeoFenceErroFailureLocating;
|
|
||||||
@property (nonatomic, assign) BOOL detectRiskOfFakeLocation; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 添加一个圆形围栏 |
|
||||||
* @param center 围栏的中心点经纬度坐标 |
|
||||||
* @param radius 围栏的半径,单位:米,要求大于0 |
|
||||||
* @param customID 用户自定义ID,可选,SDK原值返回 |
|
||||||
*/ |
|
||||||
- (void)addCircleRegionForMonitoringWithCenter:(CLLocationCoordinate2D)center radius:(CLLocationDistance)radius customID:(NSString *)customID; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 根据经纬度坐标数据添加一个闭合的多边形围栏,点与点之间按顺序尾部相连, 第一个点与最后一个点相连 |
|
||||||
* @param coordinates 经纬度坐标点数据,coordinates对应的内存会拷贝,调用者负责该内存的释放 |
|
||||||
* @param count 经纬度坐标点的个数,不可小于3个 |
|
||||||
* @param customID 用户自定义ID,可选,SDK原值返回 |
|
||||||
*/ |
|
||||||
- (void)addPolygonRegionForMonitoringWithCoordinates:(CLLocationCoordinate2D *)coordinates count:(NSInteger)count customID:(NSString *)customID; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 根据要查询的关键字,类型,城市等信息,添加一个或者多个POI地理围栏 |
|
||||||
* @param keyword 要查询的关键字,多个关键字用“|”分割,必填,keyword和type两者至少必选其一 |
|
||||||
* @param type 要查询的POI类型,多个类型用“|”分割,必填,keyword和type两者至少必选其一,具体分类编码和规则详见: http://lbs.amap.com/api/webservice/guide/api/search/#text
|
|
||||||
* @param city 要查询的城市 |
|
||||||
* @param size 要查询的数据的条数,(0,25],传入<=0的值为10,传入大于25的值为25,默认10 |
|
||||||
* @param customID 用户自定义ID,可选,SDK原值返回 |
|
||||||
*/ |
|
||||||
- (void)addKeywordPOIRegionForMonitoringWithKeyword:(NSString *)keyword POIType:(NSString *)type city:(NSString *)city size:(NSInteger)size customID:(NSString *)customID; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 根据要查询的点的经纬度,搜索半径等信息,添加一个或者多个POI围栏 |
|
||||||
* @param locationPoint 点的经纬度坐标,必填 |
|
||||||
* @param aroundRadius 查询半径,单位:米,(0,50000],超出范围取3000,默认3000 |
|
||||||
* @param keyword 要查询的关键字,多个关键字用“|”分割,可选 |
|
||||||
* @param type 要查询的POI类型,多个类型用“|”分割,可选 |
|
||||||
* @param size 要查询的数据的条数,(0,25],传入<=0的值为10,传入大于25的值为25,默认10 |
|
||||||
* @param customID 用户自定义ID,可选,SDK原值返回 |
|
||||||
*/ |
|
||||||
- (void)addAroundPOIRegionForMonitoringWithLocationPoint:(CLLocationCoordinate2D)locationPoint aroundRadius:(NSInteger)aroundRadius keyword:(NSString *)keyword POIType:(NSString *)type size:(NSInteger)size customID:(NSString *)customID; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 根据要查询的行政区域关键字,添加一个或者多个行政区域围栏 |
|
||||||
* @param districtName 行政区域关键字,必填,只支持单个关键词语:行政区名称、citycode、adcode,规则详见: http://lbs.amap.com/api/webservice/guide/api/district/#district
|
|
||||||
* @param customID 用户自定义ID,可选,SDK原值返回 |
|
||||||
*/ |
|
||||||
- (void)addDistrictRegionForMonitoringWithDistrictName:(NSString *)districtName customID:(NSString *)customID; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 获取指定围栏的运行状态 |
|
||||||
* @param region 要获取运行状态的围栏 |
|
||||||
* @return 返回指定围栏的运行状态 |
|
||||||
*/ |
|
||||||
- (AMapGeoFenceRegionActiveStatus)statusWithGeoFenceRegion:(AMapGeoFenceRegion *)region; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 根据customID获得所有已经注册的围栏,如果customID传nil,则返回全部已注册围栏 |
|
||||||
* @param customID 用户执行添加围栏函数时传入的customID |
|
||||||
* @return 获得的围栏构成的数组,如果没有结果,返回nil |
|
||||||
*/ |
|
||||||
- (NSArray *)geoFenceRegionsWithCustomID:(NSString *)customID; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 根据customID获得所有正在监控的围栏,如果customID传nil,则返回全部正在监控的围栏 |
|
||||||
* @param customID 用户执行添加围栏函数时传入的customID |
|
||||||
* @return 获得的围栏构成的数组,如果没有结果,返回nil |
|
||||||
*/ |
|
||||||
- (NSArray *)monitoringGeoFenceRegionsWithCustomID:(NSString *)customID; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 根据customID获得所有已经暂停的围栏,如果customID传nil,则返回全部已经暂停的围栏 |
|
||||||
* @param customID 用户执行添加围栏函数时传入的customID |
|
||||||
* @return 获得的围栏构成的数组,如果没有结果,返回nil |
|
||||||
*/ |
|
||||||
- (NSArray *)pausedGeoFenceRegionsWithCustomID:(NSString *)customID; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 暂停指定customID的围栏 |
|
||||||
* @param customID 用户执行添加围栏函数时传入的customID |
|
||||||
* @return 返回被暂停围栏的数组,如果没有围栏被暂停,返回nil |
|
||||||
*/ |
|
||||||
- (NSArray *)pauseGeoFenceRegionsWithCustomID:(NSString *)customID; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 暂停指定围栏 |
|
||||||
* @param region 要暂停监控的围栏 |
|
||||||
* @return 返回指定围栏是否被暂停,如果指定围栏没有注册,则返回NO |
|
||||||
*/ |
|
||||||
- (BOOL)pauseTheGeoFenceRegion:(AMapGeoFenceRegion *)region; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 根据customID开始监控已经暂停的围栏 |
|
||||||
* @param customID 用户执行添加围栏函数时传入的customID |
|
||||||
* @return 返回开始监控的围栏构成的数组 |
|
||||||
*/ |
|
||||||
- (NSArray *)startGeoFenceRegionsWithCustomID:(NSString *)customID; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 开始监控指定围栏 |
|
||||||
* @param region 要开始监控的围栏 |
|
||||||
* @return 返回指定围栏是否开始监控,如果指定围栏没有注册,则返回NO |
|
||||||
*/ |
|
||||||
- (BOOL)startTheGeoFenceRegion:(AMapGeoFenceRegion *)region; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 移除指定围栏 |
|
||||||
* @param region 要停止监控的围栏 |
|
||||||
*/ |
|
||||||
- (void)removeTheGeoFenceRegion:(AMapGeoFenceRegion *)region; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 移除指定customID的围栏 |
|
||||||
* @param customID 用户执行添加围栏函数时传入的customID |
|
||||||
*/ |
|
||||||
- (void)removeGeoFenceRegionsWithCustomID:(NSString *)customID; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 移除所有围栏 |
|
||||||
*/ |
|
||||||
- (void)removeAllGeoFenceRegions; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
///地理围栏代理协议(since 2.3.0),该协议定义了获取地理围栏相关回调方法,包括添加、状态改变等。
|
|
||||||
@protocol AMapGeoFenceManagerDelegate <NSObject> |
|
||||||
|
|
||||||
@required |
|
||||||
|
|
||||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief iOS14及以上版本使用地理围栏功能,需要在plist中配置NSLocationTemporaryUsageDescriptionDictionary字典描述,且添加自定义Key描述地理围栏的使用场景,此描述会在申请临时精确定位权限的弹窗中展示。该回调触发条件:拥有定位权限,但是没有获得精确定位权限的情况下,会触发该回调。此方法实现调用申请临时精确定位权限API即可: |
|
||||||
* [manager requestTemporaryFullAccuracyAuthorizationWithPurposeKey:@"PurposeKey" completion:^(NSError *error){ |
|
||||||
* if(completion){ |
|
||||||
* completion(error); |
|
||||||
* } |
|
||||||
* }]; (必须调用,不然无法正常获取临时精确定位权限) |
|
||||||
* @param manager 地理围栏管理类。 |
|
||||||
* @param locationManager 需要申请临时精确定位权限的locationManager。 |
|
||||||
* @param completion 临时精确定位权限API回调结果。直接返回系统error即可 |
|
||||||
* @since 2.6.7 |
|
||||||
*/ |
|
||||||
- (void)amapLocationManager:(AMapGeoFenceManager *)manager doRequireTemporaryFullAccuracyAuth:(CLLocationManager*)locationManager completion:(void(^)(NSError *error))completion; |
|
||||||
|
|
||||||
#endif |
|
||||||
|
|
||||||
@optional |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 当plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription,并且[CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined,会调用代理的此方法。 |
|
||||||
此方法实现申请后台权限API即可:[locationManager requestAlwaysAuthorization](必须调用,不然无法正常获取定位权限) |
|
||||||
* @param manager 地理围栏管理类。 |
|
||||||
* @param locationManager 需要申请后台定位权限的locationManager。 |
|
||||||
* @since 2.6.2 |
|
||||||
*/ |
|
||||||
- (void)amapGeoFenceManager:(AMapGeoFenceManager *)manager doRequireLocationAuth:(CLLocationManager*)locationManager; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 添加地理围栏完成后的回调,成功与失败都会调用 |
|
||||||
* @param manager 地理围栏管理类 |
|
||||||
* @param regions 成功添加的一个或多个地理围栏构成的数组 |
|
||||||
* @param customID 用户执行添加围栏函数时传入的customID |
|
||||||
* @param error 添加失败的错误信息 |
|
||||||
*/ |
|
||||||
- (void)amapGeoFenceManager:(AMapGeoFenceManager *)manager didAddRegionForMonitoringFinished:(NSArray <AMapGeoFenceRegion *> *)regions customID:(NSString *)customID error:(NSError *)error; |
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 地理围栏状态改变时回调,当围栏状态的值发生改变,定位失败都会调用 |
|
||||||
* @param manager 地理围栏管理类 |
|
||||||
* @param region 状态改变的地理围栏 |
|
||||||
* @param customID 用户执行添加围栏函数时传入的customID |
|
||||||
* @param error 错误信息,如定位相关的错误 |
|
||||||
*/ |
|
||||||
- (void)amapGeoFenceManager:(AMapGeoFenceManager *)manager didGeoFencesStatusChangedForRegion:(AMapGeoFenceRegion *)region customID:(NSString *)customID error:(NSError *)error; |
|
||||||
|
|
||||||
@end |
|
@ -1,120 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapGeoFenceRegionObj.h
|
|
||||||
// AMapLocationKit
|
|
||||||
//
|
|
||||||
// Created by hanxiaoming on 16/12/5.
|
|
||||||
// Copyright © 2016年 Amap. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "AMapLocationCommonObj.h" |
|
||||||
|
|
||||||
|
|
||||||
///AMapGeoFence Region State
|
|
||||||
typedef NS_ENUM(NSInteger, AMapGeoFenceRegionStatus) |
|
||||||
{ |
|
||||||
AMapGeoFenceRegionStatusUnknown = 0, ///< 未知
|
|
||||||
AMapGeoFenceRegionStatusInside = 1, ///< 在范围内
|
|
||||||
AMapGeoFenceRegionStatusOutside = 2, ///< 在范围外
|
|
||||||
AMapGeoFenceRegionStatusStayed = 3, ///< 停留(在范围内超过10分钟)
|
|
||||||
}; |
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, AMapGeoFenceRegionType) |
|
||||||
{ |
|
||||||
AMapGeoFenceRegionTypeCircle = 0, /// 圆形地理围栏
|
|
||||||
AMapGeoFenceRegionTypePolygon = 1, /// 多边形地理围栏
|
|
||||||
AMapGeoFenceRegionTypePOI = 2, /// 兴趣点(POI)地理围栏
|
|
||||||
AMapGeoFenceRegionTypeDistrict = 3, /// 行政区划地理围栏
|
|
||||||
}; |
|
||||||
|
|
||||||
#pragma mark - AMapGeoFenceRegion |
|
||||||
|
|
||||||
|
|
||||||
///地理围栏基类,不可直接使用。(since 2.3.0)
|
|
||||||
@interface AMapGeoFenceRegion : NSObject<NSCopying> |
|
||||||
|
|
||||||
|
|
||||||
///AMapGeoFenceRegion的唯一标识符
|
|
||||||
@property (nonatomic, copy, readonly) NSString *identifier; |
|
||||||
|
|
||||||
|
|
||||||
///用户自定义ID,可为nil。
|
|
||||||
@property (nonatomic, copy, readonly) NSString *customID; |
|
||||||
|
|
||||||
|
|
||||||
///坐标点和围栏的关系,比如用户的位置和围栏的关系
|
|
||||||
@property (nonatomic, assign) AMapGeoFenceRegionStatus fenceStatus; |
|
||||||
|
|
||||||
///用户自定义ID,可为nil。
|
|
||||||
@property (nonatomic, assign) AMapGeoFenceRegionType regionType; |
|
||||||
|
|
||||||
///缓存最近获取的定位信息,可能会存在延时,可为nil,会在获取定位时更新
|
|
||||||
@property (nonatomic, copy) CLLocation *currentLocation; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
|
|
||||||
#pragma mark - AMapLocationCircleRegion |
|
||||||
|
|
||||||
|
|
||||||
///圆形地理围栏(since 2.3.0)
|
|
||||||
@interface AMapGeoFenceCircleRegion : AMapGeoFenceRegion |
|
||||||
|
|
||||||
|
|
||||||
///中心点的经纬度坐标
|
|
||||||
@property (nonatomic, readonly) CLLocationCoordinate2D center; |
|
||||||
|
|
||||||
|
|
||||||
///半径,单位:米
|
|
||||||
@property (nonatomic, readonly) CLLocationDistance radius; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
|
|
||||||
#pragma mark -AMapGeoFencePolygonRegion |
|
||||||
|
|
||||||
|
|
||||||
///多边形地理围栏(since 2.3.0)
|
|
||||||
@interface AMapGeoFencePolygonRegion : AMapGeoFenceRegion |
|
||||||
|
|
||||||
|
|
||||||
///经纬度坐标点数据
|
|
||||||
@property (nonatomic, readonly) CLLocationCoordinate2D *coordinates; |
|
||||||
|
|
||||||
|
|
||||||
///经纬度坐标点的个数
|
|
||||||
@property (nonatomic, readonly) NSInteger count; |
|
||||||
|
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
|
|
||||||
#pragma mark -AMapGeoFencePOIRegion |
|
||||||
|
|
||||||
|
|
||||||
///兴趣点(POI)地理围栏(since 2.3.0)
|
|
||||||
@interface AMapGeoFencePOIRegion : AMapGeoFenceCircleRegion |
|
||||||
|
|
||||||
|
|
||||||
///POI信息
|
|
||||||
@property (nonatomic, strong, readonly) AMapLocationPOIItem *POIItem; |
|
||||||
|
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
|
|
||||||
#pragma mark -AMapGeoFenceDistrictRegion |
|
||||||
|
|
||||||
|
|
||||||
///行政区划地理围栏(since 2.3.0)
|
|
||||||
@interface AMapGeoFenceDistrictRegion : AMapGeoFenceRegion |
|
||||||
|
|
||||||
|
|
||||||
///行政区域信息
|
|
||||||
@property (nonatomic, strong, readonly) AMapLocationDistrictItem *districtItem; |
|
||||||
|
|
||||||
|
|
||||||
///行政区域轮廓坐标点,每个行政区可能有多个模块,每个模块的坐标点数组由AMapLocationPoint构成
|
|
||||||
@property (nonatomic, copy, readonly) NSArray <NSArray<AMapLocationPoint *> *> *polylinePoints; |
|
||||||
|
|
||||||
|
|
||||||
@end |
|
@ -1,202 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapLocationCommonObj.h
|
|
||||||
// AMapLocationKit
|
|
||||||
//
|
|
||||||
// Created by AutoNavi on 15/10/22.
|
|
||||||
// Copyright © 2015年 Amap. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import <CoreLocation/CoreLocation.h> |
|
||||||
#import <UIKit/UIKit.h> |
|
||||||
|
|
||||||
|
|
||||||
///AMapLocation errorDomain
|
|
||||||
extern NSString * const AMapLocationErrorDomain; |
|
||||||
|
|
||||||
///AMapLocation errorCode
|
|
||||||
typedef NS_ENUM(NSInteger, AMapLocationErrorCode) |
|
||||||
{ |
|
||||||
AMapLocationErrorUnknown = 1, ///<未知错误
|
|
||||||
AMapLocationErrorLocateFailed = 2, ///<定位错误
|
|
||||||
AMapLocationErrorReGeocodeFailed = 3, ///<逆地理错误
|
|
||||||
AMapLocationErrorTimeOut = 4, ///<超时
|
|
||||||
AMapLocationErrorCanceled = 5, ///<取消
|
|
||||||
AMapLocationErrorCannotFindHost = 6, ///<找不到主机
|
|
||||||
AMapLocationErrorBadURL = 7, ///<URL异常
|
|
||||||
AMapLocationErrorNotConnectedToInternet = 8,///<连接异常
|
|
||||||
AMapLocationErrorCannotConnectToHost = 9, ///<服务器连接失败
|
|
||||||
AMapLocationErrorRegionMonitoringFailure=10,///<地理围栏错误
|
|
||||||
AMapLocationErrorRiskOfFakeLocation = 11, ///<存在虚拟定位风险
|
|
||||||
AMapLocationErrorNoFullAccuracyAuth = 12, ///<精确定位权限异常
|
|
||||||
}; |
|
||||||
|
|
||||||
///AMapLocation Region State
|
|
||||||
typedef NS_ENUM(NSInteger, AMapLocationRegionState) |
|
||||||
{ |
|
||||||
AMapLocationRegionStateUnknow = 0, ///<未知
|
|
||||||
AMapLocationRegionStateInside = 1, ///<在范围内
|
|
||||||
AMapLocationRegionStateOutside = 2, ///<在范围外
|
|
||||||
}; |
|
||||||
|
|
||||||
///AMapLocation Region Language
|
|
||||||
typedef NS_ENUM(NSInteger, AMapLocationReGeocodeLanguage) |
|
||||||
{ |
|
||||||
AMapLocationReGeocodeLanguageDefault = 0, ///<默认,根据地区选择语言
|
|
||||||
AMapLocationReGeocodeLanguageChinse = 1, ///<中文
|
|
||||||
AMapLocationReGeocodeLanguageEnglish = 2, ///<英文
|
|
||||||
}; |
|
||||||
|
|
||||||
///AMapLocation Accuracy Mode
|
|
||||||
typedef NS_ENUM(NSInteger, AMapLocationAccuracyMode) { |
|
||||||
AMapLocationFullAndReduceAccuracy = 0, |
|
||||||
AMapLocationFullAccuracy, |
|
||||||
AMapLocationReduceAccuracy |
|
||||||
}; |
|
||||||
|
|
||||||
///逆地理信息
|
|
||||||
@interface AMapLocationReGeocode : NSObject<NSCopying,NSCoding> |
|
||||||
|
|
||||||
///格式化地址
|
|
||||||
@property (nonatomic, copy) NSString *formattedAddress; |
|
||||||
|
|
||||||
///国家
|
|
||||||
@property (nonatomic, copy) NSString *country; |
|
||||||
|
|
||||||
///省/直辖市
|
|
||||||
@property (nonatomic, copy) NSString *province; |
|
||||||
|
|
||||||
///市
|
|
||||||
@property (nonatomic, copy) NSString *city; |
|
||||||
|
|
||||||
///区
|
|
||||||
@property (nonatomic, copy) NSString *district; |
|
||||||
|
|
||||||
///乡镇
|
|
||||||
@property (nonatomic, copy) NSString *township __attribute__((deprecated("该字段从v2.2.0版本起不再返回数据,建议您使用AMapSearchKit的逆地理功能获取."))); |
|
||||||
|
|
||||||
///社区
|
|
||||||
@property (nonatomic, copy) NSString *neighborhood __attribute__((deprecated("该字段从v2.2.0版本起不再返回数据,建议您使用AMapSearchKit的逆地理功能获取."))); |
|
||||||
|
|
||||||
///建筑
|
|
||||||
@property (nonatomic, copy) NSString *building __attribute__((deprecated("该字段从v2.2.0版本起不再返回数据,建议您使用AMapSearchKit的逆地理功能获取."))); |
|
||||||
|
|
||||||
///城市编码
|
|
||||||
@property (nonatomic, copy) NSString *citycode; |
|
||||||
|
|
||||||
///区域编码
|
|
||||||
@property (nonatomic, copy) NSString *adcode; |
|
||||||
|
|
||||||
///街道名称
|
|
||||||
@property (nonatomic, copy) NSString *street; |
|
||||||
|
|
||||||
///门牌号
|
|
||||||
@property (nonatomic, copy) NSString *number; |
|
||||||
|
|
||||||
///兴趣点名称
|
|
||||||
@property (nonatomic, copy) NSString *POIName; |
|
||||||
|
|
||||||
///所属兴趣点名称
|
|
||||||
@property (nonatomic, copy) NSString *AOIName; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
#pragma mark - AMapLocationPoint |
|
||||||
|
|
||||||
///经纬度坐标点对象
|
|
||||||
@interface AMapLocationPoint : NSObject<NSCopying,NSCoding> |
|
||||||
|
|
||||||
///纬度
|
|
||||||
@property (nonatomic, assign) CGFloat latitude; |
|
||||||
|
|
||||||
///经度
|
|
||||||
@property (nonatomic, assign) CGFloat longitude; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief AMapNaviPoint类对象的初始化函数 |
|
||||||
* @param lat 纬度 |
|
||||||
* @param lon 经度 |
|
||||||
* @return AMapNaviPoint类对象id |
|
||||||
*/ |
|
||||||
+ (AMapLocationPoint *)locationWithLatitude:(CGFloat)lat longitude:(CGFloat)lon; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
///POI信息
|
|
||||||
@interface AMapLocationPOIItem : NSObject <NSCopying, NSCoding> |
|
||||||
|
|
||||||
///id
|
|
||||||
@property (nonatomic, copy) NSString *pId; |
|
||||||
|
|
||||||
///名称
|
|
||||||
@property (nonatomic, copy) NSString *name; |
|
||||||
|
|
||||||
///类型
|
|
||||||
@property (nonatomic, copy) NSString *type; |
|
||||||
|
|
||||||
///类型编码
|
|
||||||
@property (nonatomic, copy) NSString *typeCode; |
|
||||||
|
|
||||||
///地址信息
|
|
||||||
@property (nonatomic, copy) NSString *address; |
|
||||||
|
|
||||||
///经纬度
|
|
||||||
@property (nonatomic, strong) AMapLocationPoint *location; |
|
||||||
|
|
||||||
///电话号码
|
|
||||||
@property (nonatomic, copy) NSString *tel; |
|
||||||
|
|
||||||
///省份
|
|
||||||
@property (nonatomic, copy) NSString *province; |
|
||||||
|
|
||||||
///城市
|
|
||||||
@property (nonatomic, copy) NSString *city; |
|
||||||
|
|
||||||
///区
|
|
||||||
@property (nonatomic, copy) NSString *district; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
///行政区域信息
|
|
||||||
@interface AMapLocationDistrictItem : NSObject <NSCopying, NSCoding> |
|
||||||
|
|
||||||
///城市编码
|
|
||||||
@property (nonatomic, copy) NSString *cityCode; |
|
||||||
|
|
||||||
///区域编码
|
|
||||||
@property (nonatomic, copy) NSString *districtCode; |
|
||||||
|
|
||||||
///区名
|
|
||||||
@property (nonatomic, copy) NSString *district; |
|
||||||
|
|
||||||
///行政区域轮廓坐标点,每个行政区可能有多个模块,每个模块的坐标点数组由AMapLocationPoint构成
|
|
||||||
@property (nonatomic, copy) NSArray <NSArray<AMapLocationPoint *> *> *polylinePoints; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
///AMapLocation CoordinateType
|
|
||||||
typedef NS_ENUM(NSUInteger, AMapLocationCoordinateType) |
|
||||||
{ |
|
||||||
AMapLocationCoordinateTypeBaidu = 0, ///<Baidu
|
|
||||||
AMapLocationCoordinateTypeMapBar, ///<MapBar
|
|
||||||
AMapLocationCoordinateTypeMapABC, ///<MapABC
|
|
||||||
AMapLocationCoordinateTypeSoSoMap, ///<SoSoMap
|
|
||||||
AMapLocationCoordinateTypeAliYun, ///<AliYun
|
|
||||||
AMapLocationCoordinateTypeGoogle, ///<Google
|
|
||||||
AMapLocationCoordinateTypeGPS, ///<GPS
|
|
||||||
}; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 转换目标经纬度为高德坐标系 |
|
||||||
* @param coordinate 待转换的经纬度 |
|
||||||
* @param type 坐标系类型 |
|
||||||
* @return 高德坐标系经纬度 |
|
||||||
*/ |
|
||||||
FOUNDATION_EXTERN CLLocationCoordinate2D AMapLocationCoordinateConvert(CLLocationCoordinate2D coordinate, AMapLocationCoordinateType type); |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 判断目标经纬度是否在大陆以及港、澳地区。输入参数为高德坐标系。 |
|
||||||
* @param coordinate 待判断的目标经纬度 |
|
||||||
* @return 是否在大陆以及港、澳地区 |
|
||||||
*/ |
|
||||||
FOUNDATION_EXTERN BOOL AMapLocationDataAvailableForCoordinate(CLLocationCoordinate2D coordinate); |
|
@ -1,17 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapLocationKit.h
|
|
||||||
// AMapLocationKit
|
|
||||||
//
|
|
||||||
// Created by AutoNavi on 15/10/22.
|
|
||||||
// Copyright © 2015年 Amap. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <AMapLocationKit/AMapLocationVersion.h> |
|
||||||
|
|
||||||
#import <AMapLocationKit/AMapLocationManager.h> |
|
||||||
#import <AMapLocationKit/AMapLocationCommonObj.h> |
|
||||||
#import <AMapLocationKit/AMapLocationRegionObj.h> |
|
||||||
|
|
||||||
#import <AMapLocationKit/AMapGeoFenceRegionObj.h> |
|
||||||
#import <AMapLocationKit/AMapGeoFenceManager.h> |
|
||||||
#import <AMapLocationKit/AMapGeoFenceError.h> |
|
@ -1,90 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapLocationRegionObj.h
|
|
||||||
// AMapLocationKit
|
|
||||||
//
|
|
||||||
// Created by AutoNavi on 15/11/27.
|
|
||||||
// Copyright © 2015年 Amap. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "AMapLocationCommonObj.h" |
|
||||||
|
|
||||||
// 以下类涉及的坐标需要使用高德坐标系坐标(GCJ02)
|
|
||||||
|
|
||||||
#pragma mark - AMapLocationRegion |
|
||||||
|
|
||||||
|
|
||||||
///AMapLocationRegion类,该类提供范围类的基本信息,并无具体实现,不要直接使用。
|
|
||||||
@interface AMapLocationRegion : NSObject<NSCopying> |
|
||||||
|
|
||||||
///AMapLocationRegion的identifier
|
|
||||||
@property (nonatomic, copy, readonly) NSString *identifier; |
|
||||||
|
|
||||||
///当进入region范围时是否通知,默认YES
|
|
||||||
@property (nonatomic, assign) BOOL notifyOnEntry; |
|
||||||
|
|
||||||
///当离开region范围时是否通知,默认YES
|
|
||||||
@property (nonatomic, assign) BOOL notifyOnExit; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 初始化方法 |
|
||||||
* @param identifier 唯一标识符,必填,不可为nil |
|
||||||
*/ |
|
||||||
- (instancetype)initWithIdentifier:(NSString *)identifier; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 坐标点是否在范围内 |
|
||||||
* @param coordinate 要判断的坐标点 |
|
||||||
* @return 是否在范围内 |
|
||||||
*/ |
|
||||||
- (BOOL)containsCoordinate:(CLLocationCoordinate2D)coordinate; |
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
#pragma mark - AMapLocationCircleRegion |
|
||||||
|
|
||||||
|
|
||||||
///AMapLocationCircleRegion类,定义一个圆形范围。
|
|
||||||
@interface AMapLocationCircleRegion : AMapLocationRegion |
|
||||||
|
|
||||||
///中心点的经纬度坐标
|
|
||||||
@property (nonatomic, readonly) CLLocationCoordinate2D center; |
|
||||||
|
|
||||||
///半径,单位:米
|
|
||||||
@property (nonatomic, readonly) CLLocationDistance radius; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 根据中心点和半径生成圆形范围 |
|
||||||
* @param center 中心点的经纬度坐标 |
|
||||||
* @param radius 半径,单位:米 |
|
||||||
* @param identifier 唯一标识符,必填,不可为nil |
|
||||||
* @return AMapLocationCircleRegion类实例 |
|
||||||
*/ |
|
||||||
- (instancetype)initWithCenter:(CLLocationCoordinate2D)center radius:(CLLocationDistance)radius identifier:(NSString *)identifier; |
|
||||||
|
|
||||||
|
|
||||||
@end |
|
||||||
|
|
||||||
#pragma mark - AMapLocationPolygonRegion |
|
||||||
|
|
||||||
|
|
||||||
///AMapLocationCircleRegion类,定义一个闭合多边形范围,点与点之间按顺序尾部相连, 第一个点与最后一个点相连。
|
|
||||||
@interface AMapLocationPolygonRegion : AMapLocationRegion |
|
||||||
|
|
||||||
///经纬度坐标点数据
|
|
||||||
@property (nonatomic, readonly) CLLocationCoordinate2D *coordinates; |
|
||||||
|
|
||||||
///经纬度坐标点的个数
|
|
||||||
@property (nonatomic, readonly) NSInteger count; |
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 根据经纬度坐标数据生成闭合多边形范围 |
|
||||||
* @param coordinates 经纬度坐标点数据,coordinates对应的内存会拷贝,调用者负责该内存的释放 |
|
||||||
* @param count 经纬度坐标点的个数,不可小于3个 |
|
||||||
* @param identifier 唯一标识符,必填,不可为nil |
|
||||||
* @return AMapLocationCircleRegion类实例 |
|
||||||
*/ |
|
||||||
- (instancetype)initWithCoordinates:(CLLocationCoordinate2D *)coordinates count:(NSInteger)count identifier:(NSString *)identifier; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@end |
|
@ -1,26 +0,0 @@ |
|||||||
//
|
|
||||||
// AMapLoctionVersion.h
|
|
||||||
// AMapLocationKit
|
|
||||||
//
|
|
||||||
// Created by AutoNavi on 16/1/22.
|
|
||||||
// Copyright © 2016年 Amap. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h> |
|
||||||
#import <AMapFoundationKit/AMapFoundationVersion.h> |
|
||||||
|
|
||||||
#ifndef AMapLoctionVersion_h |
|
||||||
#define AMapLoctionVersion_h |
|
||||||
|
|
||||||
#define AMapLocationVersionNumber 20607 |
|
||||||
#define AMapLocationFoundationVersionMinRequired 10604 |
|
||||||
|
|
||||||
// 依赖库版本检测
|
|
||||||
#if AMapFoundationVersionNumber < AMapLocationFoundationVersionMinRequired |
|
||||||
#error "The AMapFoundationKit version is less than minimum required, please update! Any questions please to visit http://lbs.amap.com"
|
|
||||||
#endif |
|
||||||
|
|
||||||
FOUNDATION_EXTERN NSString * const AMapLocationVersion; |
|
||||||
FOUNDATION_EXTERN NSString * const AMapLocationName; |
|
||||||
|
|
||||||
#endif /* AMapLoctionVersion_h */ |
|
@ -1,6 +0,0 @@ |
|||||||
framework module AMapLocationKit { |
|
||||||
umbrella header "AMapLocationKit.h" |
|
||||||
|
|
||||||
export * |
|
||||||
module * { export * } |
|
||||||
} |
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue