gloox 1.0

annotations.h

00001 /*
00002   Copyright (c) 2005-2009 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 
00015 #ifndef ANNOTATIONS_H__
00016 #define ANNOTATIONS_H__
00017 
00018 #include "macros.h"
00019 
00020 #include "annotationshandler.h"
00021 #include "privatexml.h"
00022 #include "privatexmlhandler.h"
00023 
00024 #include <string>
00025 #include <list>
00026 
00027 namespace gloox
00028 {
00029 
00030   class Tag;
00031 
00094   class GLOOX_API Annotations : public PrivateXML, public PrivateXMLHandler
00095   {
00096     public:
00101       Annotations( ClientBase* parent );
00102 
00106       virtual ~Annotations();
00107 
00113       void storeAnnotations( const AnnotationsList& aList );
00114 
00119       void requestAnnotations();
00120 
00125       void registerAnnotationsHandler( AnnotationsHandler* ah )
00126         { m_annotationsHandler = ah; }
00127 
00131       void removeAnnotationsHandler()
00132         { m_annotationsHandler = 0; }
00133 
00134       // reimplemented from PrivateXMLHandler
00135       virtual void handlePrivateXML( const Tag* xml );
00136 
00137       // reimplemented from PrivateXMLHandler
00138       virtual void handlePrivateXMLResult( const std::string& uid, PrivateXMLResult pxResult );
00139 
00140     private:
00141       AnnotationsHandler* m_annotationsHandler;
00142 
00143   };
00144 
00145 }
00146 
00147 #endif // ANNOTATIONS_H__