//
// ATNativeBannerView.h
// AnyThinkSDK
//
// Created by GUO PENG on 2023/6/8.
// Copyright © 2023 AnyThink. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <AnyThinkSDK/ATScrollLabel.h>
#import <AnyThinkSDK/ATUnitGroupModel.h>
NS_ASSUME_NONNULL_BEGIN
/**
* Native banner ad size type enum
*/
typedef NS_ENUM(NSInteger, ATNativeBannerSizeType) {
ATNativeBannerSizeTypeSmall, // Small size: 320 * 50
ATNativeBannerSizeTypeMiddle, // Medium size: 320 * 90
ATNativeBannerSizeTypeBig, // Large size: 300 * 250
ATNativeBannerSizeTypeLARGE, // Extra large size: 728 * 90
};
/**
* Native banner ad view class
* Used to display the various components of a native banner ad
*/
@interface ATNativeBannerView : UIView
#pragma mark - UI Components
/// Domain label - Displays the ad source domain - Required for the Yandex ad network
@property(nonatomic, strong) UILabel *domainLabel;
/// Warning label - Displays ad warning information - Required for the Yandex ad network
@property(nonatomic, strong) UILabel *warningLabel;
/// Advertiser label - Displays the advertiser name
@property(nonatomic, strong) UILabel *advertiserLabel;
/// Ad content label - Displays the ad body content
@property(nonatomic, strong) UILabel *textLabel;
/// Ad title label - Displays the ad title
@property(nonatomic, strong) UILabel *titleLabel;
/// Call-to-action label (CTA) - Displays call-to-action text such as download
@property(nonatomic, strong) UILabel *ctaLabel;
/// Rating label - Displays the ad rating
@property(nonatomic, strong) UILabel *ratingLabel;
/// Sponsor label - Displays sponsor information
@property(nonatomic, strong) UILabel *sponsorLabel;
/// Ad identifier image view - Displays the ad identifier image
@property(nonatomic, strong) UIImageView *adImageView;
/// Icon view - Displays the app/advertiser icon
@property(nonatomic, strong) UIImageView *iconImageView;
/// Main image view - Displays the ad main image
@property(nonatomic, strong) UIImageView *mainImageView;
/// Advertiser Logo view - Displays the advertiser logo
@property(nonatomic, strong) UIImageView *logoImageView;
/// Dislike/close button - User can click to indicate disinterest and close the ad
@property(nonatomic, strong) UIButton *dislikeButton;
/// Third-party SDK media view - Used to display the media content of the third-party ad SDK
@property (nonatomic, strong) UIView *netWorkMediaView;
/// Third-party SDK media background view - Background of the third-party media view. Created when there is no MediaView and no main image (mainImageView).
@property (nonatomic, strong) UIView *netWorkMediaBackView;
/// Third-party SDK options view - Options view provided by the third-party ad SDK
@property (nonatomic, strong) UIView *netWorkOptionView;
#pragma mark - Ad Properties
/// TopOn rendering display banner size type
@property (nonatomic, assign) ATNativeBannerSizeType nativeBannerSizeType;
/// Ad rendering type
@property (nonatomic, assign) ATRenderingType nativeBannerRenderType;
#pragma mark - Methods
/**
* Determine whether the ad content is a video type
* @return YES if it is video content, NO otherwise
*/
- (BOOL)isVideoContents;
/**
* Get the self-rendering shake view
* @param frame View frame
* @return Shake view instance
*/
- (UIView *)getNetworkShakeViewWithFrame:(CGRect)frame;
/**
* Register click events for self-rendering ads
* @param registerClickViewArray Array of views that need click events added
*/
- (void)registerClickableViewArray:(NSArray <UIView *>*)registerClickViewArray;
#pragma mark - Ad Asset Properties (corresponding to the content in the components instantiated above. These provide direct access to asset content rather than the components)
/// Configuration dictionary - Contains various configuration information for the ad
@property (nonatomic, strong) NSDictionary *configurationDic;
/// Icon image - Ad icon
@property (nonatomic, strong) UIImage *iconImage;
/// Advertiser string - Advertiser name
@property (nonatomic, strong) NSString *advertiserString;
/// Title string - Ad title
@property (nonatomic, strong) NSString *titleString;
/// Content string - Ad body content
@property (nonatomic, strong) NSString *textString;
/// Call-to-action string (CTA) - e.g., "Download Now"
@property (nonatomic, strong) NSString *ctaString;
/// Ad warning string - Ad warning information - Required for the Yandex ad network. Choose one: this or the warningLabel above.
@property (nonatomic, strong) NSString *adWarnigString;
/// Domain string - Ad source domain - Required for the Yandex ad network. Choose one: this or the domainLabel above.
@property (nonatomic, strong) NSString *domainString;
/// Icon image URL string - Icon image address
@property (nonatomic, strong) NSString *iconImageURLString;
/// Main image URL string - Main image address
@property (nonatomic, strong) NSString *mainImageURLString;
/// Sponsor string - Sponsor information
@property (nonatomic, strong) NSString *sponsorString;
/// Custom extension string - Custom extension information
@property (nonatomic, strong) NSString *customExtString;
/// Logo string - Logo address
@property (nonatomic, strong) NSString *logoString;
@end
NS_ASSUME_NONNULL_END