AlicomCaptcha4SessionConfiguration.h 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // AlicomCaptcha4SessionConfiguration.h
  3. // AlicomCaptcha4
  4. //
  5. // Created by NikoXu on 2020/9/30.
  6. // Copyright © 2020 GT. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. /// 验证界面样式(User interface style)
  11. typedef NS_ENUM(NSInteger, AlicomC4UserInterfaceStyle) {
  12. /** 跟随系统样式(Follow system) */
  13. AlicomC4UserInterfaceStyleSystem = 0,
  14. /** 普通样式(Light) */
  15. AlicomC4UserInterfaceStyleLight,
  16. /** 暗黑样式(Dark) */
  17. AlicomC4UserInterfaceStyleDark,
  18. /** 默认样式(Default) */
  19. AlicomC4UserInterfaceStyleDefault = AlicomC4UserInterfaceStyleLight
  20. };
  21. /// 验证会话配置(Captcha session configuration)
  22. @interface AlicomCaptcha4SessionConfiguration : NSObject <NSCoding>
  23. /// 静态资源文件的路径, 默认为空。
  24. /// 如果为远程文件,则应为完成路径。
  25. /// 如果为本地文件,则应为文件所在路径(不包含文件)。
  26. /// The path of static resources, which is empty by default.
  27. @property (nullable, nonatomic, strong) NSString *resourcePath;
  28. /// 远程访问静态资源时的协议,默认 @“https”。
  29. /// Protocol for remote access to static resources, default is @ “https”.
  30. @property (nullable, nonatomic, strong) NSString *protocol;
  31. /// 静态服务地址,默认为空。
  32. @property (nullable, nonatomic, strong) NSArray<NSString *> *staticServers;
  33. /// 接口服务地址,默认为空。
  34. @property (nullable, nonatomic, strong) NSArray<NSString *> *apiServers;
  35. /// 界面和状态栏样式,默认 `AlicomC4UserInterfaceStyleLight`。
  36. /// User interface and statusBar style, which is white by default.
  37. @property (nonatomic, assign) AlicomC4UserInterfaceStyle userInterfaceStyle;
  38. /// 背景颜色,默认透明
  39. /// Defines color for captcha background. Default is transparent.
  40. @property (nonatomic, strong) UIColor *backgroundColor;
  41. /// 调试模式开关,默认关闭。
  42. /// Determines whether the debug information is shown on background,
  43. /// which is disable by default.
  44. @property (nonatomic, assign) BOOL debugEnable;
  45. /// 点击背景的交互,默认开启。
  46. /// Determines whether the background is able to interact,
  47. /// which is disable by default.
  48. @property (nonatomic, assign) BOOL backgroundUserInteractionEnable;
  49. /// 请求超时时长,默认 8 秒。
  50. /// The timeout of each request. Default is 8.0s.
  51. @property (nonatomic, assign) NSTimeInterval timeout;
  52. /// 语言,默认跟随系统。
  53. /// 如果系统为不支持的语言,则为中文简体。
  54. /// 指定语言请参考文档中的语言短码清单(ISO 639-2 标准)。
  55. /// Defines Language for captcha, which is same as system language by default.
  56. /// Display in English, if not supported.
  57. /// Please refer to the language short code(ISO 639-2 standard) for setting the language.
  58. @property (nonatomic, strong) NSString *language;
  59. /// 支持的横竖屏方向。
  60. /// The supported interface orientations.
  61. @property (assign, nonatomic) UIInterfaceOrientationMask supportedInterfaceOrientations;
  62. /// 额外的参数, 默认为空。参数将被组装后提交到验证服务。
  63. /// Additional parameter, which is empty by default.
  64. /// Parameters will be assembled and submitted to the captcha server.
  65. @property (nullable, nonatomic, strong) NSMutableDictionary *additionalParameter;
  66. /// 获得一个默认配置
  67. /// Get a default configuration.
  68. + (AlicomCaptcha4SessionConfiguration *)defaultConfiguration;
  69. @end
  70. NS_ASSUME_NONNULL_END