//
//  MVMCoreUITopAlertExpandableView.h
//  mobilefirst
//
//  Created by Scott Pfeil on 8/18/16.
//  Copyright © 2016 Verizon Wireless. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MVMCoreUI/MVMCoreUITopAlertBaseView.h>
#import <MVMCore/MVMCoreTopAlertAnimationDelegateProtocol.h>

@class PrimaryButton;
@class MVMCoreUITopAlertShortView;
@class MVMCoreUITopAlertMainView;
@class MVMCoreTopAlertObject;

@interface MVMCoreUITopAlertExpandableView : MVMCoreUITopAlertBaseView

@property (nullable, weak, nonatomic) MVMCoreUITopAlertShortView *shortView;
@property (nullable, weak, nonatomic) MVMCoreUITopAlertMainView *buttonView;

// Setting this will hide the short view when the notification is collapsed.
@property (nonatomic) BOOL onlyShowTopMessageWhenCollapsed;

// A flag for if the top alert expandable view should collapse automatically after being expanded
@property (nonatomic) BOOL collapseAutomaticallyAfterExpanded;

// Standard
- (nullable instancetype)initWithTopAlertObject:(nonnull MVMCoreTopAlertObject *)topAlertObject animationDelegate:(nullable id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate viewToLayout:(nonnull UIView *)viewTolayout;

// Used primarily for when button presses will expand or collapse. (Short view button will need to be set manually)
- (nullable instancetype)initWithTopMessage:(nullable NSString *)topMessage message:(nullable NSString *)message buttonTitle:(nullable NSString *)buttonTitle animationDelegate:(nullable id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate viewToLayout:(nonnull UIView *)viewTolayout;
- (nullable instancetype)initWithTopMessage:(nullable NSString *)topMessage message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage buttonTitle:(nullable NSString *)buttonTitle animationDelegate:(nullable id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate viewToLayout:(nonnull UIView *)viewTolayout;

// Used when button uses standard action map.
- (nullable instancetype)initWithTopMessage:(nullable NSString *)topMessage message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage actionMap:(nullable NSDictionary *)actionMap additionalData:(nullable NSDictionary *)additionalData animationDelegate:(nullable id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate viewToLayout:(nonnull UIView *)viewTolayout;

// Convenience change functions
- (void)setTopMessage:(nullable NSString *)topMessage;
- (void)setTopMessage:(nullable NSString *)topMessage message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage actionMap:(nullable NSDictionary *)actionMap additionalData:(nullable NSDictionary *)additionalData;
- (void)setTopMessage:(nullable NSString *)topMessage message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage buttonTitle:(nullable NSString *)buttonTitle userActionHandler:(nullable void (^)(id  _Nonnull sender))userActionHandler;

// Setters for making buttons expand and collapse the cell.
- (void)setButtonPressToExpand;
- (void)setButtonPressToCollapse;
- (void)setShortViewPressToCollapse;
- (void)setShortViewPressToExpand;

// Animates
- (void)expand:(BOOL)animated;
- (void)collapse;

@end
