//
//  CustomTextView.h
//  JasonDevelop
//
//  Created by Jason Lee on 10/26/14.
//  Copyright (c) jasondevelop. All rights reserved.
//

@import UIKit;


typedef enum {
    CustomTextViewMoveMoveNone = 0,
    CustomTextViewMovePrev,
    CustomTextViewMoveNext,
    CustomTextVoewMoveBoth
} CustomTextViewMove;


typedef enum {
    CustomTextViewSuperviewIsNone = 0,
    CustomTextViewSuperviewIsViewController,   //부모뷰가 컨트롤러일 경우,
    CustomTextViewSuperviewIsPopup,                //부모뷰가 팝업일 경우,
    CustomTextViewSuperviewIsScrollView,           //부모뷰가 컨테이너일 경우,
    CustomTextViewSuperviewIsPopupContentView,     //부모뷰가 팝업내의 컨테이너일 경우,
    CustomTextViewSuperviewIsContentView,
    CustomTextViewSuperviewIsChildViewController   //부모뷰가 컨테이너일 경우,
} CustomTextViewSuperview;


@protocol CustomTextViewDelegate <UITextViewDelegate>

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

extern CGRect gKeyboardRect;

@interface CustomTextView : UITextView

@property (nonatomic, weak) id<CustomTextViewDelegate> delegate;


@property (nonatomic, assign) IBInspectable BOOL autoScrollUp;
@property (nonatomic, assign) IBInspectable CustomTextViewMove customTextViewMove;

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

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

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

@property (nonatomic, assign) CustomTextViewSuperview customTextViewSuperview;


@end
