//
//  MFStyler.h
//  myverizon
//
//  Created by Scott Pfeil on 11/26/14.
//  Copyright (c) 2014 Verizon Wireless. All rights reserved.
//
//  Styles for mobile first.

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class LabelWithInternalButton;
@class MFSizeObject;

//enum for border
typedef NS_ENUM(NSInteger, MFViewBorder){
    MFViewBorderTop,
    MFViewBorderLeft,
    MFViewBorderBottom,
    MFViewBorderRight
};

typedef NS_ENUM(NSUInteger, MFTimeFormatUnit) {
    MFTimeFormatColon   = 0, /*!{days} : {hour} : {minutes} : {seconds} */
    MFTimeFormatNormal /* will end with days hours minutes seconds, when left days less than 2, it will change to 'day'*/
};

// Some standard spacings. Use these to stay consistent across the app.
extern CGFloat const PaddingDefault;
extern CGFloat const PaddingDefaultHorizontalSpacing;
extern CGFloat const PaddingDefaultVerticalSpacing;
extern CGFloat const PaddingBetweenFields;
extern CGFloat const PaddingHorizontalHeadlineWhiteView;
extern CGFloat const PaddingHorizontalLarge;
extern CGFloat const PaddingVerticalWhiteGrayView;
extern CGFloat const PaddingVerticalHeadlineAlternate;
extern CGFloat const PaddingPrimaryButtonTop;

// These are based on the multiple of 6 rule
extern CGFloat const PaddingOne;
extern CGFloat const PaddingTwo;
extern CGFloat const PaddingThree;
extern CGFloat const PaddingFour;
extern CGFloat const PaddingFive;
extern CGFloat const PaddingSix;
extern CGFloat const PaddingSeven;
extern CGFloat const PaddingEight;
extern CGFloat const PaddingNine;
extern CGFloat const PaddingTen;
extern CGFloat const TableCellParagraphSpace;
extern CGFloat const FooterLabelParagraphSpace;
extern CGFloat const WebViewInset;

extern CGFloat const HeightTableSeperatorHeight;

extern CGFloat const MFHeightForSwitch;
extern CGFloat const MFMFWidthForSwitch;

// Color constants
extern CGFloat const DisableOppacity;
extern CGFloat const PaymentMethodViewHeightWidthMultiplier;
extern CGFloat const MinCellHeight;
extern CGFloat const HeightIphone5;
extern CGFloat const DefaultOptionCellHeight;
extern CGFloat const LabelWithInternalButtonLineSpace;
extern CGFloat const PromoViewHeight;

@interface MFStyler : NSObject


// RoundedButtons
/**********Style Guidelines for BrandRefresh: *********

H1 -> HeadlineLarge
H2 -> Headline
H3 -> SubHead
B1 -> SubTitle
B2 -> Body
B3 -> Legal
 
*****************************************************/


// Generic scaling based on the detail width.
+ (nullable MFSizeObject *)sizeObjectGenericForCurrentDevice:(CGFloat)size;
+ (CGFloat)sizeFontGenericForCurrentDevice:(CGFloat)size;

#pragma mark - Spacing Defaults
+ (CGFloat)defaultHorizontalPaddingForApplicationWidth;
+ (CGFloat)defaultVerticalPaddingForApplicationWidth;
+ (CGFloat)defaultHorizontalPaddingForSize:(CGFloat)size;
+ (CGFloat)defaultVerticalPaddingForSize:(CGFloat)size;
+ (void)setDefaultMarginsForView:(nullable UIView *)view size:(CGFloat)size;
+ (void)setDefaultMarginsForView:(nullable UIView *)view size:(CGFloat)size horizontal:(BOOL)horizontal vertical:(BOOL)vertical;

//-------------------------------------------------
// Returns the fonts for these styles. Scales them as needed by default
#pragma mark - 2.0 fonts

//75Bd 40pt
+ (nullable UIFont *)fontH1:(BOOL)genericScaling;
+ (nullable UIFont *)fontH1;
//75Bd 25pt
+ (nullable UIFont *)fontH2:(BOOL)genericScaling;
+ (nullable UIFont *)fontH2;
//75Bd 18pt
+ (nullable UIFont *)fontH3:(BOOL)genericScaling;
+ (nullable UIFont *)fontH3;
//75Bd 32pt
+ (nullable UIFont *)fontH32:(BOOL)genericScaling;
+ (nullable UIFont *)fontH32;

//75Bd 13pt
+ (nullable UIFont *)fontB1:(BOOL)genericScaling;
+ (nullable UIFont *)fontB1;
//55Rg 13pt
+ (nullable UIFont *)fontB2:(BOOL)genericScaling;
+ (nullable UIFont *)fontB2;
//55Rg 11pt
+ (nullable UIFont *)fontB3:(BOOL)genericScaling;
+ (nullable UIFont *)fontB3;
//55Rg 20pt
+ (nullable UIFont *)fontB20:(BOOL)genericScaling;
+ (nullable UIFont *)fontB20;

#pragma mark - 1.0 fonts

//75Bd 100pt
+ (nullable UIFont *)fontForPlan;
//75Bd 48pt
+ (nullable UIFont *)fontForBiggerHeadline;
//75Bd 15pt
+ (nullable UIFont *)fontForHeadlineSmall;
//55Rg 14pt
+ (nullable UIFont *)fontforChatText;
//55Rg 16pt
+ (nullable UIFont *)fontForAccountLandingGreeting;
//55Rg 10pt
+ (nullable UIFont *)fontForProgressBarBottomLabel;
//55Rg 14pt
+ (nullable UIFont *)fontForPrimaryButton;
//75Bd 11pt
+ (nullable UIFont *)fontForSmallButton;
//55Rg 16pt
+ (nullable UIFont *)fontForTextField;
//55Rg 12pt
+ (nullable UIFont *)fontForTextFieldUnderLabel;
//55Rg 24pt
+ (nullable UIFont *)fontForHeadlineAlternative;
//75Bd 16pt
+ (nullable UIFont *)fontForFeedCardTitle;
//75Bd 60pt
+ (nullable UIFont *)fontForLargeLoyaltyHeaderTitle;
//75Bd 42pt
+ (nullable UIFont *)fontForLoyaltyTitleSmall;
//55Rg 20pt
+ (nullable UIFont *)fontForLoyaltyMessage;
//75Bd 10pt only for support
+ (nullable UIFont *)fontForUnreadMessageOnSupport;

//55Rg 16pt for 5G flow
+ (nullable UIFont *)font5GMessage:(BOOL)genericScaling;

//55Rg 16pt for 5G flow scale YES
+ (nullable UIFont *)font5GMessage;


// Returns the fonts for these styles allowing to apply a generic scale by device or not.
+ (nullable UIFont *)fontForBiggerHeadLine:(BOOL)genericScaling;
+ (nullable UIFont *)fontForPlan:(BOOL)genericScaling;
+ (nullable UIFont *)fontForHeadlineSmall:(BOOL)genericScaling;
+ (nullable UIFont *)fontForHeadlineSmall2;
+ (nullable UIFont *)fontForHeadlineSmall2:(BOOL)genericScaling;
+ (nullable UIFont *)fontForHeadlineSmall2ForWidth:(CGFloat)size;
+ (nullable UIFont *)fontB1ForWidth:(CGFloat)size;
+ (nullable UIFont *)fontForBodyWithSize:(CGFloat)size genericScaling:(BOOL)genericScaling;
+ (nullable UIFont *)fontB2ForWidth:(CGFloat)size;
+ (nullable UIFont *)fontForBodyWithSize:(CGFloat)size forWidth:(CGFloat)width;
+ (nullable UIFont *)fontforChatText:(BOOL)genericScaling;
+ (nullable UIFont *)fontForAccountLandingGreeting:(BOOL)genericScaling;

+ (nullable UIFont *)fontForPrimaryButton:(BOOL)genericScaling;
+ (nullable UIFont *)fontForPrimaryButtonForWidth:(CGFloat)size;
+ (nullable UIFont *)fontForSmallButton:(BOOL)genericScaling;
+ (nullable UIFont *)fontForSmallButtonForWidth:(CGFloat)size;
+ (nullable UIFont *)fontForTextField:(BOOL)genericScaling;
+ (nullable UIFont *)fontForTextFieldUnderLabel:(BOOL)genericScaling;
+ (nullable UIFont *)fontForHeadlineAlternative:(BOOL)genericScaling;
+ (nullable UIFont *)fontForHeadlineAlternativeForWidth:(CGFloat)size;

+ (nullable UIFont *)fontForFeedCardTitle:(BOOL)genericScaling;
+ (nullable UIFont *)fontForLargeLoyaltyHeaderTitle:(BOOL)genericScaling;
+ (nullable UIFont *)fontForLoyaltyTitleSmall:(BOOL)genericScaling;
+ (nullable UIFont *)fontForLoyaltyMessage:(BOOL)genericScaling;
+ (nullable UIFont *)fontForPtPCard:(BOOL)genericScaling;
+ (nullable UIFont *)fontForLabelWithTopLeftCircleWithSize:(CGFloat)size genericScaling:(BOOL)genericScaling;
+ (nullable UIFont *)fontOcratxtWitSize:(CGFloat)size genericScaling:(BOOL)genericScaling;
+ (nullable UIFont *)fontH255:(BOOL)genericScaling;

+ (nonnull UIFont *) boldFontForScaledSize:(CGFloat)size;
+ (nonnull UIFont *) regularFontForScaledSize:(CGFloat)size;

//-------------------------------------------------
// Applies the styles to the passed in objects.

#pragma mark - 2.0 styles

/// Will style the label based on the string. Accepted values, H1, H2, H3, H32, B1, B2, B3, B20
+ (void)styleLabel:(nonnull UILabel *)label withStyle:(nullable NSString *)style;

+ (void)styleLabelH1:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
+ (void)styleLabelH1:(nonnull UILabel *)label;

+ (void)styleLabelH2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
+ (void)styleLabelH2:(nonnull UILabel *)label;

+ (void)styleLabelH3:(nonnull UILabel *)label;
+ (void)styleLabelH3:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;

+ (void)styleLabelH32:(nonnull UILabel *)label;
+ (void)styleLabelH32:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;

+ (void)styleLabelB1:(nonnull UILabel *)label;
+ (void)styleLabelB1:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;

+ (void)styleLabelB2:(nonnull UILabel *)label;
+ (void)styleLabelB2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
+ (void)styleLabelB2:(nonnull UILabel *)label size:(CGFloat)size genericScaling:(BOOL)genericScaling;

+ (void)styleLabelB3:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
+ (void)styleLabelB3:(nonnull UILabel *)label;

+ (void)styleLabelB20:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
+ (void)styleLabelB20:(nonnull UILabel *)label;

+ (void)styleLabelTextStyle2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
+ (void)styleLabelTextStyle2:(nonnull UILabel *)label;

#pragma mark - 1.0 styles

+ (void)styleFeedCardTitleLabel:(nonnull UILabel *)label;
+ (void)styleFeedCardTagLabel:(nonnull UILabel *)label;

+ (void)styleStandardSeparatorView:(nonnull UIView *)view;

+ (void)styleLabelHeadlineSmall:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;


+ (void)styleFeedCardTitleLabel:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
+ (void)styleFeedCardTagLabel:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;

//-------------------------------------------------

#pragma mark - Attributed Strings

/// Will style the string based on the string. Accepted values, H1, H2, H3, H32, B1, B2, B3, B20
+ (nonnull NSAttributedString *)styleGetAttributedString:(nullable NSString *)string withStyle:(nullable NSString *)style;

+ (nonnull NSAttributedString *)styleGetAttributedString:(nullable NSString *)string font:(nonnull UIFont *)font color:(nonnull UIColor *)color;
+ (nonnull NSAttributedString *)styleGetH1AttributedString:(nullable NSString *)string;
+ (nonnull NSAttributedString *)styleGetH2AttributedString:(nullable NSString *)string;
+ (nonnull NSAttributedString *)styleGetH3AttributedString:(nullable NSString *)string;
+ (nonnull NSAttributedString *)styleGetB1AttributedString:(nullable NSString *)string;
+ (nonnull NSAttributedString *)styleGetB2AttributedString:(nullable NSString *)string;
+ (nonnull NSAttributedString *)styleGetB3AttributedString:(nullable NSString *)string;

+ (nonnull NSAttributedString *)styleGetDisabledB2AttributedString:(nullable NSString *)string;
+ (nonnull NSAttributedString *)styleGetDisabledB1AttributedString:(nullable NSString *)string;
+ (nonnull NSAttributedString *)styleGetTopAlignedAttributeStringWithLeftString:(nullable NSString *)left centerString:(nonnull NSString *)center rightString:(nullable NSString *)right withCenterStringFontSize:(CGFloat)fontSize andColor:(nonnull UIColor *)color;
+ (nonnull NSAttributedString *)styleGetTopAlignedAttributeStringWithLeftStringRightTop:(nullable NSString *)left centerString:(nonnull NSString *)center rightString:(nullable NSString *)right withCenterStringFontSize:(CGFloat)fontSize andColor:(nonnull UIColor *)color;
+ (void)styleGetAlignCenteredAttrituedString:(nullable NSMutableAttributedString *)string;
+(nonnull NSAttributedString *)styleGetBoldStringWithFont:(nonnull UIFont *)inputFont fromString:(nonnull NSString *)inputString;
+(nonnull NSString *)styleGetLowCaseSpace:(nullable NSString *)inputString;

//-------------------------------------------------
// Returns colors for Gradient Text presets

+ (nonnull NSArray *)gradientSpecialTicketGold;
+ (nonnull NSArray *)gradientSpecialTicketGoldCGColor;

#pragma mark - Custom Styling Views 

+ (void)styleView:(nonnull UIView *)view showMFViewBorder:(MFViewBorder)border withColor:(nonnull UIColor *)color borderLineWidth:(CGFloat)borderLineWidth borderLineLength:(CGFloat)borderLineLengh;
+ (void)styleTextField:(nonnull UITextField *)textField;
+ (nullable UIImage *)grayscaleImage:(nullable UIImage *)image;
+ (void)setGradientToLabel:(nonnull UILabel*)label withColors:(nonnull NSArray*)colors;
+ (nonnull NSDictionary *)labelStrokeAttributes:(nonnull UIColor *)color;

+ (void)mfStyleBlackPageControl:(nullable UIPageControl *)pageControl;
+ (void)mfStylePageControl:(nullable UIPageControl *)pageControl;

// leftTime should be left seconds
// timeformat should follow "DD:HH:MM:SS", No space inside!
+ (nonnull NSString *)getCountTime:(NSInteger)leftTime timeformat:(nonnull NSString *)timeFormat timeUnit:(MFTimeFormatUnit)timeUnit timeSuffix:(nullable NSString *)suffix;

+ (CGFloat)splitTextFieldWidth;
+ (CGFloat)splitTextFieldWidthForViewWidth:(CGFloat)width;

@end
