//
//  MVMCoreAlertOperation.h
//  myverizon
//
//  Created by Scott Pfeil on 9/28/15.
//  Copyright © 2015 Verizon Wireless. All rights reserved.
//
//  Operation for handling an alert. Should NOT be on the main queue.

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <MVMCore/MVMCoreOperation.h>
#import <MVMCoreUI/MVMCoreAlertDelegateProtocol.h>

@interface MVMCoreAlertOperation : MVMCoreOperation

/// Alert controller to be displayed.
@property (nonnull, readonly) UIAlertController *currentAlertView;

/// If this operation is temporarily paused.
@property (readonly, getter=isPaused) BOOL paused;

/// If this alert is a greedy alert (See MVMCoreAlertHandler).
@property (readonly, getter=isGreedy) BOOL greedy;

/// The alert delegate if needed.
@property (readonly, nullable, nonatomic, weak) NSObject <MVMCoreAlertDelegateProtocol> *alertDelegate;

/// Initializes the operation with the alert to display and if it is greedy or not.
- (nullable instancetype)initWithAlert:(nonnull UIAlertController *)alert isGreedy:(BOOL)isGreedy;
- (nullable instancetype)initWithAlert:(nonnull UIAlertController *)alert isGreedy:(BOOL)isGreedy alertDelegate:(nullable id <MVMCoreAlertDelegateProtocol>)alertDelegate;

/// Pauses the operation. Temporarily removes any alert.
- (void)pause;

/// Unpauses the operation, resuming any alert.
- (void)unpause;

@end
