#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/**
* Banner UIComponent middle layer (refer to AppLovinMAXAdViewUIComponent design).
 *
* Responsibilities:
* - Holds ATBannerDelegate instance (does not reuse ATPlatformBannerManager);
* - Adjust SDK to load banner ([ATAdManager loadADWithplacementID:extra:delegate:]);
* - After the onBannerLoaded callback of delegate is triggered, call retrieveBannerViewForplacementID:config: to get ATBannerView
* And addSubview to the external hostView (do not use ATBannerAdManager.showBanner);
* - Imperative load (ATBannerAdManager) is only responsible for preloading; if Show is ready when mounting Fabric, attach will also be triggered through onBannerLoaded;
* - Event driven, no polling.
 */
@interface ATBannerUIComponent : NSObject

- (instancetype)initWithHostView:(UIView *)hostView
                     placementID:(NSString *)placementID;

/// Fabric Incoming request size (pt), used when loading / attaching
- (void)updateAdSizeWidth:(CGFloat)width height:(CGFloat)height;

/// Trigger SDK load; auto-attach to hostView in delegate callback after load
- (void)loadAd;

/// Triggered by ATRNBannerView.layoutSubviews - when the SDK has been loaded but the superview has not been opened,
/// attachBannerViewIfReady will be postponed until layout is opened before addingSubview.
- (void)attachBannerViewIfReady;

/// Destroy: remove SDK view from hostView + clear delegate
- (void)destroy;

@end

NS_ASSUME_NONNULL_END
