//
//  MVMCoreUIPageControl.h
//  MobileFirstFramework
//
//  Created by Seshamani, Shreyas on 1/5/18.
//  Copyright © 2018 Verizon Wireless. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MVMCore/MVMCoreViewProtocol.h>
#import <MVMCoreUI/MVMCoreUIMoleculeViewProtocol.h>
#import <MVMCoreUI/MVMCoreUIPagingProtocol.h>

@interface MVMCoreUIPageControl : UIControl <MVMCoreViewProtocol, MVMCoreUIMoleculeViewProtocol, MVMCoreUIPagingProtocol>

// These properties effectively do what their corresponding namesakes do in UIPageControl
@property (nonatomic) NSInteger currentPage;
@property (nonatomic) NSInteger numberOfPages;
@property (nonatomic, getter=isAnimated) BOOL animated;
@property (nullable, strong, nonatomic) UIColor *pageIndicatorTintColor;
@property (nullable, strong, nonatomic) UIColor *currentPageIndicatorTintColor;
@property (nullable, strong, nonatomic, readonly) NSArray *rectangles;
@property (nullable, weak, nonatomic) UIView *containerView;
@property (nullable, weak, nonatomic) UIView *indicatorRectangle;
@property (nullable, copy, nonatomic) PagingTouchBlock pagingTouchBlock;

///set YES to make the accessibility value as "Slide #currentPage of #totalPage", otherwise will be "Page #currentPage of #totalPage", default is NO
@property (nonatomic) BOOL isSlidesAcc;

/// This property may be used for indicating the user's selected option (not the currentPage). For instance, in Plan Explore Sizes, it indicates what plan the user is currently on.
@property (nonatomic) NSInteger persistentPreselectedPage;

//customize pagecontrol properties
@property (nonatomic) CGFloat rectangleWidth;

/// Indicates the color of the persistentPreselectedPage
@property (nullable, strong, nonatomic) UIColor *persisitentPreselectedPageTintColor;

//top bottom constraints
@property (nullable, strong, nonatomic) NSLayoutConstraint *topConstraint;
@property (nullable, strong, nonatomic) NSLayoutConstraint *bottomConstraint;

//a flag to allow to send UIControlEventValueChanged actions all the time
//e.g. going to previous element at first place and going to next at last place
//While current rectangle won't change, need update current page
@property (nonatomic) BOOL alwaysSendingControlEvent;

- (nullable instancetype)initWithAnimation:(BOOL)animated;
- (void)setCurrentPage:(NSInteger)currentPage animated:(BOOL)animated;

// Sets up the horizontal constraint to have the pages centered horizontally.
- (void)setupHorizontalConstraints;

// For subclassing only.
- (void)setupView;
- (void)setupRectangles;

- (void)setTopBottomSpace:(CGFloat)constant;

@end
