delayeddelivery.h
/*
Copyright (c) 2006-2023 by Jakob Schröter <js@camaya.net>
This file is part of the gloox library. http://camaya.net/gloox
This software is distributed under a license. The full license
agreement can be found in the file LICENSE in this distribution.
This software may not be copied, modified, sold or distributed
other than expressed in the named license agreement.
This software is distributed without any warranty.
*/
#ifndef DELAYEDDELIVERY_H__
#define DELAYEDDELIVERY_H__
#include "gloox.h"
#include "jid.h"
#include "stanzaextension.h"
#include <string>
namespace gloox
{
class Tag;
class GLOOX_API DelayedDelivery : public StanzaExtension
{
public:
DelayedDelivery( const JID& from, const std::string stamp,
const std::string& reason = "" );
DelayedDelivery( const Tag* tag = 0 );
virtual ~DelayedDelivery();
const std::string& stamp() const { return m_stamp; }
void setStamp( const std::string& stamp ) { m_stamp = stamp; }
const JID& from() const { return m_from; }
void setFrom( const JID& from ) { m_from = from; }
const std::string& reason() const { return m_reason; }
void setReason( const std::string& reason ) { m_reason = reason; }
// reimplemented from StanzaExtension
virtual const std::string& filterString() const;
// reimplemented from StanzaExtension
virtual StanzaExtension* newInstance( const Tag* tag ) const
{
return new DelayedDelivery( tag );
}
// reimplemented from StanzaExtension
virtual Tag* tag() const;
// reimplemented from StanzaExtension
virtual StanzaExtension* clone() const
{
return new DelayedDelivery( *this );
}
private:
JID m_from;
std::string m_stamp;
std::string m_reason;
};
}
#endif // DELAYEDDELIVERY_H__
gloox::DelayedDelivery::setFrom
void setFrom(const JID &from)
Definition delayeddelivery.h:89
gloox::DelayedDelivery::DelayedDelivery
DelayedDelivery(const JID &from, const std::string stamp, const std::string &reason="")
Definition delayeddelivery.cpp:21
gloox::DelayedDelivery::clone
virtual StanzaExtension * clone() const
Definition delayeddelivery.h:116
gloox::DelayedDelivery::stamp
const std::string & stamp() const
Definition delayeddelivery.h:68
gloox::DelayedDelivery::setStamp
void setStamp(const std::string &stamp)
Definition delayeddelivery.h:74
gloox::DelayedDelivery::newInstance
virtual StanzaExtension * newInstance(const Tag *tag) const
Definition delayeddelivery.h:107
gloox::DelayedDelivery::from
const JID & from() const
Definition delayeddelivery.h:83
gloox::DelayedDelivery::reason
const std::string & reason() const
Definition delayeddelivery.h:95
gloox::DelayedDelivery::tag
virtual Tag * tag() const
Definition delayeddelivery.cpp:59
gloox::DelayedDelivery::setReason
void setReason(const std::string &reason)
Definition delayeddelivery.h:101
gloox::JID
An abstraction of a JID.
Definition jid.h:31
gloox::StanzaExtension::StanzaExtension
StanzaExtension(int type)
Definition stanzaextension.h:211
gloox::Tag
This is an abstraction of an XML element.
Definition tag.h:47
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28