//
// 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 enumeration
*/
typedef NS_ENUM(NSInteger, ATNativeBannerSizeType) {
ATNativeBannerSizeTypeSmall, // Small: 320 * 50
ATNativeBannerSizeTypeMiddle, // Medium: 320 * 90
ATNativeBannerSizeTypeBig, // Large: 300 * 250
ATNativeBannerSizeTypeLARGE, // Extra Large: 728 * 90
};
/**
* Native Banner Ad view class
* Used to display various components of a native Banner ad
*/
@interface ATNativeBannerView : UIView
#pragma mark - UI Components
/// Domain label - Displays the ad source domain - Required for Yandex ad platform
@property(nonatomic, strong) UILabel *domainLabel;
/// Warning label - Displays ad warning information - Required for Yandex ad platform
@property(nonatomic, strong) UILabel *warningLabel;
/// Advertiser label - Displays the advertiser name - Required for Yandex ad platform
@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 (CTA) label - Displays the 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 "Ad" identifier image view - Displays the ad "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 button / 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 media content from a third-party ad SDK
@property (nonatomic, strong) UIView *netWorkMediaView;
/// Third-party SDK media background view - Background of the media view. This view is only created when there is no MediaView and no main image (mainImageView).
@property (nonatomic, strong) UIView *netWorkMediaBackView;
/// Third-party SDK option view - Option 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 Returns YES if it is video content, otherwise returns NO
*/
- (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
*/
- (void)registerClickableViewArray:(NSArray <UIView *>*)registerClickViewArray;
#pragma mark - Ad Creative Properties, correspond to the content in the instantiated components above. These directly get the creative content rather than the component itself
/// Configuration dictionary - Contains various ad configuration information
@property (nonatomic, strong) NSDictionary *configurationDic;
/// Icon image - Ad icon
@property (nonatomic, strong) UIImage *iconImage;
/// Advertiser string - Advertiser name - Required for Yandex ad platform
@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 (CTA) string - e.g., "Download Now"
@property (nonatomic, strong) NSString *ctaString;
/// Ad warning string - Ad warning information - Required for Yandex ad platform. Choose one of this or the above warningLabel.
@property (nonatomic, strong) NSString *adWarnigString;
/// Domain string - Ad source domain - Required for Yandex ad platform. Choose one of this or the above domainLabel.
@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