//
//  HLAdSplash.h
//  HLAd
//
//  Created by Liubin on 2022/9/14.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN


@class HLAdSplash;

@protocol HLAdSplashDelegate <NSObject>

/// 广告开始加载
- (void)splashAdDidStart:(HLAdSplash *)splashAd;

///  获取广告成功
- (void)splashAdLoadSuccess:(HLAdSplash *)splashAd;

///  广告成功展示
- (void)splashAdDidShow:(HLAdSplash *)splashAd;

/// 获取广告失败
/// @param error 失败原因
- (void)splashAdLoadFailed:(NSError*)error splashAd:(HLAdSplash *)splashAd;

/// 广告点击事件
- (void)splashAdDidClick:(HLAdSplash *)splashAd;

/// 广告关闭事件
- (void)splashAdDidClose:(HLAdSplash *)splashAd;

/// 内置浏览器打开
- (void)splashAdStartWebBrower:(HLAdSplash *)splashAd;

/// 内置浏览器关闭
- (void)splashAdWebBrowerDidClose:(HLAdSplash *)splashAd;

/// deeplink跳转App
- (void)splashAdViewDidOpenApp:(HLAdSplash *)splashAd;


@end

@interface HLAdSplash : UIView

@property (weak, nonatomic) id<HLAdSplashDelegate> delegate;

/// 展示半屏开屏广告时，建议使用bottomView，宽高根据您的需求设置
/// 开发者自定义底部View，可以在此View中设置应用Logo
@property (nonatomic, strong) UIView *bottomView;

/**
 * 初始化开屏广告
 * @param placementID 广告位ID
 * @param adSize 广告尺寸
 */
- (instancetype)initWithPlacementID:(NSString *)placementID
                             adSize:(CGSize)adSize;


/**
 * 加载广告，不展示
 */
- (void)loadAd;

/**
 * 展示广告
 * @param viewController 广告容器
*/
- (void)showAdInViewController:(UIViewController *)viewController;

/// 广告ecmp，单位：分
- (CGFloat)adEcpm;


@end




NS_ASSUME_NONNULL_END
