//
//  InfoFieldModel.h
//  InforMobile
//
//  Created by Nookaraju Maddila on 7/14/17.
//  Copyright © 2017 Infor Global Solutions. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AppDefinitions.h"

typedef BOOL(^ SettingValueValidator)(DataType type, id value);

@interface ParameterCode : NSObject
@property (nonatomic, strong) NSString                  *fieldDescription;
@property (nonatomic, strong) NSString                  *name;
@property (nonatomic, assign) NSInteger                 codeID;

- (instancetype)initWithDictionary:(NSDictionary *)dict;

@end

@interface InfoFieldModel : NSObject
@property (nonatomic, strong) id                        value;
@property (nonatomic, strong) NSMutableDictionary       *representDict;
@property (nonatomic, strong, readonly) NSString        *displayName;
@property (nonatomic, strong, readonly) NSString        *fieldName;
@property (nonatomic, strong, readonly) NSArray         *codeList;
@property (nonatomic, assign, readonly) DataType     valueType;
@property (nonatomic, copy)   SettingValueValidator     validator;
@property (nonatomic, assign) BOOL                      editable;
@property (nonatomic, assign) BOOL                      isBeingEdited;
@property (nonatomic, assign, readonly) BOOL            modified;

@property (nonatomic, strong, readonly) NSString         *picketTitle;
@property (nonatomic, strong, readonly) NSString         *comboListKey;
@property (nonatomic, strong, readonly) NSString         *comboKeyId;

@property (nonatomic, assign) BOOL isRequiredField;
@property (nonatomic, assign) BOOL isRepresentativeField;
@property (nonatomic, assign) BOOL isPrivacyACLField;
// This property is only used when some alignment is required
@property (nonatomic, assign) CGFloat                   indentationWidth;
@property (nonatomic, assign) CGFloat   lineIndentationWidth;
@property (nonatomic, assign) NSInteger maxLength;
@property (nonatomic, assign) NSInteger maxValue,minValue;


@property (nonatomic, assign) BOOL isSettingField;


- (instancetype)initWithDisplayName:(NSString *)name
                          fieldName:(NSString *)field
                          valueType:(DataType)type
                              value:(id)value;
- (void)resetValue;
- (BOOL)editingValueRequiresKeyboard;
- (BOOL)editingValueRequiresPicker;
-(NSString *)getAccessabilityKey;
@end
