//
//  CustomAlertView.h
//  JasonDevelop
//
//  Created by Jason Lee on 3/6/14.
//  Copyright (c) jasondevelop. All rights reserved.
//

@import UIKit;

#import "CustomLabel.h"
#import "CustomButton.h"
#import "CommonUtil.h"

#define kfLabelTopMargin 15.0f
#define kfLabelBottomMargin 15.0f
#define kfLabelMargin 15.0f
#define kfButtonOriginX 15.0f
#define kfButtonMargin 10.0f
#define kfBottomMargin 15.0f
#define kfBodyMargin 2.0f

@class CustomAlertView;

typedef void(^CustomAlertViewCallBackHandler)(CustomAlertView *alertView, NSInteger buttonIndex);

@interface CustomAlertView : UIView {
@protected
    NSString *_okButtonTitle, *_cancelButtonTitle;
}

@property (weak, nonatomic) IBOutlet UIView *popUpView;
@property (weak, nonatomic) IBOutlet UIView *containerView;
@property (weak, nonatomic) IBOutlet UIView *maskingView;

@property (weak, nonatomic) IBOutlet UILabel *lblTitle;
@property (weak, nonatomic) IBOutlet UILabel *lblBoldMessage;
@property (weak, nonatomic) IBOutlet CustomLabel *lblMessage1;
@property (weak, nonatomic) IBOutlet CustomLabel *lblMessage2;


@property (weak, nonatomic) IBOutlet CustomButton *btnConfirm;
@property (weak, nonatomic) IBOutlet CustomButton *btnCancel;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnSameWidth;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnConfirmWidth;

/**
 커스텀 얼럿을 제공한다.
 @param title
 얼럿타이틀
 @param message
 메시지
 @param delegate
 딜리게이트
 @param okButtonTitle
 OK버튼이름
 @param cancelButtonTitle
 Cancel버튼이름
 @return CustomAlert*
 */
- (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate OKButtonTitle:(NSString *)okButtonTitle cancelButtonTitle:(NSString *)cancelButtonTitle;

/**
 커스텀 얼럿을 제공한다.
 @param title
 얼럿타이틀
 @param delegate
 딜리게이트
 @param okButtonTitle
 OK버튼이름
 @param cancelButtonTitle
 Cancel버튼이름
 @param message...
 상단볼드 메시지, 중간 메시지, 하단 메시지순서
 @return CustomAlert*
 */
- (id)initWithTitle:(NSString *)title delegate:(id)delegate OKButtonTitle:(NSString *)okButtonTitle cancelButtonTitle:(NSString *)cancelButtonTitle message:(NSString *)messages,... NS_REQUIRES_NIL_TERMINATION;

- (void)show;
- (void)showWithCompletion:(CustomAlertViewCallBackHandler)completion;

- (IBAction)btnConfirmTouched:(id)sender;
- (IBAction)btnCancelTouched:(id)sender;
@end
