jiGuangXieZuo/ProductApp/Pods/GYSDK/GeYanSdk.framework/Headers/GyAuthViewModel.h

638 lines
18 KiB
C
Raw Normal View History

2024-10-17 16:36:05 +08:00
//
// GyAuthViewModel.h
// GySdkLib
//
// Created by lzy on 2019/7/19.
// Copyright © 2019 getui. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GyAuthPrivacyItem.h"
NS_ASSUME_NONNULL_BEGIN
typedef void(^GyVoidBlock)(void);
typedef BOOL(^GyBoolBlock)(void);
/**
*
* @param viewLifeCycle viewDidLoadviewWillAppearviewWillDisappearviewDidAppearviewDidDisappear
* @param animated
*/
typedef void(^OLAuthViewLifeCycleBlock)(NSString *viewLifeCycle, BOOL animated);
/// 授权页面旋转时的回调可在该回调中修改自定义视图的frame以适应新的布局
typedef void(^OLAuthVCTransitionBlock)(CGSize size, id <UIViewControllerTransitionCoordinator> coordinator, UIView *customAreaView);
typedef NS_ENUM(NSInteger, OLPullAuthVCStyle) {
OLPullAuthVCStyleModal,
OLPullAuthVCStylePush
};
@interface GyAuthViewModel : NSObject
//MARK: - StatusBar
/// 状态栏样式。 默认 `UIStatusBarStyleDefault`。
@property(nonatomic, assign) UIStatusBarStyle statusBarStyle;
/**
* UIUserInterfaceStyle UIUserInterfaceStyleLight @(UIUserInterfaceStyleLight)
*
* UIUserInterfaceStyle
* UIUserInterfaceStyleUnspecified -
* UIUserInterfaceStyleLight -
* UIUserInterfaceStyleDark - iOS 13+
*/
@property(nonatomic, strong) NSNumber *userInterfaceStyle;
//MARK: - LifeCycle
/// 授权页面视图生命周期回调。
@property(nullable, nonatomic, copy) OLAuthViewLifeCycleBlock viewLifeCycleBlock;
//MARK: - VCStyle
/// 进入授权页面的方式,默认为 modal 方式,即 present 到授权页面,从授权页面进入服务条款页面的方式与此保持一致
@property(nonatomic, assign) OLPullAuthVCStyle pullAuthVCStyle;
/// presentViewController 或者 pushViewController 授权页时, 是否设置动画animated。 默认YES
@property(nonatomic, assign) BOOL pullAnimate;
/**
*
* YES
* NO
* at 3.0.0.0
*/
@property(nullable, nonatomic, copy) GyBoolBlock clickAuthButtonBlock;
@end
//MARK: - 废弃
/**
* @abstract customAreaView为授权页面的view
*/
typedef void(^OLCustomUIHandler)(UIView *customAreaView);
/**
* @abstract 1
2
3
4123
5size默认都可以不用设置
6x轴方向偏移量有两个值可以设置portraitCenterXOffset为控件的x轴中点到弹窗x轴中点的距离portraitLeftXOffset为控件的左边缘到屏幕左边缘的距离
*/
typedef struct OLRect {
/**
*/
CGFloat portraitTopYOffset;
/**
x轴中点到屏幕x轴中点的距离0
x轴中点到弹窗x轴中点的距离0
*/
CGFloat portraitCenterXOffset;
/**
0
0
portraitLeftXOffset与portraitCenterXOffset设置一个即可portraitLeftXOffset优先级大于portraitCenterXOffset
portraitCenterXOffset属性失效
*/
CGFloat portraitLeftXOffset;
/**
*/
CGFloat landscapeTopYOffset;
/**
x轴中点到屏幕x轴中点的距离0
x轴中点到弹窗x轴中点的距离0
*/
CGFloat landscapeCenterXOffset;
/**
0
0
landscapeLeftXOffset与landscapeCenterXOffset设置一个即可landscapeLeftXOffset优先级大于landscapeCenterXOffset
landscapeCenterXOffset属性失效
*/
CGFloat landscapeLeftXOffset;
/**
0size才会生效size
*/
CGSize size;
} OLRect;
/**
* @abstract
*/
typedef NS_ENUM(NSInteger, OLAuthPopupAnimationStyle) {
OLAuthPopupAnimationStyleCoverVertical = 0,
OLAuthPopupAnimationStyleFlipHorizontal,
OLAuthPopupAnimationStyleCrossDissolve,
OLAuthPopupAnimationStyleCustom
};
/**
* Loading
* containerView为loading的全屏蒙版view
* containerView添加自定义loading
* block后loading将无效
*/
typedef void(^OLLoadingViewBlock)(UIView *containerView);
/**
* Loading[GeyanSDK stopLoading]
* containerView为loading的全屏蒙版view
*/
typedef void(^OLStopLoadingViewBlock)(UIView *containerView);
/**
*
*/
typedef void(^OLClickCheckboxBlock)(BOOL isChecked);
/**
*
*/
typedef void(^OLTapAuthBackgroundBlock)(void);
//MARK: - 废弃
@interface GyAuthViewModel()
//MARK: - Navigation/导航
/**
*/
@property(nullable, nonatomic, strong) NSAttributedString *naviTitle;
/**
*/
@property(nullable, nonatomic, strong) UIColor *naviBgColor;
/**
*/
@property(nullable, nonatomic, strong) UIImage *naviBackImage;
/**
*/
@property(nullable, nonatomic, strong) UIView *naviRightControl;
/**
*/
@property(nonatomic, assign) BOOL naviHidden;
/**
size为CGSizeMake(40, 40)
*/
@property(nonatomic, assign) OLRect backButtonRect;
/**
*/
@property(nonatomic, assign) BOOL backButtonHidden;
//MARK: - Logo/图标
/**
"applogo"
*/
@property(nullable, nonatomic, strong) UIImage *appLogo;
/**
Logo
*/
@property(nonatomic, assign) OLRect logoRect;
/**
Logo
*/
@property(nonatomic, assign) BOOL logoHidden;
/**
logo圆角0
*/
@property(nonatomic, assign) CGFloat logoCornerRadius;
//MARK: - Phone Number Preview/手机号预览
/**
*
*/
@property(nullable, nonatomic, strong) UIColor *phoneNumColor;
/**
* 24pt
*/
@property(nullable, nonatomic, strong) UIFont *phoneNumFont;
/**
*
*/
@property(nonatomic, assign) OLRect phoneNumRect;
//MARK: - Switch Button/切换按钮
/**
*
*/
@property(nullable, nonatomic, copy) NSString *switchButtonText;
/**
*
*/
@property(nullable, nonatomic, strong) UIColor *switchButtonColor;
/**
* nil
*/
@property(nullable, nonatomic, strong) UIColor *switchButtonBackgroundColor;
/**
* 15pt
*/
@property(nullable, nonatomic, strong) UIFont *switchButtonFont;
/**
*
*/
@property(nonatomic, assign) OLRect switchButtonRect;
/**
*
*/
@property(nonatomic, assign) BOOL switchButtonHidden;
//MARK: - Authorization Button/认证按钮
/**
* , @[, , ], ,
*/
@property(nullable, nonatomic, strong) NSArray<UIImage *> *authButtonImages;
/**
* "一键登录"
*/
@property(nullable, nonatomic, strong) NSAttributedString *authButtonTitle;
/**
*
*/
@property(nonatomic, assign) OLRect authButtonRect;
/**
* 5
*/
@property(nonatomic, assign) CGFloat authButtonCornerRadius;
//MARK: - Slogan/口号标语
/**
* Slogan
*/
@property(nonatomic, assign) OLRect sloganRect;
/**
* Slogan
*/
@property(nonatomic, strong) UIColor *sloganTextColor;
/**
* Slogan字体, 12pt
*/
@property(nonatomic, strong) UIFont *sloganTextFont;
//MARK: - CheckBox & Privacy Terms/隐私条款勾选框及隐私条款
/**
* YES
*/
@property(nonatomic, assign) BOOL defaultCheckBoxState;
/**
* 12x12
*/
@property(nullable, nonatomic, strong) UIImage *checkedImage;
/**
* 12x12
*/
@property(nullable, nonatomic, strong) UIImage *uncheckedImage;
/**
*
*/
@property(nonatomic, assign) CGSize checkBoxSize;
/**
* , 12pt
*/
@property(nullable, nonatomic, strong) NSDictionary<NSAttributedStringKey, id> *privacyTermsAttributes;
/**
* index为0.
*/
@property(nullable, nonatomic, strong) NSArray<GyAuthPrivacyItem *> *additionalPrivacyTerms;
/**
*
*/
@property(nullable, nonatomic, strong) UIColor *termTextColor;
/**
* 5020
*/
@property(nonatomic, assign) OLRect termsRect;
/**
* 4
* @[@"登录即同意", @"", @"", @"并使用本机号码登录"]
*/
@property(nullable, nonatomic, copy) NSArray<NSString *> *auxiliaryPrivacyWords;
/**
*
*/
@property(nullable, nonatomic, copy) OLClickCheckboxBlock clickCheckboxBlock;
/**
* NSTextAlignmentLeft
*/
@property(nonatomic, assign) NSTextAlignment termsAlignment;
/**
*
* PrivacyItem设置了回调将不会走这里
*/
@property(nullable, nonatomic, copy) OLPrivacyTermItemBlock carrierTermItemBlock;
/**
*
* NO
*/
@property(nonatomic, assign) BOOL hasQuotationMarkOnCarrierProtocol;
/**
*
* @{
* NSUnderlineStyleAttributeName: @NO,
* NSForegroundColorAttributeName: UIColor.redColor
* }
*/
@property(nonatomic, nullable, copy) NSDictionary *activeLinkAttributes;
/**
*
* YES
*/
@property(nonatomic, assign) BOOL showNotCheckProtocolHint;
/*
* y轴偏移量
* 0
*/
@property(nonatomic, assign) CGFloat protocolHintOffsetY;
/**
*
* YESsdk内置toast
* NOtoast
*/
@property(nullable, nonatomic, copy) GyBoolBlock protocolHintBlock;
//MARK: - Custom Area/自定义区域
/**
* block
* @discussion
* 使NSLayoutConstraint与相关的视图进行布局约束
* , , , ,
* , , , ,
*/
@property(nullable, nonatomic, copy) OLCustomUIHandler customUIHandler;
/**
* frame
*/
@property(nullable, nonatomic, copy) OLAuthVCTransitionBlock authVCTransitionBlock;
//MARK: - Background Image/授权页面背景图片
/**
*
*/
@property(nullable, nonatomic, strong) UIColor *backgroundColor;
/**
*
*/
@property(nullable, nonatomic, strong) UIImage *backgroundImage;
/**
*
*/
@property(nullable, nonatomic, strong) UIImage *landscapeBackgroundImage;
/**
* gif.
*/
@property(nullable, nonatomic, strong) NSString *backgroundGifPath;
/**
* video.
*/
@property(nullable, nonatomic, strong) NSString *backgroundVideoPath;
/**
* GIF video
* YES
*/
@property (nonatomic, assign) BOOL allowGifOrVideoPlayRepeat;
//MARK: - UIModalPresentationStyle
/**
present授权页面时的样式UIModalPresentationFullScreen
*/
@property(nonatomic, assign) UIModalPresentationStyle modalPresentationStyle;
/**
* present授权页面时的自定义动画
*/
@property(nonatomic, strong, nullable) CAAnimation *modalPresentationAnimation;
/**
* dismiss授权页面时的自定义动画
*/
@property(nonatomic, strong, nullable) CAAnimation *modalDismissAnimation;
//MARK: - orientationMask
/**
*
*/
@property(nonatomic, assign) UIInterfaceOrientationMask supportedInterfaceOrientations;
//MARK: - Popup
/**
*
*/
@property(nonatomic, assign) BOOL isPopup;
/**
x轴偏移只支持portraitLeftXOffset和landscapeLeftXOffset
*/
@property(nonatomic, assign) OLRect popupRect;
/**
6
*/
@property(nonatomic, assign) CGFloat popupCornerRadius;
/**
popupCornerRadius设置圆角大小popupRectCorners设置需要设置圆角的位置
popupRectCorners数组元素不超过四个@[@(UIRectCornerTopLeft), @(UIRectCornerTopRight)]
*/
@property(nonatomic, strong) NSArray<NSNumber *> *popupRectCorners;
/**
* popupAnimationStyle为OLAuthPopupAnimationStyleStyleCustom时CATransition对象来设置动画
*/
@property(nonatomic, assign) OLAuthPopupAnimationStyle popupAnimationStyle;
/**
*
*/
@property(nonatomic, strong, nullable) CAAnimation *popupTransitionAnimation;
/**
*/
@property(nullable, nonatomic, strong) UIImage *closePopupImage;
/**
*/
@property(nonatomic, strong) NSNumber *closePopupTopOffset;
/**
*/
@property(nonatomic, strong) NSNumber *closePopupRightOffset;
/**
11x22
*/
@property(nonatomic, assign) CGSize closePopupSize;
/**
*/
@property(nonatomic, assign) BOOL canClosePopupFromTapGesture;
/**
*
*/
@property(nonatomic, copy, nullable) OLTapAuthBackgroundBlock tapAuthBackgroundBlock;
/**
*
*
*/
@property(nonatomic, strong, nullable) UIView *popupMaskView;
//MARK: - Loading
/**
*
*/
@property(nonatomic, copy, nullable) OLLoadingViewBlock loadingViewBlock;
/**
* [GetanSDK stopLoading]
*/
@property(nonatomic, copy, nullable) OLStopLoadingViewBlock stopLoadingViewBlock;
//MARK: - WebViewController Navigation/服务条款页面导航栏
/**
*
*/
@property(nonatomic, assign) BOOL webBackBtnHidden;
/**
*
*/
@property(nonatomic, strong) UIImage *webBackBtnImg;
/**
size为CGSizeMake(40, 40)
*/
@property(nonatomic, assign) OLRect webBackBtnRect;
/**
*/
@property(nonatomic, assign) BOOL webNaviHidden;
/**
"服务条款"17pt
*/
@property(nullable, nonatomic, strong) NSAttributedString *webNaviTitle;
/**
*/
@property(nullable, nonatomic, strong) UIColor *webNaviBgColor;
//MARK: - Hint
/**
"请同意服务条款"
*/
@property(nullable, nonatomic, copy) NSString *notCheckProtocolHint;
@end
FOUNDATION_EXPORT OLRect GYOLRectMake(CGFloat y,
CGFloat centerX,
CGFloat x,
CGFloat yLandscape,
CGFloat centerXLandscape,
CGFloat xLandscape,
CGSize size);
FOUNDATION_EXPORT OLRect GYOLRectZero;
NS_ASSUME_NONNULL_END