00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef DATAFORM_H__
00015 #define DATAFORM_H__
00016
00017 #include "dataformbase.h"
00018
00019 #include <string>
00020 #include <list>
00021
00022 namespace gloox
00023 {
00024
00025 class Tag;
00026
00035 class GLOOX_API DataForm : public DataFormBase
00036 {
00037 public:
00041 enum DataFormType
00042 {
00043 FormTypeForm,
00045 FormTypeSubmit,
00047 FormTypeCancel,
00049 FormTypeResult,
00051 FormTypeInvalid
00053 };
00054
00062 DataForm( DataFormType type, const StringList& instructions, const std::string& title = "" );
00063
00071 DataForm( DataFormType type, const std::string& title = "" );
00072
00077 DataForm( Tag *tag );
00078
00082 DataForm();
00083
00087 virtual ~DataForm();
00088
00095 Tag* tag() const;
00096
00101 const std::string& title() const { return m_title; }
00102
00108 void setTitle( const std::string& title ) { m_title = title; }
00109
00114 const StringList& instructions() const { return m_instructions; }
00115
00123 void setInstructions( const StringList& instructions ) { m_instructions = instructions; }
00124
00130 DataForm::DataFormType type() const { return m_type; }
00131
00138 bool parse( Tag *tag );
00139
00140 private:
00141 StringList m_instructions;
00142
00143 DataFormType m_type;
00144 std::string m_title;
00145 };
00146
00147 }
00148
00149 #endif // DATAFORM_H__