PDRCoreAppInfo.h
7.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
//
// PDR_Application.h
// Pandora
//
// Created by Mac Pro on 12-12-22.
// Copyright 2012 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "H5CoreOverrideResourceOptions.h"
#import "PDRCoreDefs.h"
#import <UIKit/UIKit.h>
#import "PDRToolSystemEx.h"
typedef NS_ENUM(NSInteger, PDRCoreAppPopGesture) {
PDRCoreAppPopGestureNone = 0,
PDRCoreAppPopGestureClose,
PDRCoreAppPopGestureHide,
PDRCoreAppPopGestureSkip,
PDRCoreAppPopGestureAppBack
};
typedef NS_ENUM(NSInteger, PDRCoreAppFrameHistoryBack) {
PDRCoreAppFrameHistoryBackNone = 0,
PDRCoreAppFrameHistoryBackPopGesture,
PDRCoreAppFrameHistoryBackBackButton,
PDRCoreAppFrameHistoryBackAll
};
@interface PDRCoreAppUserAgentInfo : NSObject
@property(nonatomic, strong)NSString *value;
@property(nonatomic, assign)BOOL concatenate;
@end
@interface PDRCoreAppAuthorInfo : NSObject
@property(nonatomic, strong)NSString *email;
@property(nonatomic, strong)NSString *href;
@property(nonatomic, strong)NSString *content;
@end
@interface PDRCoreAppLicenseInfo : NSObject
@property(nonatomic, strong)NSString *href;
@property(nonatomic, strong)NSString *content;
@end
typedef NS_ENUM(int, PDRCoreWebviewCrashAction) {
PDRCoreWebviewCrashActionRestart = 1,
PDRCoreWebviewCrashActionReload,
PDRCoreWebviewCrashActionNone
};
@interface PDRCoreWebviewKernel : NSObject
@property(nonatomic, strong)NSString *name;
@property(nonatomic, assign)PDRCoreWebviewCrashAction crashAction;
+ (NSString*)getKernelWithName:(NSString*)name;
- (PDRCoreWebviewCrashAction)getCrashActionWithString:(NSString*)action;
@end
typedef NS_ENUM(NSInteger, PDRCoreWebviewMode) {
PDRCoreWebviewModeChild = 0,//child表示作为launchwebview的子窗口
PDRCoreWebviewModeFront, //front表示与launchwebview平级并在其前显示
PDRCoreWebviewModeBehind, //behind表示与launchwebview平级并在其后显示
PDRCoreWebviewModeParent // parent表示作为launchwebview的父窗口
};
typedef NS_ENUM(NSInteger, H5CoreAppSafeareaValue) {
H5CoreAppSafeareaValueNone = 1,
H5CoreAppSafeareaValueAuto
};
@interface H5CoreAppSafearea :NSObject
@property(nonatomic, strong)UIColor *backgroundColor;
@property(nonatomic, assign)H5CoreAppSafeareaValue top;
@property(nonatomic, assign)H5CoreAppSafeareaValue bottom;
@property(nonatomic, assign)H5CoreAppSafeareaValue left;
@property(nonatomic, assign)H5CoreAppSafeareaValue right;
+(instancetype)safeareaWithJson:(NSDictionary*)json;
@end
@interface PDRCoreWebviewConfig : NSObject
@property(nonatomic, strong)NSString *launch_path;
@property(nonatomic, strong)NSString *uid;
@property(nonatomic, assign)PDRCoreWebviewMode mode;
@property(nonatomic, assign)BOOL injection;
@property(nonatomic, strong)NSDictionary *overrideurl;
@property(nonatomic, strong)NSDictionary *additionHeads;
@property(nonatomic, strong)H5CoreOverrideResourceOptions *overrideResource;
@property(nonatomic, strong)NSDictionary* styles;
@end
typedef NS_ENUM(NSInteger, PDRCoreAppSplashscreenTarget) {
PDRCoreAppSplashscreenTargetDefalut = 0,
PDRCoreAppSplashscreenTargetSecond,
PDRCoreAppSplashscreenTargetCustorm
};
typedef NS_ENUM(NSInteger, H5CoreUniappControlMode) {
H5CoreUniappControlModeWebview = 1,
H5CoreUniappControlModeWeex
};
typedef NS_ENUM(NSInteger, H5CoreUniappControlRenderer) {
H5CoreUniappControlRendererAuto = 1,
H5CoreUniappControlRendererNative
};
typedef NS_ENUM(NSInteger, H5NVueJsframework) {
H5NVueJsframeworkUniapp = 1,
H5NVueJsframeworkWeex
};
@interface H5CoreAppUniAppInfo :NSObject
@property(nonatomic, assign)H5CoreUniappControlMode mode;
@property(nonatomic, assign)H5NVueJsframework jsframework;
@property(nonatomic, assign)H5CoreUniappControlRenderer renderer;
@property(nonatomic, strong)NSString *flexDirection;
@property(nonatomic, assign)BOOL forceUniApp;
@end
@interface PDRCoreAppCongfigParse : NSObject {
@private
// 应用权限目录
NSMutableDictionary *_permission;
}
@property(nonatomic, strong)NSDictionary *permission;
// 应用的主页面
@property(nonatomic, strong)NSString *appID;
@property(nonatomic, strong)NSString *appIDInMainifesh;
@property(nonatomic, assign)BOOL copyToReadWriteDir;
@property(nonatomic, strong)NSString *name;
@property(nonatomic, strong)NSString *version;
@property(nonatomic, assign)BOOL fullScreen;
@property(nonatomic, assign)BOOL allowsInlineMediaPlayback;
@property(nonatomic, assign)BOOL showSplashscreen;
@property(nonatomic, assign)BOOL autoClose;
@property(nonatomic, assign)BOOL autoclose_w2a;
@property(nonatomic, assign)BOOL splashShowWaiting;
@property(nonatomic, assign)PDRCoreAppSplashscreenTarget splashTarget;
@property(nonatomic, strong)NSString *splashWebviewTarget;
@property(nonatomic, assign)NSUInteger delay;
@property(nonatomic, assign)NSUInteger delay_w2a;
@property(nonatomic, copy)NSString *contentSrc;
@property(nonatomic, copy)NSString *description;
@property(nonatomic, strong)PDRCoreAppAuthorInfo *author;
@property(nonatomic, strong)PDRCoreAppLicenseInfo *license;
@property(nonatomic, strong)NSArray *adsInfo;
@property(nonatomic, strong)NSString* paid;
@property(nonatomic, strong)PDRCoreAppUserAgentInfo *userAgent;
@property(nonatomic, strong)NSString *adaptationSrc;
@property(nonatomic, copy)NSString *errorHtmlPath;
@property(nonatomic, assign)BOOL showErrorPage;
@property(nonatomic, assign)PDRCoreAppPopGesture popGesture;
@property(nonatomic, assign)BOOL isStreamCompetent;
@property(nonatomic, strong)NSDictionary *authorityValue;
@property(nonatomic, assign)BOOL isPostException;
@property(nonatomic, assign)BOOL isShowInputAssistBar;
@property(nonatomic, assign)BOOL bW2AShowLaunchError;
@property(nonatomic, assign)BOOL isPostJSException;
@property(nonatomic, assign)BOOL isEncrypt;
@property(nonatomic, assign)PDRCoreAppSSLActive defSSLActive;
@property(nonatomic, strong)NSArray* appWhitelist;
@property(nonatomic, strong)NSArray* schemeWhitelist;
@property(nonatomic, strong)PDRCoreWebviewKernel *kernel;
@property(nonatomic, strong)NSString *launch_path_w2a;
@property(nonatomic, strong)PDRCoreWebviewConfig *secondWebviewConfig;
@property(nonatomic, strong)PDRCoreWebviewConfig *launchwebviewWebviewConfig;
@property(nonatomic, copy)NSString *configPath; //配置文件全路径
@property(nonatomic, strong)H5CoreAppSafearea *safearea;
@property(nonatomic, strong)NSDictionary *splashAds;
@property(nonatomic, strong)NSString* arguments;
@property(nonatomic, strong)NSArray *orientation;
@property(nonatomic, assign)UIStatusBarStyle statusBarStyle;
@property(nonatomic, strong)UIColor *statusBarColor;
@property(nonatomic, assign)PDRCoreStatusBarMode statusBarMode;
@property(nonatomic, strong)H5CoreAppUniAppInfo *uniInfo;
@property(nonatomic, strong)NSDictionary *tabBarStyle;
- (int) load;
- (int) loadWithConfig:(NSString*)fullPath;
- (BOOL)lessThanPermission:(NSDictionary*)permission moreModes:(NSArray**)output;
- (BOOL)wap2appManefestIsChange:(PDRCoreAppCongfigParse*)oldManifest;
@end
@interface PDRCoreAppInfo : PDRCoreAppCongfigParse {
@private
}
@property(nonatomic, strong)NSString *indexPage;
@property(nonatomic, strong)NSString *wwwPath;
@property(nonatomic, strong)NSString *documentPath;
@property(nonatomic, strong)NSString *tmpPath;
@property(nonatomic, strong)NSString *logPath;
@property(nonatomic, strong)NSString *dataPath;
@property(nonatomic, strong)NSString *adaptationJS;
- (void)changeExecutableRootPath:(NSString *)executableRootPath;
- (void)setPathsWithExecutableRootPath:(NSString *)executableRootPath
workPath:(NSString *)wwwRootPath
workPath:(NSString *)workRootPath
docuPath:(NSString *)documentPath
constantPath:(NSString *)constantPath;
- (void)loadAdaptationJS;
- (void)webviewDefaultSetting;
- (void)registerForKVO;
- (void)unregisterFromKVO;
@end