14 #ifndef DATAFORMFIELD_H__
15 #define DATAFORMFIELD_H__
82 DataFormField( DataFormFieldType type = FieldTypeTextSingle );
92 DataFormField(
const std::string& name,
const std::string& value =
"",
93 const std::string& label =
"", DataFormFieldType type = FieldTypeTextSingle );
118 virtual Tag* tag()
const;
124 virtual const std::string&
name()
const {
return m_name; }
132 virtual void setName(
const std::string& name ) { m_name = name; }
148 virtual void addOption(
const std::string& label,
const std::string& value )
149 { m_options.insert( std::make_pair( label, value ) ); }
155 virtual bool required()
const {
return m_required; }
161 virtual void setRequired(
bool required ) { m_required = required; }
173 virtual const std::string&
label()
const {
return m_label; }
179 virtual void setLabel(
const std::string& label ) { m_label = label; }
197 virtual const std::string&
value()
const {
return m_values.front(); }
203 virtual void setValue(
const std::string& value ) { m_values.clear(); addValue( value ); }
222 virtual void addValue(
const std::string& value ) { m_values.push_back( value ); }
231 DataFormFieldType m_type;
237 #endif // DATAFORMFIELD_H__