gloox 1.0
delayeddelivery.h
00001 /*
00002   Copyright (c) 2006-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 #ifndef DELAYEDDELIVERY_H__
00015 #define DELAYEDDELIVERY_H__
00016 
00017 #include "gloox.h"
00018 #include "jid.h"
00019 #include "stanzaextension.h"
00020 
00021 #include <string>
00022 
00023 namespace gloox
00024 {
00025 
00026   class Tag;
00027 
00038   class GLOOX_API DelayedDelivery : public StanzaExtension
00039   {
00040 
00041     public:
00048       DelayedDelivery( const JID& from, const std::string stamp,
00049                        const std::string& reason = "" );
00050 
00055       DelayedDelivery( const Tag* tag = 0 );
00056 
00060       virtual ~DelayedDelivery();
00061 
00068       const std::string& stamp() const { return m_stamp; }
00069 
00074       void setStamp( const std::string& stamp ) { m_stamp = stamp; }
00075 
00083       const JID& from() const { return m_from; }
00084 
00089       void setFrom( const JID& from ) { m_from = from; }
00090 
00095       const std::string& reason() const { return m_reason; }
00096 
00101       void setReason( const std::string& reason ) { m_reason = reason; }
00102 
00103       // reimplemented from StanzaExtension
00104       virtual const std::string& filterString() const;
00105 
00106       // reimplemented from StanzaExtension
00107       virtual StanzaExtension* newInstance( const Tag* tag ) const
00108       {
00109         return new DelayedDelivery( tag );
00110       }
00111 
00112       // reimplemented from StanzaExtension
00113       virtual Tag* tag() const;
00114 
00115       // reimplemented from StanzaExtension
00116       virtual StanzaExtension* clone() const
00117       {
00118         return new DelayedDelivery( *this );
00119       }
00120 
00121     private:
00122       JID m_from;
00123       std::string m_stamp;
00124       std::string m_reason;
00125       bool m_valid;
00126   };
00127 
00128 }
00129 
00130 #endif // DELAYEDDELIVERY_H__