Bold360 and BoldChat Developer Center

BCFormField.h

Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 LogMeIn Inc. All rights reserved.
3 //
4 
5 #import <Foundation/Foundation.h>
6 
7 @class BCFormFieldOption;
8 
14 typedef NS_ENUM(NSInteger, BCFormFieldType) {
15  BCFormFieldTypeText,
16  BCFormFieldTypeSelect,
17  BCFormFieldTypeRadio,
18  BCFormFieldTypeRating,
19  BCFormFieldTypePhone,
20  BCFormFieldTypeEmail,
21 };
22 
27 @interface BCFormField : NSObject
28 
33 @property(nonatomic, readonly)BCFormFieldType type;
34 
39 @property(nonatomic, copy, readonly)NSString *key;
40 
45 @property(nonatomic, readonly)BOOL isMultiline;
46 
51 @property(nonatomic, copy, readonly)NSString *label;
52 
57 @property(nonatomic, copy, readonly)NSString *labelBrandingKey;
58 
63 @property(nonatomic, readonly)BOOL isRequired;
64 
69 @property(nonatomic, readonly)BOOL isVisible;
70 
75 @property(nonatomic, readonly)BOOL isDepartmentStatusVisible;
76 
81 @property(nonatomic, readonly)BCFormFieldOption *defaultOption;
82 
87 @property(nonatomic, copy, readonly)NSArray *options;
88 
93 @property(nonatomic, strong)NSString *value;
94 
110 + (id)formFieldWithType:(BCFormFieldType)type
111  key:(NSString *)key
112  isMultiline:(BOOL)isMultiline
113  label:(NSString *)label
114  labelBrandingKey:(NSString *)labelBrandingKey
115  isRequired:(BOOL)isRequired
116  isVisible:(BOOL)isVisible
117 isDepartmentStatusVisible:(BOOL)isDepartmentStatusVisible
118  defaultValue:(NSString *)defaultValue
119  options:(NSArray *)options;
120 
135 - (id)initWithType:(BCFormFieldType)type
136  key:(NSString *)key
137  isMultiline:(BOOL)isMultiline
138  label:(NSString *)label
139  labelBrandingKey:(NSString *)labelBrandingKey
140  isRequired:(BOOL)isRequired
141  isVisible:(BOOL)isVisible
142 isDepartmentStatusVisible:(BOOL)isDepartmentStatusVisible
143  defaultValue:(NSString *)defaultValue
144  options:(NSArray *)options;
145 
146 @end
BOOL isRequired
Indicates if there should be validation on this field to ensure the user enters information, or selects a value.
Definition: BCFormField.h:63
NSString * labelBrandingKey
The branding value key that should be used for the label, or null if this is a custom field...
Definition: BCFormField.h:57
BOOL isMultiline
If the text field is BCFormFieldTypeText then this field indicates if the text input field should hav...
Definition: BCFormField.h:45
Container class for storing information about an option for BCFormFieldTypeSelect or BCFormFieldTypeR...
Definition: BCFormFieldOption.h:11
BCFormFieldType type
Type of the form field.
Definition: BCFormField.h:33
BOOL isDepartmentStatusVisible
If the field is type BCFormFieldTypeSelect and is a BoldChat department selection type of field then ...
Definition: BCFormField.h:75
BCFormFieldOption * defaultOption
If the form field type is BCFormFieldTypeSelect or BCFormFieldTypeRadio it holds the default option...
Definition: BCFormField.h:81
NSString * value
The value that has been set for this field, or nil if is unset.
Definition: BCFormField.h:93
NSString * key
When submitting this is the key field that the server will be expecting.
Definition: BCFormField.h:39
BOOL isVisible
Determines if the field should be shown to the user or not.
Definition: BCFormField.h:69
Container class for information about an individual form field. This class also contains the value to...
Definition: BCFormField.h:27
NSString * label
The prompt label for the form field.
Definition: BCFormField.h:51
NSArray * options
If the field is BCFormFieldTypeSelect or BCFormFieldTypeRadio then this method returns all the option...
Definition: BCFormField.h:87
typedef NS_ENUM(NSInteger, BCFormFieldType)
The type of a form field.
Definition: BCFormField.h:14