//
//  CustomInsetTextField.h
//  JasonDevelop
//
// Created by Jason Lee on 2013. 12. 6..
//  Copyright (c) jasondevelop. All rights reserved.
//
//  NIB에서 로드하는 경우 아래 값을 직접 설정한다.
//  hasMoveButton
//  disablePrevButton
//  disableNextButton


@import UIKit;

@protocol CustomTextFieldDelegate <UITextFieldDelegate>

@optional
- (void)moveToNextField:(id)sender;
- (void)moveToPrevField:(id)sender;
- (void)willHideKeyboard:(id)sender;
- (void)deleteBackward:(id)sender;
@end

typedef enum {
    CustomTextFieldSuperviewIsNone = 0,
    CustomTextFieldSuperviewIsViewController,   //부모뷰가 컨트롤러일 경우,
    CustomTextFieldSuperviewIsPopup,                //부모뷰가 팝업일 경우,
    CustomTextFieldSuperviewIsScrollView,           //부모뷰가 컨테이너일 경우,
    CustomTextFieldSuperviewIsPopupContentView,     //부모뷰가 팝업내의 컨테이너일 경우,
    CustomTextFieldSuperviewIsContentView,
    CustomTextFieldSuperviewIsChildViewController   //부모뷰가 컨테이너일 경우,
} CustomTextFieldSuperview;


@interface CustomTextField : UITextField

@property (nonatomic, assign) id <CustomTextFieldDelegate> delegate;

@property (nonatomic, assign) CustomTextFieldSuperview customTextFieldSuperview;
@property (nonatomic, assign) IBInspectable BOOL autoScrollUp;
@property (nonatomic, assign) IBInspectable BOOL hasMoveButton;       //set with interfacebuilder
@property (nonatomic, assign) IBInspectable BOOL disablePrevButton;   //set with interfacebuilder
@property (nonatomic, assign) IBInspectable BOOL disableNextButton;   //set with interfacebuilder

@property (nonatomic, strong) IBInspectable NSString *bgImageName;
@property (nonatomic, strong) IBInspectable NSString *bgPressImageName;
@property (nonatomic, strong) IBInspectable UIColor *placeHolderColor;

@property (assign, nonatomic) IBInspectable CGRect rectForCapBackground; //set with interfacebuilder

- (id)initWithFrame:(CGRect)frame bgImageName:(NSString *)btnImageName bgPressImageName:(NSString *)bgPressImageName;
- (id)initWithFrame:(CGRect)frame hasMoveButton:(BOOL)hasMooveButton disablePrev:(BOOL)disablePrev disableNext:(BOOL)disableNext;

@end

@interface CustomTextField2 : CustomTextField //circleTextfield

@end

@interface CustomSearchTextField : CustomTextField

@end

@interface CustomMenuTextFieldMenu : NSObject

@property (assign, nonatomic) id target;
@property (assign, nonatomic) SEL selector;
@property (strong, nonatomic) NSString *menu;

@end

@interface CustomMenuTextField : CustomTextField

@property (strong, nonatomic) NSArray *menuArray;
@property (strong, nonatomic) NSArray *menuItems;

@end

@interface CustomButtonTextField : CustomMenuTextField

@end





