//
//  MVMCoreTopAlertObject.h
//  mobilefirst
//
//  Created by Scott Pfeil on 5/24/16.
//  Copyright © 2016 Verizon Wireless. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MVMCore/MVMCoreTopAlertDelegateProtocol.h>

extern NSUInteger const TopAlertDismissTime;

@interface MVMCoreTopAlertObject : NSObject

@property (nonatomic) BOOL persistent;
@property (nullable, nonatomic) NSString *type;

// The text
@property (nullable, strong, nonatomic) NSString *title;
@property (nullable, strong, nonatomic) NSString *message;
@property (nullable, strong, nonatomic) NSString *topMessage;

// For the button.
@property (nullable, strong, nonatomic) NSDictionary *buttonMap;
@property (nullable, strong, nonatomic) NSDictionary *additionalData;
@property (nonatomic) BOOL useCloseButton;

// For non action map driven button.
@property (nullable, strong, nonatomic) NSString *buttonTitle;
@property (nullable, copy, nonatomic) void (^userActionHandler)(id  _Nonnull sender);

@property (nullable, weak, nonatomic) NSObject <MVMCoreTopAlertDelegateProtocol> *delegate;

// This is used to ensure legacy style stays intact with new changes
@property (nonatomic) BOOL useNewStyle;

// The page type used for the top alert
@property (nullable, strong, nonatomic) NSString *pageType;

// image name or url used imageviews
@property (nullable, strong, nonatomic) NSString *imageNameOrURL;
@property (nullable, strong, nonatomic) NSString *aboveTextImageString;

// If 0, uses default 5 seconds.
@property (nonatomic) NSInteger topAlertDismissTime;

// Server can set color.
@property (nullable, strong, nonatomic) UIColor *backgroundColor;
@property (nullable, strong, nonatomic) UIColor *textColor;

- (nullable instancetype)initWithResponseInfo:(nullable NSDictionary *)responseInfo;

- (nullable instancetype)initWithType:(nullable NSString *)type message:(nullable NSString *)message;

- (nullable instancetype)initWithType:(nullable NSString *)type message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage persistent:(BOOL)persistent actionMap:(nullable NSDictionary *)actionMap additionalData:(nullable NSDictionary *)additionalData;

- (nullable instancetype)initWithType:(nullable NSString *)type message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage persistent:(BOOL)persistent buttonTitle:(nullable NSString *)buttonTitle userActionHandler:(nullable void (^)(id  _Nonnull sender))userActionHandler;

@end
