//
//  MFRadioButton.h
//  MobileFirstFramework
//
//  Created by Seshamani, Shreyas on 12/14/17.
//  Copyright © 2017 Verizon Wireless. All rights reserved.
//

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


typedef enum : NSUInteger {
    ButtonSizeSmall,//24
    ButtonSizeSmall1,//30
    ButtonSizeSmall2,//36
    ButtonSizeMedium,//48
    ButtonSizeLarge,//60
    ButtonSizeExtraLarge,//96
} ButtonSize;

@interface MFRadioButton : UIView <MVMCoreViewProtocol>


// THESE ARE JUST DUMMY APIS. They will be deleted later!!!!

typedef void (^PerformActionForRadioButton)(void);

/* perform action for accessibility action*/
@property (nullable, copy, nonatomic) PerformActionForRadioButton performActionForCheck;
typedef void (^CircleSelectedClosure)(_Nonnull id sender);


@property (nonatomic, strong, nullable)  UIColor*            fillColor;
@property (nonatomic, strong, nullable)  UIColor*            borderColor;
@property (nonatomic) CGFloat                                circleBorderWidth;
@property (nonatomic, copy, nullable)    CircleSelectedClosure circleSelectedBlock;
@property (nonatomic, copy, nullable)    CircleSelectedClosure handleSelectionBlock;
@property (nonatomic) CGFloat circleDiameter;
@property (nonatomic, nullable, strong, readonly) CAShapeLayer * myCircle;

@property (nonatomic, strong, nullable) NSLayoutConstraint *heightConstraint;
@property (nonatomic, strong, nullable) NSLayoutConstraint *widthConstraint;
@property (nonatomic) BOOL respondsToTapGesture;
@property (nonatomic, getter = isSelected) BOOL selected;

// Set line width manually
- (void)setCheckMarkLineWidth:(CGFloat)lineWidth;

// Determine and set line width based on circle diameter
- (void)calculateAndSetCheckMarkLineWidth;

- (void)setCheckMarkColor:(nullable UIColor *)color;

-(void)animateCheckMark;

-(void)drawCheckMarkWithoutAnimation;

-(void)animateSelect:(nullable UIColor *)fillColor BorderColor:(nullable UIColor *)borderColor;

- (void)addAccessibilityInformationIndex:(NSUInteger)index Total:(NSUInteger)totalCount;

#pragma mark - Convenience

/* Adds the border with the set border color and SelectableCircleBorderWidth */
- (void)addBorder;

/* Removes the border */
- (void)removeBorder;

/* Checks if the fill color is white*/
- (BOOL)isFillColorWhite;

/* Resize the circle for animations */
-(void)resize:(ButtonSize)newSize;

/* Deselect circle without calling blocks */
- (void)cancelSelection;

/* Disable the outer view */
- (void)disableState;

/* Enable outer view */
- (void)enableState;

#pragma mark - Animation
-(void)animateOutline:(nonnull UIColor *)strokeColor IsSelected:(BOOL)selected;

@end
