dataform.h

00001 /*
00002   Copyright (c) 2005-2008 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
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__

Generated on Fri Oct 10 15:26:11 2008 for gloox by  doxygen 1.5.6